當前位置: 首頁>>代碼示例>>PHP>>正文


PHP MoodleQuickForm::getReqHTML方法代碼示例

本文整理匯總了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)));
     }
 }
開發者ID:educacionbe,項目名稱:cursos,代碼行數:37,代碼來源:formslib.php

示例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;
     }
 }
開發者ID:nagyistoce,項目名稱:moodle-Teach-Pilot,代碼行數:18,代碼來源:formslib.php

示例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');
 }
開發者ID:numbas,項目名稱:moodle,代碼行數:22,代碼來源:formslib.php

示例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);
 }
開發者ID:veritech,項目名稱:pare-project,代碼行數:13,代碼來源:formslib.php


注:本文中的MoodleQuickForm::getReqHTML方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。