mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
added new 'cancel' element type and introduced new is_cancelled() MoodleQuickForm method.
also used new cancel button in all mod_forms as well as a 'Revert' button and reworked logic about where to go on cancel or after submission for modedit.php
This commit is contained in:
parent
9c0f063b2c
commit
19110c573d
@ -45,10 +45,11 @@
|
||||
if (!empty($add)){
|
||||
$modname=$add;
|
||||
if (file_exists("../mod/$modname/mod_form.php")) {
|
||||
$id = required_param('id',PARAM_INT);
|
||||
$section = required_param('section',PARAM_INT);
|
||||
$id = required_param('id', PARAM_INT);
|
||||
$section = required_param('section', PARAM_INT);
|
||||
$returntomod = optional_param('return', PARAM_BOOL);
|
||||
|
||||
redirect("modedit.php?add=$add&course=$id§ion=$section");
|
||||
redirect("modedit.php?add=$add&course=$id§ion=$section&return=$returntomod");
|
||||
}
|
||||
}elseif (!empty($update)){
|
||||
if (!$modname=get_field_sql("SELECT md.name
|
||||
@ -58,8 +59,9 @@
|
||||
md.id = cm.module")){
|
||||
error('Invalid course module id!');
|
||||
}
|
||||
$returntomod = optional_param('return', PARAM_BOOL);
|
||||
if (file_exists("../mod/$modname/mod_form.php")) {
|
||||
redirect("modedit.php?update=$update");
|
||||
redirect("modedit.php?update=$update&return=$returntomod");
|
||||
}
|
||||
}
|
||||
//not adding / editing a module that has new forms using formslib
|
||||
|
@ -9,22 +9,8 @@
|
||||
|
||||
$add = optional_param('add', '', PARAM_ALPHA);
|
||||
$update = optional_param('update', 0, PARAM_INT);
|
||||
|
||||
$cancel = optional_param('cancel', 0, PARAM_BOOL);
|
||||
if ($cancel) {
|
||||
if (!empty($SESSION->returnpage)) {
|
||||
$return = $SESSION->returnpage;
|
||||
unset($SESSION->returnpage);
|
||||
redirect($return);
|
||||
} else {
|
||||
$course = required_param('course', PARAM_INT);
|
||||
$section = optional_param('section', '', PARAM_INT);
|
||||
if (! $course = get_record("course", "id", $course)) {
|
||||
error("This course doesn't exist");
|
||||
}
|
||||
redirect("view.php?id=$course->id#section-$section");
|
||||
}
|
||||
}
|
||||
//return to course/view.php if false or mod/modname/view.php if true
|
||||
$return = optional_param('return', 0, PARAM_BOOL);
|
||||
|
||||
if (!empty($add)){
|
||||
$section = required_param('section', PARAM_INT);
|
||||
@ -54,6 +40,7 @@
|
||||
$form->instance = "";
|
||||
$form->coursemodule = "";
|
||||
$form->add=$add;
|
||||
$form->return=0;//must be false if this is an add, go back to course view
|
||||
if (!empty($type)) {
|
||||
$form->type = $type;
|
||||
}
|
||||
@ -102,7 +89,8 @@
|
||||
$form->module = $module->id;
|
||||
$form->modulename = $module->name;
|
||||
$form->instance = $cm->instance;
|
||||
$form->update=$update;
|
||||
$form->return = $return;
|
||||
$form->update = $update;
|
||||
|
||||
$sectionname = get_string("name$course->format");
|
||||
$fullmodulename = get_string("modulename", $module->name);
|
||||
@ -135,9 +123,16 @@
|
||||
}
|
||||
|
||||
$mformclassname=$module->name.'_mod_form';
|
||||
$mform=& new $mformclassname($form->instance, isset($cw->section)?$cw->section:$section, ((isset($cm))?$cm:null));
|
||||
$cousesection=isset($cw->section)?$cw->section:$section;
|
||||
$mform=& new $mformclassname($form->instance, $cousesection, ((isset($cm))?$cm:null));
|
||||
|
||||
if ($fromform=$mform->data_submitted()){
|
||||
if ($mform->is_cancelled()) {
|
||||
if ($return && isset($cm)){
|
||||
redirect("$CFG->wwwroot/mod/$module->name/view.php?id=$cm->id");
|
||||
} else {
|
||||
redirect("view.php?id=$course->id#section-".$cousesection);
|
||||
}
|
||||
} elseif ($fromform=$mform->data_submitted()){
|
||||
if (empty($fromform->coursemodule)) { //add
|
||||
if (! $course = get_record("course", "id", $fromform->course)) {
|
||||
error("This course doesn't exist");
|
||||
@ -175,12 +170,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
$return = $updateinstancefunction($fromform);
|
||||
if (!$return) {
|
||||
$returnfromfunc = $updateinstancefunction($fromform);
|
||||
if (!$returnfromfunc) {
|
||||
error("Could not update the $fromform->modulename", "view.php?id=$course->id");
|
||||
}
|
||||
if (is_string($return)) {
|
||||
error($return, "view.php?id=$course->id");
|
||||
if (is_string($returnfromfunc)) {
|
||||
error($returnfromfunc, "view.php?id=$course->id");
|
||||
}
|
||||
|
||||
if (isset($fromform->visible)) {
|
||||
@ -191,11 +186,6 @@
|
||||
set_coursemodule_groupmode($fromform->coursemodule, $fromform->groupmode);
|
||||
}
|
||||
|
||||
if (isset($fromform->redirect)) {
|
||||
$SESSION->returnpage = $fromform->redirecturl;
|
||||
} else {
|
||||
$SESSION->returnpage = "$CFG->wwwroot/mod/$fromform->modulename/view.php?id=$fromform->coursemodule";
|
||||
}
|
||||
|
||||
add_to_log($course->id, "course", "update mod",
|
||||
"../mod/$fromform->modulename/view.php?id=$fromform->coursemodule",
|
||||
@ -213,8 +203,8 @@
|
||||
$fromform->name = get_string("modulename", $fromform->modulename);
|
||||
}
|
||||
|
||||
$return = $addinstancefunction($fromform);
|
||||
if (!$return) {
|
||||
$returnfromfunc = $addinstancefunction($fromform);
|
||||
if (!$returnfromfunc) {
|
||||
/*if (file_exists($moderr)) {
|
||||
$form = $fromform;
|
||||
include_once($moderr);
|
||||
@ -222,15 +212,15 @@
|
||||
}*/
|
||||
error("Could not add a new instance of $fromform->modulename", "view.php?id=$course->id");
|
||||
}
|
||||
if (is_string($return)) {
|
||||
error($return, "view.php?id=$course->id");
|
||||
if (is_string($returnfromfunc)) {
|
||||
error($returnfromfunc, "view.php?id=$course->id");
|
||||
}
|
||||
|
||||
if (!isset($fromform->groupmode)) { // to deal with pre-1.5 modules
|
||||
$fromform->groupmode = $course->groupmode; /// Default groupmode the same as course
|
||||
}
|
||||
|
||||
$fromform->instance = $return;
|
||||
$fromform->instance = $returnfromfunc;
|
||||
|
||||
// course_modules and course_sections each contain a reference
|
||||
// to each other, so we have to update one of them twice.
|
||||
@ -252,12 +242,6 @@
|
||||
// make sure visibility is set correctly (in particular in calendar)
|
||||
set_coursemodule_visible($fromform->coursemodule, $fromform->visible);
|
||||
|
||||
if (isset($fromform->redirect)) {
|
||||
$SESSION->returnpage = $fromform->redirecturl;
|
||||
} else {
|
||||
$SESSION->returnpage = "$CFG->wwwroot/mod/$fromform->modulename/view.php?id=$fromform->coursemodule";
|
||||
}
|
||||
|
||||
add_to_log($course->id, "course", "add mod",
|
||||
"../mod/$fromform->modulename/view.php?id=$fromform->coursemodule",
|
||||
"$fromform->modulename $fromform->instance");
|
||||
@ -270,12 +254,10 @@
|
||||
|
||||
rebuild_course_cache($course->id);
|
||||
|
||||
if (!empty($SESSION->returnpage)) {
|
||||
$return = $SESSION->returnpage;
|
||||
unset($SESSION->returnpage);
|
||||
redirect($return);
|
||||
if ($return && isset($cm)){
|
||||
redirect("$CFG->wwwroot/mod/$module->name/view.php?id=$cm->id");
|
||||
} else {
|
||||
redirect("view.php?id=$course->id#section-$sectionreturn");
|
||||
redirect("view.php?id=$course->id#section-".$cousesection);
|
||||
}
|
||||
exit;
|
||||
|
||||
|
@ -99,6 +99,9 @@ class moodleform_mod extends moodleform {
|
||||
|
||||
$mform->addElement('hidden', 'update', 0);
|
||||
$mform->setType('update', PARAM_INT);
|
||||
|
||||
$mform->addElement('hidden', 'return', 0);
|
||||
$mform->setType('return', PARAM_BOOL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
47
lib/form/cancel.php
Normal file
47
lib/form/cancel.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
require_once('HTML/QuickForm/submit.php');
|
||||
|
||||
/**
|
||||
* HTML class for a submit type element
|
||||
*
|
||||
* @author Jamie Pratt
|
||||
* @access public
|
||||
*/
|
||||
class MoodleQuickForm_cancel extends HTML_QuickForm_submit
|
||||
{
|
||||
// {{{ constructor
|
||||
|
||||
/**
|
||||
* Class constructor
|
||||
*
|
||||
* @since 1.0
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function MoodleQuickForm_cancel($elementName=null, $value=null, $attributes=null)
|
||||
{
|
||||
if ($elementName==null){
|
||||
$elementName='cancel';
|
||||
}
|
||||
if ($value==null){
|
||||
$value=get_string('cancel');
|
||||
}
|
||||
HTML_QuickForm_submit::HTML_QuickForm_submit($elementName, $value, $attributes);
|
||||
$this->updateAttributes(array('onclick'=>'return this.form.submit();'));
|
||||
} //end constructor
|
||||
function onQuickFormEvent($event, $arg, &$caller)
|
||||
{
|
||||
switch ($event) {
|
||||
case 'createElement':
|
||||
$className = get_class($this);
|
||||
$this->$className($arg[0], $arg[1], $arg[2]);
|
||||
$caller->_registerCancelButton($this->getName());
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
return parent::onQuickFormEvent($event, $arg, $caller);
|
||||
} // end func onQuickFormEvent
|
||||
|
||||
// }}}
|
||||
} //end class HTML_QuickForm_submit
|
||||
?>
|
@ -1,35 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once('HTML/QuickForm/submit.php');
|
||||
|
||||
/**
|
||||
* HTML class for a submit type element
|
||||
*
|
||||
* @author Jamie Pratt
|
||||
* @access public
|
||||
*/
|
||||
class MoodleQuickForm_submit extends HTML_QuickForm_submit
|
||||
{
|
||||
// {{{ constructor
|
||||
|
||||
/**
|
||||
* Class constructor
|
||||
*
|
||||
* @param string Input field name attribute
|
||||
* @param string Input field value
|
||||
* @param mixed Either a typical HTML attribute string or an associative array
|
||||
* @since 1.0
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function MoodleQuickForm_submit($elementName=null, $value=null, $attributes=null)
|
||||
{
|
||||
HTML_QuickForm_submit::HTML_QuickForm_submit($elementName, $value, $attributes);
|
||||
if ('cancel'==$elementName){
|
||||
//bypass form validation js :
|
||||
$this->updateAttributes(array('onclick'=>'return this.form.submit();'));
|
||||
}
|
||||
} //end constructor
|
||||
|
||||
} //end class HTML_QuickForm_submit
|
||||
?>
|
@ -63,12 +63,7 @@ class moodleform {
|
||||
*/
|
||||
var $_upload_manager; //
|
||||
|
||||
/**
|
||||
* Array of buttons that if pressed do not result in the processing of the form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
var $_nosubmitbuttons=array();
|
||||
|
||||
|
||||
/**
|
||||
* The constructor function calls the abstract function definition() and it will then
|
||||
@ -291,6 +286,21 @@ class moodleform {
|
||||
return $validated;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if a cancel button has been pressed resulting in the form being submitted.
|
||||
*
|
||||
* @return boolean true if a cancel button has been pressed
|
||||
*/
|
||||
function is_cancelled(){
|
||||
$mform =& $this->_form;
|
||||
foreach ($mform->_cancelButtons as $cancelbutton){
|
||||
if (optional_param($cancelbutton, 0, PARAM_TEXT)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return submitted data if properly submitted or returns NULL if validation fails or
|
||||
* if there is no submitted data.
|
||||
@ -299,13 +309,14 @@ class moodleform {
|
||||
* @return object submitted data; NULL if not valid or not submitted
|
||||
*/
|
||||
function data_submitted($slashed=true) {
|
||||
foreach ($this->_nosubmitbuttons as $nosubmitbutton){
|
||||
$mform =& $this->_form;
|
||||
foreach ($mform->_noSubmitButtons as $nosubmitbutton){
|
||||
if (optional_param($nosubmitbutton, 0, PARAM_TEXT)){
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
if ($this->is_submitted() and $this->is_validated()) {
|
||||
$data = $this->_form->exportValues(null, $slashed);
|
||||
$data = $mform->exportValues(null, $slashed);
|
||||
unset($data['sesskey']); // we do not need to return sesskey
|
||||
unset($data['_qf__'.$this->_formname]); // we do not need the submission marker too
|
||||
if (empty($data)) {
|
||||
@ -371,9 +382,7 @@ class moodleform {
|
||||
return true;
|
||||
}
|
||||
|
||||
function _register_no_submit_button($addfieldsname){
|
||||
$this->_nosubmitbuttons[]=$addfieldsname;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method to add a repeating group of elements to a form.
|
||||
@ -400,8 +409,8 @@ class moodleform {
|
||||
if (!empty($addfields)){
|
||||
$repeats += $addfieldsno;
|
||||
}
|
||||
$this->_register_no_submit_button($addfieldsname);
|
||||
$mform =& $this->_form;
|
||||
$mform->_registerNoSubmitButton($addfieldsname);
|
||||
$mform->addElement('hidden', $repeathiddenname, $repeats);
|
||||
//value not to be overridden by submitted value
|
||||
$mform->setConstants(array($repeathiddenname=>$repeats));
|
||||
@ -466,7 +475,18 @@ class moodleform {
|
||||
class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless {
|
||||
var $_types = array();
|
||||
var $_dependencies = array();
|
||||
|
||||
/**
|
||||
* Array of buttons that if pressed do not result in the processing of the form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
var $_noSubmitButtons=array();
|
||||
/**
|
||||
* Array of buttons that if pressed do not result in the processing of the form.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
var $_cancelButtons=array();
|
||||
|
||||
/**
|
||||
* Class constructor - same parameters as HTML_QuickForm_DHTMLRulesTableless
|
||||
@ -870,6 +890,7 @@ function validate_' . $this->_attributes['id'] . '(frm) {
|
||||
* @param string $dependentOn the name of the element whose state will be checked for
|
||||
* condition
|
||||
* @param string $condition the condition to check
|
||||
* @param mixed $value used in conjunction with condition.
|
||||
*/
|
||||
function disabledIf($elementName, $dependentOn, $condition = 'notchecked', $value=null){
|
||||
$dependents = $this->_getElNamesRecursive($elementName);
|
||||
@ -880,6 +901,12 @@ function validate_' . $this->_attributes['id'] . '(frm) {
|
||||
}
|
||||
}
|
||||
}
|
||||
function _registerNoSubmitButton($addfieldsname){
|
||||
$this->_noSubmitButtons[]=$addfieldsname;
|
||||
}
|
||||
function _registerCancelButton($addfieldsname){
|
||||
$this->_cancelButtons[]=$addfieldsname;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1034,7 +1061,7 @@ MoodleQuickForm::registerElementType('modvisible', "$CFG->libdir/form/modvisible
|
||||
MoodleQuickForm::registerElementType('modgroupmode', "$CFG->libdir/form/modgroupmode.php", 'MoodleQuickForm_modgroupmode');
|
||||
MoodleQuickForm::registerElementType('selectyesno', "$CFG->libdir/form/selectyesno.php", 'MoodleQuickForm_selectyesno');
|
||||
MoodleQuickForm::registerElementType('modgrade', "$CFG->libdir/form/modgrade.php", 'MoodleQuickForm_modgrade');
|
||||
MoodleQuickForm::registerElementType('submit', "$CFG->libdir/form/submit.php", 'MoodleQuickForm_submit');
|
||||
MoodleQuickForm::registerElementType('cancel', "$CFG->libdir/form/cancel.php", 'MoodleQuickForm_cancel');
|
||||
MoodleQuickForm::registerElementType('button', "$CFG->libdir/form/button.php", 'MoodleQuickForm_button');
|
||||
MoodleQuickForm::registerElementType('choosecoursefile', "$CFG->libdir/form/choosecoursefile.php", 'MoodleQuickForm_choosecoursefile');
|
||||
|
||||
|
@ -94,14 +94,27 @@ function lockoptionsall(formid) {
|
||||
function lockoptionsallsetup(formid) {
|
||||
var items=eval(formid+'items');
|
||||
var form=document.forms[formid];
|
||||
for (var i = 0; i < form.elements.length; i++){
|
||||
var found=false;
|
||||
var formelement = form.elements[i];
|
||||
if (formelement.type=='reset'){
|
||||
formelement.onclick = function(){this.form.reset();return lockoptionsall(this.form.getAttribute('id'));};
|
||||
formelement.onblur = function(){this.form.reset();return lockoptionsall(this.form.getAttribute('id'));};
|
||||
formelement.onchange = function(){this.form.reset();return lockoptionsall(this.form.getAttribute('id'));};
|
||||
} else {
|
||||
for (var master in items){
|
||||
form.elements[master].oldonclick = ((form.elements[master].onclick) ? form.elements[master].onclick : function () {});
|
||||
form.elements[master].oldonblur = ((form.elements[master].onblur) ? form.elements[master].onblur : function () {});
|
||||
form.elements[master].oldonchange = ((form.elements[master].onchange) ? form.elements[master].onchange : function () {});
|
||||
form.elements[master].onclick = function(){this.oldonclick(); return lockoptionsall(this.form.getAttribute('id'));};
|
||||
form.elements[master].onblur = function(){this.oldonblur(); return lockoptionsall(this.form.getAttribute('id'));};
|
||||
form.elements[master].onchange = function(){this.oldonchange(); return lockoptionsall(this.form.getAttribute('id'));};
|
||||
if (master==formelement.name){
|
||||
formelement.onclick = function(){return lockoptionsall(this.form.getAttribute('id'));};
|
||||
formelement.onblur = function(){return lockoptionsall(this.form.getAttribute('id'));};
|
||||
formelement.onchange = function(){return lockoptionsall(this.form.getAttribute('id'));};
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (found){
|
||||
}
|
||||
}
|
||||
|
||||
return lockoptionsall(formid);
|
||||
}
|
||||
|
||||
|
@ -45,16 +45,14 @@ class chat_mod_form extends moodleform_mod {
|
||||
$options[2] = get_string('numdays', '', 2);
|
||||
$mform->addElement('select', 'keepdays', get_string('savemessages', 'chat'), $options);
|
||||
|
||||
$options=array();
|
||||
$options[0] = get_string('no');
|
||||
$options[1] = get_string('yes');
|
||||
$mform->addElement('select', 'studentlogs', get_string('studentseereports', 'chat'), $options);
|
||||
$mform->addElement('selectyesno', 'studentlogs', get_string('studentseereports', 'chat'));
|
||||
|
||||
$this->standard_coursemodule_elements();
|
||||
|
||||
$buttonarray=array();
|
||||
$buttonarray[] = &MoodleQuickForm::createElement('submit', 'submitbutton', get_string('savechanges'));
|
||||
$buttonarray[] = &MoodleQuickForm::createElement('submit', 'cancel', get_string('cancel'));
|
||||
$buttonarray[] = &$mform->createElement('submit', 'submitbutton', get_string('savechanges'));
|
||||
$buttonarray[] = &$mform->createElement('reset', 'reset', get_string('revert'));
|
||||
$buttonarray[] = &$mform->createElement('cancel');
|
||||
$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
|
||||
$renderer->addStopFieldsetElements('buttonar');
|
||||
}
|
||||
|
@ -84,8 +84,9 @@ class choice_mod_form extends moodleform_mod {
|
||||
//-------------------------------------------------------------------------------
|
||||
|
||||
$buttonarray=array();
|
||||
$buttonarray[] = &MoodleQuickForm::createElement('submit', 'submitbutton', get_string('savechanges'));
|
||||
$buttonarray[] = &MoodleQuickForm::createElement('submit', 'cancel', get_string('cancel'));
|
||||
$buttonarray[] = &$mform->createElement('submit', 'submitbutton', get_string('savechanges'));
|
||||
$buttonarray[] = &$mform->createElement('reset', 'resetbutton', get_string('revert'));
|
||||
$buttonarray[] = &$mform->createElement('cancel');
|
||||
$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
|
||||
$renderer->addStopFieldsetElements('buttonar');
|
||||
}
|
||||
|
@ -75,8 +75,9 @@ class data_mod_form extends moodleform_mod {
|
||||
$this->standard_coursemodule_elements();
|
||||
|
||||
$buttonarray=array();
|
||||
$buttonarray[] = &MoodleQuickForm::createElement('submit', 'submitbutton', get_string('savechanges'));
|
||||
$buttonarray[] = &MoodleQuickForm::createElement('submit', 'cancel', get_string('cancel'));
|
||||
$buttonarray[] = &$mform->createElement('submit', 'submitbutton', get_string('savechanges'));
|
||||
$buttonarray[] = &$mform->createElement('reset', 'resetbutton', get_string('revert'));
|
||||
$buttonarray[] = &$mform->createElement('cancel');
|
||||
$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
|
||||
$renderer->addStopFieldsetElements('buttonar');
|
||||
}
|
||||
|
@ -103,8 +103,9 @@ class exercise_mod_form extends moodleform_mod {
|
||||
//-------------------------------------------------------------------------------
|
||||
|
||||
$buttonarray=array();
|
||||
$buttonarray[] = &MoodleQuickForm::createElement('submit', 'submitbutton', get_string('savechanges'));
|
||||
$buttonarray[] = &MoodleQuickForm::createElement('submit', 'cancel', get_string('cancel'));
|
||||
$buttonarray[] = &$mform->createElement('submit', 'submitbutton', get_string('savechanges'));
|
||||
$buttonarray[] = &$mform->createElement('reset', 'resetbutton', get_string('revert'));
|
||||
$buttonarray[] = &$mform->createElement('cancel');
|
||||
$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
|
||||
$renderer->addStopFieldsetElements('buttonar');
|
||||
}
|
||||
|
@ -127,8 +127,9 @@ class forum_mod_form extends moodleform_mod {
|
||||
$this->standard_coursemodule_elements();
|
||||
|
||||
$buttonarray=array();
|
||||
$buttonarray[] = &MoodleQuickForm::createElement('submit', 'submitbutton', get_string('savechanges'));
|
||||
$buttonarray[] = &MoodleQuickForm::createElement('submit', 'cancel', get_string('cancel'));
|
||||
$buttonarray[] = &$mform->createElement('submit', 'submitbutton', get_string('savechanges'));
|
||||
$buttonarray[] = &$mform->createElement('reset', 'resetbutton', get_string('revert'));
|
||||
$buttonarray[] = &$mform->createElement('cancel');
|
||||
$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
|
||||
$renderer->addStopFieldsetElements('buttonar');
|
||||
}
|
||||
|
@ -25,8 +25,9 @@ class glossary_comment_form extends moodleform {
|
||||
$mform->setType('action', PARAM_ACTION);
|
||||
|
||||
// buttons
|
||||
$buttonarray[] = &MoodleQuickForm::createElement('submit', 'submitbutton', get_string('savechanges'));
|
||||
$buttonarray[] = &MoodleQuickForm::createElement('reset', 'reset', get_string('revert'));
|
||||
$buttonarray=array();
|
||||
$buttonarray[] = &$mform->createElement('submit', 'submitbutton', get_string('savechanges'));
|
||||
$buttonarray[] = &$mform->createElement('reset', 'resetbutton', get_string('revert'));
|
||||
$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
|
||||
}
|
||||
}
|
||||
|
@ -147,8 +147,9 @@ class glossary_mod_form extends moodleform_mod {
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
$buttonarray=array();
|
||||
$buttonarray[] = &MoodleQuickForm::createElement('submit', 'submitbutton', get_string('savechanges'));
|
||||
$buttonarray[] = &MoodleQuickForm::createElement('submit', 'cancel', get_string('cancel'));
|
||||
$buttonarray[] = &$mform->createElement('submit', 'submitbutton', get_string('savechanges'));
|
||||
$buttonarray[] = &$mform->createElement('reset', 'resetbutton', get_string('revert'));
|
||||
$buttonarray[] = &$mform->createElement('cancel');
|
||||
$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
|
||||
$renderer->addStopFieldsetElements('buttonar');
|
||||
}
|
||||
|
@ -47,8 +47,9 @@ class journal_mod_form extends moodleform_mod {
|
||||
//-------------------------------------------------------------------------------
|
||||
|
||||
$buttonarray=array();
|
||||
$buttonarray[] = &MoodleQuickForm::createElement('submit', 'submitbutton', get_string('savechanges'));
|
||||
$buttonarray[] = &MoodleQuickForm::createElement('submit', 'cancel', get_string('cancel'));
|
||||
$buttonarray[] = &$mform->createElement('submit', 'submitbutton', get_string('savechanges'));
|
||||
$buttonarray[] = &$mform->createElement('reset', 'resetbutton', get_string('revert'));
|
||||
$buttonarray[] = &$mform->createElement('cancel');
|
||||
$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
|
||||
$renderer->addStopFieldsetElements('buttonar');
|
||||
}
|
||||
|
@ -17,8 +17,9 @@ class label_mod_form extends moodleform_mod {
|
||||
$mform->addElement('modvisible', 'visible', get_string('visible'));
|
||||
|
||||
$buttonarray=array();
|
||||
$buttonarray[] = &MoodleQuickForm::createElement('submit', 'submitbutton', get_string('savechanges'));
|
||||
$buttonarray[] = &MoodleQuickForm::createElement('submit', 'cancel', get_string('cancel'));
|
||||
$buttonarray[] = &$mform->createElement('submit', 'submitbutton', get_string('savechanges'));
|
||||
$buttonarray[] = &$mform->createElement('reset', 'resetbutton', get_string('revert'));
|
||||
$buttonarray[] = &$mform->createElement('cancel');
|
||||
$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
|
||||
$renderer->addStopFieldsetElements('buttonar');
|
||||
}
|
||||
|
@ -276,8 +276,9 @@ class lesson_mod_form extends moodleform_mod {
|
||||
//-------------------------------------------------------------------------------
|
||||
|
||||
$buttonarray=array();
|
||||
$buttonarray[] = &MoodleQuickForm::createElement('submit', 'submitbutton', get_string('savechanges'));
|
||||
$buttonarray[] = &MoodleQuickForm::createElement('submit', 'cancel', get_string('cancel'));
|
||||
$buttonarray[] = &$mform->createElement('submit', 'submitbutton', get_string('savechanges'));
|
||||
$buttonarray[] = &$mform->createElement('reset', 'resetbutton', get_string('revert'));
|
||||
$buttonarray[] = &$mform->createElement('cancel');
|
||||
$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
|
||||
$renderer->addStopFieldsetElements('buttonar');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user