本文整理匯總了PHP中question_preview_popup_params函數的典型用法代碼示例。如果您正苦於以下問題:PHP question_preview_popup_params函數的具體用法?PHP question_preview_popup_params怎麽用?PHP question_preview_popup_params使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了question_preview_popup_params函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: question_preview_link
/**
* Render an icon, optionally with the word 'Preview' beside it, to preview
* a given question.
* @param int $questionid the id of the question to be previewed.
* @param context $context the context in which the preview is happening.
* Must be a course or category context.
* @param bool $showlabel if true, show the word 'Preview' after the icon.
* If false, just show the icon.
*/
public function question_preview_link($questionid, context $context, $showlabel)
{
if ($showlabel) {
$alt = '';
$label = ' ' . get_string('preview');
$attributes = array();
} else {
$alt = get_string('preview');
$label = '';
$attributes = array('title' => $alt);
}
$image = $this->pix_icon('t/preview', $alt, '', array('class' => 'iconsmall'));
$link = question_preview_url($questionid, null, null, null, null, $context);
$action = new popup_action('click', $link, 'questionpreview', question_preview_popup_params());
return $this->action_link($link, $image . $label, $action, $attributes);
}
示例2: display_content
protected function display_content($question, $rowclasses) {
global $OUTPUT;
if (question_has_capability_on($question, 'use')) {
// Build the icon.
$image = $OUTPUT->pix_icon('t/preview', $this->strpreview, '', array('class' => 'iconsmall'));
$link = $this->qbank->preview_question_url($question);
$action = new popup_action('click', $link, 'questionpreview',
question_preview_popup_params());
echo $OUTPUT->action_link($link, $image, $action, array('title' => $this->strpreview));
}
}
示例3: quiz_question_preview_button
/**
* @param object $quiz the quiz settings
* @param object $question the question
* @param bool $label if true, show the preview question label after the icon
* @return the HTML for a preview question icon.
*/
function quiz_question_preview_button($quiz, $question, $label = false) {
global $CFG, $OUTPUT;
if (!question_has_capability_on($question, 'use', $question->category)) {
return '';
}
$url = quiz_question_preview_url($quiz, $question);
// Do we want a label?
$strpreviewlabel = '';
if ($label) {
$strpreviewlabel = get_string('preview', 'quiz');
}
// Build the icon.
$strpreviewquestion = get_string('previewquestion', 'quiz');
$image = $OUTPUT->pix_icon('t/preview', $strpreviewquestion);
$action = new popup_action('click', $url, 'questionpreview',
question_preview_popup_params());
return $OUTPUT->action_link($url, $image, $action, array('title' => $strpreviewquestion));
}
示例4: question_preview_icon
/**
* Render the preview icon.
*
* @param \stdClass $quiz the quiz settings from the database.
* @param \stdClass $question data from the question and quiz_slots tables.
* @param bool $label if true, show the preview question label after the icon
* @return string HTML to output.
*/
public function question_preview_icon($quiz, $question, $label = null)
{
$url = quiz_question_preview_url($quiz, $question);
// Do we want a label?
$strpreviewlabel = '';
if ($label) {
$strpreviewlabel = ' ' . get_string('preview', 'quiz');
}
// Build the icon.
$strpreviewquestion = get_string('previewquestion', 'quiz');
$image = $this->pix_icon('t/preview', $strpreviewquestion);
$action = new \popup_action('click', $url, 'questionpreview', question_preview_popup_params());
return $this->action_link($url, $image . $strpreviewlabel, $action, array('title' => $strpreviewquestion, 'class' => 'preview'));
}