2 if (!defined('MOODLE_INTERNAL')) {
3 die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
7 require_once($CFG->libdir
.'/form/submit.php');
10 * HTML class for a submit type element
15 class MoodleQuickForm_cancel
extends MoodleQuickForm_submit
26 function MoodleQuickForm_cancel($elementName=null, $value=null, $attributes=null)
28 if ($elementName==null){
29 $elementName='cancel';
32 $value=get_string('cancel');
34 MoodleQuickForm_submit
::MoodleQuickForm_submit($elementName, $value, $attributes);
35 $this->updateAttributes(array('onclick'=>'skipClientValidation = true; return true;'));
37 function onQuickFormEvent($event, $arg, &$caller)
41 $className = get_class($this);
42 $this->$className($arg[0], $arg[1], $arg[2]);
43 $caller->_registerCancelButton($this->getName());
47 return parent
::onQuickFormEvent($event, $arg, $caller);
48 } // end func onQuickFormEvent
50 function getFrozenHtml(){
51 return HTML_QuickForm_submit
::getFrozenHtml();
55 return HTML_QuickForm_submit
::freeze();
58 } //end class MoodleQuickForm_cancel