本文整理汇总了PHP中question_edit_form::display方法的典型用法代码示例。如果您正苦于以下问题:PHP question_edit_form::display方法的具体用法?PHP question_edit_form::display怎么用?PHP question_edit_form::display使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类question_edit_form
的用法示例。
在下文中一共展示了question_edit_form::display方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: list
/**
* This method should be overriden if you want to include a special heading or some other
* html on a question editing page besides the question editing form.
*
* @param question_edit_form $mform a child of question_edit_form
* @param object $question
* @param string $wizardnow is '' for first page.
*/
function display_question_editing_page(&$mform, $question, $wizardnow)
{
list($heading, $langmodule) = $this->get_heading(empty($question->id));
print_heading_with_help($heading, $this->name(), $langmodule);
$permissionstrs = array();
if (!empty($question->id)) {
if ($question->formoptions->canedit) {
$permissionstrs[] = get_string('permissionedit', 'question');
}
if ($question->formoptions->canmove) {
$permissionstrs[] = get_string('permissionmove', 'question');
}
if ($question->formoptions->cansaveasnew) {
$permissionstrs[] = get_string('permissionsaveasnew', 'question');
}
}
if (!$question->formoptions->movecontext && count($permissionstrs)) {
print_heading(get_string('permissionto', 'question'), 'center', 3);
$html = '<ul>';
foreach ($permissionstrs as $permissionstr) {
$html .= '<li>' . $permissionstr . '</li>';
}
$html .= '</ul>';
print_box($html, 'boxwidthnarrow boxaligncenter generalbox');
}
$mform->display();
}
示例2: display_question_editing_page
/**
* This method should be overriden if you want to include a special heading or some other
* html on a question editing page besides the question editing form.
*
* @param question_edit_form $mform a child of question_edit_form
* @param object $question
* @param string $wizardnow is '' for first page.
*/
public function display_question_editing_page($mform, $question, $wizardnow) {
global $OUTPUT;
$heading = $this->get_heading(empty($question->id));
echo $OUTPUT->heading_with_help($heading, 'pluginname', $this->plugin_name());
$permissionstrs = array();
if (!empty($question->id)) {
if ($question->formoptions->canedit) {
$permissionstrs[] = get_string('permissionedit', 'question');
}
if ($question->formoptions->canmove) {
$permissionstrs[] = get_string('permissionmove', 'question');
}
if ($question->formoptions->cansaveasnew) {
$permissionstrs[] = get_string('permissionsaveasnew', 'question');
}
}
if (count($permissionstrs)) {
echo $OUTPUT->heading(get_string('permissionto', 'question'), 3);
$html = '<ul>';
foreach ($permissionstrs as $permissionstr) {
$html .= '<li>'.$permissionstr.'</li>';
}
$html .= '</ul>';
echo $OUTPUT->box($html, 'boxwidthnarrow boxaligncenter generalbox');
}
$mform->display();
}
示例3: display_question_editing_page
/**
* This method should be overriden if you want to include a special heading or some other
* html on a question editing page besides the question editing form.
*
* @param question_edit_form $mform a child of question_edit_form
* @param object $question
* @param string $wizardnow is '' for first page.
*/
public function display_question_editing_page($mform, $question, $wizardnow)
{
global $OUTPUT;
$heading = $this->get_heading(empty($question->id));
echo $OUTPUT->heading_with_help($heading, 'pluginname', $this->plugin_name());
$mform->display();
}
示例4: display_question_editing_page
/**
* This method should be overriden if you want to include a special heading or some other
* html on a question editing page besides the question editing form.
*
* @param question_edit_form $mform a child of question_edit_form
* @param object $question
* @param string $wizardnow is '' for first page.
*/
public function display_question_editing_page($mform, $question, $wizardnow)
{
global $OUTPUT;
$heading = $this->get_heading(empty($question->id));
if (get_string_manager()->string_exists('pluginname_help', $this->plugin_name())) {
echo $OUTPUT->heading_with_help($heading, 'pluginname', $this->plugin_name());
} else {
echo $OUTPUT->heading_with_help($heading, $this->name(), $this->plugin_name());
}
//Who cares about that:
// $permissionstrs = array();
// if (!empty($question->id)) {
// if ($question->formoptions->canedit) {
// $permissionstrs[] = get_string('permissionedit', 'question');
// }
// if ($question->formoptions->canmove) {
// $permissionstrs[] = get_string('permissionmove', 'question');
// }
// if ($question->formoptions->cansaveasnew) {
// $permissionstrs[] = get_string('permissionsaveasnew', 'question');
// }
// }
// if (!$question->formoptions->movecontext && count($permissionstrs)) {
// echo $OUTPUT->heading(get_string('permissionto', 'question'), 3);
// $html = '<ul>';
// foreach ($permissionstrs as $permissionstr) {
// $html .= '<li>'.$permissionstr.'</li>';
// }
// $html .= '</ul>';
// echo $OUTPUT->box($html, 'boxwidthnarrow boxaligncenter generalbox');
// }
$mform->display();
}
示例5: list
/**
* This method should be overriden if you want to include a special heading or some other
* html on a question editing page besides the question editing form.
*
* @param question_edit_form $mform a child of question_edit_form
* @param object $question
* @param string $wizardnow is '' for first page.
*/
function display_question_editing_page(&$mform, $question, $wizardnow)
{
list($heading, $langmodule) = $this->get_heading();
print_heading_with_help($heading, $this->name(), $langmodule);
$mform->display();
}