Automatic installer.php lang files by installer_builder (20070726)
[moodle-linuxchix.git] / lib / form / cancel.php
blob1ef1128b05f5272da4d0148313c458700045da33
1 <?php
2 require_once('HTML/QuickForm/submit.php');
4 /**
5 * HTML class for a submit type element
7 * @author Jamie Pratt
8 * @access public
9 */
10 class MoodleQuickForm_cancel extends MoodleQuickForm_submit
12 // {{{ constructor
14 /**
15 * Class constructor
17 * @since 1.0
18 * @access public
19 * @return void
21 function MoodleQuickForm_cancel($elementName=null, $value=null, $attributes=null)
23 if ($elementName==null){
24 $elementName='cancel';
26 if ($value==null){
27 $value=get_string('cancel');
29 MoodleQuickForm_submit::MoodleQuickForm_submit($elementName, $value, $attributes);
30 $this->updateAttributes(array('onclick'=>'skipClientValidation = true; return true;'));
31 } //end constructor
32 function onQuickFormEvent($event, $arg, &$caller)
34 switch ($event) {
35 case 'createElement':
36 $className = get_class($this);
37 $this->$className($arg[0], $arg[1], $arg[2]);
38 $caller->_registerCancelButton($this->getName());
39 return true;
40 break;
42 return parent::onQuickFormEvent($event, $arg, $caller);
43 } // end func onQuickFormEvent
45 function getFrozenHtml(){
46 return HTML_QuickForm_submit::getFrozenHtml();
49 function freeze(){
50 return HTML_QuickForm_submit::freeze();
52 // }}}
53 } //end class MoodleQuickForm_cancel