本文整理汇总了PHP中MoodleQuickForm::getReqHTML方法的典型用法代码示例。如果您正苦于以下问题:PHP MoodleQuickForm::getReqHTML方法的具体用法?PHP MoodleQuickForm::getReqHTML怎么用?PHP MoodleQuickForm::getReqHTML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MoodleQuickForm
的用法示例。
在下文中一共展示了MoodleQuickForm::getReqHTML方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: startForm
/**
* What to do when starting the form
*
* @param MoodleQuickForm $form reference of the form
*/
function startForm(&$form)
{
global $PAGE;
$this->_reqHTML = $form->getReqHTML();
$this->_elementTemplates = str_replace('{req}', $this->_reqHTML, $this->_elementTemplates);
$this->_advancedHTML = $form->getAdvancedHTML();
$this->_collapseButtons = '';
$formid = $form->getAttribute('id');
parent::startForm($form);
if ($form->isFrozen()) {
$this->_formTemplate = "\n<div class=\"mform frozen\">\n{content}\n</div>";
} else {
$this->_formTemplate = "\n<form{attributes}>\n\t<div style=\"display: none;\">{hidden}</div>\n{collapsebtns}\n{content}\n</form>";
$this->_hiddenHtml .= $form->_pageparams;
}
if ($form->is_form_change_checker_enabled()) {
$PAGE->requires->yui_module('moodle-core-formchangechecker', 'M.core_formchangechecker.init', array(array('formid' => $formid)));
$PAGE->requires->string_for_js('changesmadereallygoaway', 'moodle');
}
if (!empty($this->_collapsibleElements)) {
if (count($this->_collapsibleElements) > 1) {
$this->_collapseButtons = $this->_collapseButtonsTemplate;
$this->_collapseButtons = str_replace('{strexpandall}', get_string('expandall'), $this->_collapseButtons);
$PAGE->requires->strings_for_js(array('collapseall', 'expandall'), 'moodle');
}
$PAGE->requires->yui_module('moodle-form-shortforms', 'M.form.shortforms', array(array('formid' => $formid)));
}
if (!empty($this->_advancedElements)) {
$PAGE->requires->strings_for_js(array('showmore', 'showless'), 'form');
$PAGE->requires->yui_module('moodle-form-showadvanced', 'M.form.showadvanced', array(array('formid' => $formid)));
}
}
示例2: startForm
/**
* What to do when starting the form
*
* @param MoodleQuickForm $form
*/
function startForm(&$form)
{
$this->_reqHTML = $form->getReqHTML();
$this->_elementTemplates = str_replace('{req}', $this->_reqHTML, $this->_elementTemplates);
$this->_advancedHTML = $form->getAdvancedHTML();
$this->_showAdvanced = $form->getShowAdvanced();
parent::startForm($form);
if ($form->isFrozen()) {
$this->_formTemplate = "\n<div class=\"mform frozen\">\n{content}\n</div>";
} else {
$this->_hiddenHtml .= $form->_pageparams;
}
}
示例3: startForm
/**
* What to do when starting the form
*
* @param MoodleQuickForm $form reference of the form
*/
function startForm(&$form)
{
global $PAGE;
$this->_reqHTML = $form->getReqHTML();
$this->_elementTemplates = str_replace('{req}', $this->_reqHTML, $this->_elementTemplates);
$this->_advancedHTML = $form->getAdvancedHTML();
$this->_showAdvanced = $form->getShowAdvanced();
parent::startForm($form);
if ($form->isFrozen()) {
$this->_formTemplate = "\n<div class=\"mform frozen\">\n{content}\n</div>";
} else {
$this->_formTemplate = "\n<form{attributes}>\n\t<div style=\"display: none;\">{hidden}</div>\n{content}\n</form>";
$this->_hiddenHtml .= $form->_pageparams;
}
$PAGE->requires->yui_module('moodle-core-formchangechecker', 'M.core_formchangechecker.init', array(array('formid' => $form->getAttribute('id'))));
$PAGE->requires->string_for_js('changesmadereallygoaway', 'moodle');
}
示例4: startForm
/**
* What to do when starting the form
*
* @param MoodleQuickForm $form
*/
function startForm(&$form)
{
$this->_reqHTML = $form->getReqHTML();
$this->_elementTemplates = str_replace('{req}', $this->_reqHTML, $this->_elementTemplates);
$this->_advancedHTML = $form->getAdvancedHTML();
$this->_showAdvanced = $form->getShowAdvanced();
parent::startForm($form);
}