Automatic installer.php lang files by installer_builder (20070726)
[moodle-linuxchix.git] / lib / form / modgroupmode.php
blob6651e0f618536963c4df282569de0554a7edf7d2
1 <?php
2 global $CFG;
3 require_once "$CFG->libdir/form/select.php";
5 /**
6 * HTML class for a drop down element to select groupmode in an activity mod update form
8 * @author Jamie Pratt
9 * @access public
11 class MoodleQuickForm_modgroupmode extends MoodleQuickForm_select{
12 /**
13 * Class constructor
15 * @param string Select name attribute
16 * @param mixed Label(s) for the select
17 * @param mixed Either a typical HTML attribute string or an associative array
18 * @param mixed $options ignored
19 * @access public
20 * @return void
22 function MoodleQuickForm_modgroupmode($elementName=null, $elementLabel=null, $attributes=null, $options=null)
24 HTML_QuickForm_element::HTML_QuickForm_element($elementName, $elementLabel, $attributes, null);
25 $this->_type = 'modgroupmode';
28 } //end constructor
30 /**
31 * Called by HTML_QuickForm whenever form event is made on this element
33 * @param string $event Name of event
34 * @param mixed $arg event arguments
35 * @param object $caller calling object
36 * @since 1.0
37 * @access public
38 * @return mixed
40 function onQuickFormEvent($event, $arg, &$caller)
42 switch ($event) {
43 case 'createElement':
44 $choices = array();
46 $choices[NOGROUPS] = get_string('groupsnone');
47 $choices[SEPARATEGROUPS] = get_string('groupsseparate');
48 $choices[VISIBLEGROUPS] = get_string('groupsvisible');
50 $this->setHelpButton(array('groupmode', get_string('groupmode')));
51 $this->load($choices);
52 break;
54 return parent::onQuickFormEvent($event, $arg, $caller);