|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 global $CFG; 00003 require_once "$CFG->libdir/form/select.php"; 00004 00011 class MoodleQuickForm_modvisible extends MoodleQuickForm_select{ 00012 00023 function MoodleQuickForm_modvisible($elementName=null, $elementLabel=null, $attributes=null, $options=null) 00024 { 00025 HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes, null); 00026 $this->_type = 'modvisible'; 00027 00028 00029 } //end constructor 00030 00040 function onQuickFormEvent($event, $arg, &$caller) 00041 { 00042 switch ($event) { 00043 case 'createElement': 00044 $choices=array(); 00045 $choices[1] = get_string('show'); 00046 $choices[0] = get_string('hide'); 00047 $this->load($choices); 00048 break; 00049 00050 } 00051 return parent::onQuickFormEvent($event, $arg, $caller); 00052 } 00053 }