MDL-19820 Upgraded calls to link_to_popup_window()

This commit is contained in:
nicolasconnault
2009-08-20 13:17:43 +00:00
parent b6617dcd63
commit 80e7bb44cf
2 changed files with 25 additions and 14 deletions
+15 -11
View File
@@ -910,7 +910,7 @@ class default_questiontype {
provided the member functions it calls are overridden where required.
The layout is determined by the template question.html */
global $CFG;
global $CFG, $OUTPUT;
$isgraded = question_state_is_graded($state->last_graded);
if (isset($question->randomquestionid)) {
@@ -945,10 +945,11 @@ class default_questiontype {
if (!empty($options->questioncommentlink)) {
$strcomment = get_string('commentorgrade', 'quiz');
$commentlink = link_to_popup_window($options->questioncommentlink .
'?attempt=' . $state->attempt . '&question=' . $actualquestionid,
'commentquestion', $strcomment, 480, 750, $strcomment, 'none', true);
$commentlink = '<div class="commentlink">'. $commentlink .'</div>';
$link = html_link::make("$options->questioncommentlink?attempt=$state->attempt&question=$actualquestionid", $strcomment);
$link->add_action(new popup_action('click', $link->url, 'commentquestion', array('height' => 480, 'width' => 750)));
$link->title = $strcomment;
$commentlink = $OUTPUT->container($OUTPUT->link($link), 'commentlink');
}
$history = $this->history($question, $state, $number, $cmoptions, $options);
@@ -1055,8 +1056,10 @@ class default_questiontype {
'" title="' . $stredit . '">' . $linktext . '</a>';
} else {
/// We have to edit in a pop-up.
return link_to_popup_window($linkurl . '&amp;inpopup=1', 'editquestion',
$linktext, false, false, $stredit, '', true);
$link = html_link::make($linkurl . '&inpopup=1', $linktext);
$link->add_action(new popup_action('click', $link->url, 'editquestion'));
$link->title = $stredit;
return $OUTPUT->link($link);
}
}
@@ -1108,10 +1111,11 @@ class default_questiontype {
$link = '<b>'.$st->seq_number.'</b>';
} else {
if(isset($options->questionreviewlink)) {
$link = link_to_popup_window($options->questionreviewlink .
'&amp;question=' . $question->id . '&amp;state=' . $st->id,
'reviewquestion', $st->seq_number, 450, 650, $strreviewquestion,
'none', true);
$link = html_link::make("$options->questionreviewlink?state=$st->id&question=$question->id", $st->seq_number);
$link->add_action(new popup_action('click', $link->url, 'reviewquestion', array('height' => 450, 'width' => 650)));
$link->title = $strreviewquestion;
$link = $OUTPUT->link($link);
} else {
$link = $st->seq_number;
}