Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/lib/form/cancel.php
Go to the documentation of this file.
00001 <?php
00002 if (!defined('MOODLE_INTERNAL')) {
00003     die('Direct access to this script is forbidden.');    
00004 }
00005 
00006 global $CFG;
00007 require_once($CFG->libdir.'/form/submit.php');
00008 
00015 class MoodleQuickForm_cancel extends MoodleQuickForm_submit
00016 {
00017     // {{{ constructor
00018 
00026     function MoodleQuickForm_cancel($elementName=null, $value=null, $attributes=null)
00027     {
00028         if ($elementName==null){
00029             $elementName='cancel';
00030         }
00031         if ($value==null){
00032             $value=get_string('cancel');
00033         }
00034         MoodleQuickForm_submit::MoodleQuickForm_submit($elementName, $value, $attributes);
00035         $this->updateAttributes(array('onclick'=>'skipClientValidation = true; return true;'));
00036     } //end constructor
00037     function onQuickFormEvent($event, $arg, &$caller)
00038     {
00039         switch ($event) {
00040             case 'createElement':
00041                 $className = get_class($this);
00042                 $this->$className($arg[0], $arg[1], $arg[2]);
00043                 $caller->_registerCancelButton($this->getName());
00044                 return true;
00045                 break;
00046         }
00047         return parent::onQuickFormEvent($event, $arg, $caller);
00048     } // end func onQuickFormEvent
00049 
00050     function getFrozenHtml(){
00051         return HTML_QuickForm_submit::getFrozenHtml();
00052     }
00053 
00054     function freeze(){
00055         return HTML_QuickForm_submit::freeze();
00056     }
00057     // }}}
00058 } //end class MoodleQuickForm_cancel
 All Data Structures Namespaces Files Functions Variables Enumerations