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


PHP moodleform::createElement方法代碼示例

本文整理匯總了PHP中moodleform::createElement方法的典型用法代碼示例。如果您正苦於以下問題:PHP moodleform::createElement方法的具體用法?PHP moodleform::createElement怎麽用?PHP moodleform::createElement使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在moodleform的用法示例。


在下文中一共展示了moodleform::createElement方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setupForm

 /**
  * Adds controls specific to this filter in the form.
  * @param moodleform $mform a MoodleForm object to setup
  */
 public function setupForm(&$mform)
 {
     $objs = array();
     $objs[] = $mform->createElement('select', $this->_name . '_rl', null, $this->get_roles());
     $objs[] = $mform->createElement('select', $this->_name . '_ct', null, $this->get_course_categories());
     $objs[] = $mform->createElement('text', $this->_name, null);
     $grp =& $mform->addElement('group', $this->_name . '_grp', $this->_label, $objs, '', false);
     $mform->setType($this->_name, PARAM_TEXT);
     if ($this->_advanced) {
         $mform->setAdvanced($this->_name . '_grp');
     }
 }
開發者ID:janaece,項目名稱:globalclassroom4_clean,代碼行數:16,代碼來源:courserole.php

示例2: setupForm

 /**
  * Adds controls specific to this filter in the form.
  * @param moodleform $mform a MoodleForm object to setup
  */
 public function setupForm(&$mform)
 {
     $objs = array();
     $objs[] = $mform->createElement('select', $this->_name . '_op', null, $this->get_operators());
     $objs[] = $mform->createElement('select', $this->_name, null, $this->_options);
     $grp =& $mform->addElement('group', $this->_name . '_grp', $this->_label, $objs, '', false);
     $mform->disabledIf($this->_name, $this->_name . '_op', 'eq', 0);
     if (!is_null($this->_default)) {
         $mform->setDefault($this->_name, $this->_default);
     }
     if ($this->_advanced) {
         $mform->setAdvanced($this->_name . '_grp');
     }
 }
開發者ID:janaece,項目名稱:globalclassroom4_clean,代碼行數:18,代碼來源:select.php

示例3: setupForm

 /**
  * Adds controls specific to this filter in the form.
  * @param moodleform $mform a MoodleForm object to setup
  */
 public function setupForm(&$mform)
 {
     $objs = array();
     $objs['limiter'] = $mform->createElement('select', $this->_name . '_op', null, $this->get_operators());
     $objs['limiter']->setLabel(get_string('limiterfor', 'filters', $this->_label));
     $objs['country'] = $mform->createElement('select', $this->_name, null, $this->_options);
     $objs['country']->setLabel(get_string('valuefor', 'filters', $this->_label));
     $grp =& $mform->addElement('group', $this->_name . '_grp', $this->_label, $objs, '', false);
     $mform->disabledIf($this->_name, $this->_name . '_op', 'eq', 0);
     if (!is_null($this->_default)) {
         $mform->setDefault($this->_name, $this->_default);
     }
     if ($this->_advanced) {
         $mform->setAdvanced($this->_name . '_grp');
     }
 }
開發者ID:pzhu2004,項目名稱:moodle,代碼行數:20,代碼來源:select.php

示例4: setupForm

 /**
  * Adds controls specific to this filter in the form.
  *
  * @param moodleform $mform a MoodleQuickForm object in which element will be added
  */
 public function setupForm(&$mform)
 {
     $objs = array();
     $objs[] = $mform->createElement('checkbox', $this->_name, null, '');
     $grp = $mform->addElement('group', $this->_name . '_grp', $this->_label, $objs, '', false);
     if ($this->_advanced) {
         $mform->setAdvanced($this->_name . '_grp');
     }
     // Check if disable if options are set. if yes then set rules.
     if (!empty($this->disableelements) && is_array($this->disableelements)) {
         foreach ($this->disableelements as $disableelement) {
             $mform->disabledIf($disableelement, $this->_name, 'checked');
         }
     }
 }
開發者ID:janaece,項目名稱:globalclassroom4_clean,代碼行數:20,代碼來源:checkbox.php

示例5: get_pattern_import_settings

 /**
  * Returns import settings for the specified field pattern
  * that consist of a list of mform elements to group, and
  * a list of corresponding labels.
  * By default adds the specified pattern name. Subclasses can override
  * to exclude patterns from import or deny import at all.
  *
  * @param moodleform $mform
  * @param string $patternname
  * @param string $header The default value of the name element
  * @return array
  */
 public function get_pattern_import_settings(&$mform, $patternname, $header)
 {
     $field = $this->_field;
     $fieldid = $field->id;
     $fieldname = $field->name;
     $patternpart = trim(str_replace($fieldname, '', $patternname), ':');
     $name = "f_{$fieldid}_{$patternpart}";
     $grp = array();
     $grp[] =& $mform->createElement('text', "{$name}_name", null, array('size' => '16'));
     $mform->setType("{$name}_name", PARAM_TEXT);
     $mform->setDefault("{$name}_name", $header);
     return array($grp, array());
 }
開發者ID:parksandwildlife,項目名稱:learning,代碼行數:25,代碼來源:dataformfieldrenderer.php


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