protected function display_content($question, $rowclasses) {
global $OUTPUT;
if (question_has_capability_on($question, 'use')) {
- link_to_popup_window($this->qbank->preview_question_url($question->id), 'questionpreview',
- ' <img src="' . $OUTPUT->old_icon_url('t/preview') . '" class="iconsmall" alt="' . $this->strpreview . '" />',
- 0, 0, $this->strpreview, QUESTION_PREVIEW_POPUP_OPTIONS);
+ parse_str(QUESTION_PREVIEW_POPUP_OPTIONS, $options);
+ $image = new html_image();
+ $image->src = $OUTPUT->old_icon_url('t/preview');
+ $image->add_class('iconsmall');
+ $image->alt = $this->strpreview;
+
+ $link = html_link::make($this->qbank->preview_question_url($question->id), $this->strpreview);
+ $link->add_action(new popup_action('click', $link->url, 'questionpreview', $options));
+ $link->title = $this->strpreview;
+ echo $OUTPUT->link_to_popup($link, $image);
}
}
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)) {
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);
'" title="' . $stredit . '">' . $linktext . '</a>';
} else {
/// We have to edit in a pop-up.
- return link_to_popup_window($linkurl . '&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);
}
}
$link = '<b>'.$st->seq_number.'</b>';
} else {
if(isset($options->questionreviewlink)) {
- $link = link_to_popup_window($options->questionreviewlink .
- '&question=' . $question->id . '&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;
}