2 require_once("HTML/QuickForm/submit.php");
5 * HTML class for a submit type element
7 * @author Adam Daniel <adaniel1@eesus.jnj.com>
8 * @author Bertrand Mansion <bmansion@mamasam.com>
13 class MoodleQuickForm_submit
extends HTML_QuickForm_submit
{
14 function MoodleQuickForm_submit($elementName=null, $value=null, $attributes=null) {
15 parent
::HTML_QuickForm_submit($elementName, $value, $attributes);
18 * Called by HTML_QuickForm whenever form event is made on this element
20 * @param string $event Name of event
21 * @param mixed $arg event arguments
22 * @param object $caller calling object
27 function onQuickFormEvent($event, $arg, &$caller)
31 parent
::onQuickFormEvent($event, $arg, $caller);
32 if ($caller->isNoSubmitButton($arg[0])){
33 //need this to bypass client validation
34 //for buttons that submit but do not process the
36 $onClick = $this->getAttribute('onclick');
37 $skip = 'skipClientValidation = true;';
38 $onClick = ($onClick !== null)?
$skip.' '.$onClick:$skip;
39 $this->updateAttributes(array('onclick'=>$onClick));
44 return parent
::onQuickFormEvent($event, $arg, $caller);
46 } // end func onQuickFormEvent
48 * Slightly different container template when frozen. Don't want to display a submit
49 * button if the form is frozen.
53 function getElementTemplateType(){
54 if ($this->_flagFrozen
){
62 $this->_flagFrozen
= true;