]> git.mjollnir.org Git - moodle.git/commitdiff
added cancel button to glossary comment form and fixed initialization of button array...
authorskodak <skodak>
Tue, 5 Dec 2006 09:44:11 +0000 (09:44 +0000)
committerskodak <skodak>
Tue, 5 Dec 2006 09:44:11 +0000 (09:44 +0000)
login/change_password_form.php
login/forgot_password_form.php
login/signup_form.php
mod/assignment/type/online/assignment.class.php
mod/assignment/type/upload/assignment.class.php
mod/glossary/comment.php
mod/glossary/comment_form.php

index 0f9d6b3f0790a1db5cbb523bae1fecc1164e4cc1..a6f9b946620f0a132b127c0de8dd3a66542ad646 100644 (file)
@@ -47,6 +47,7 @@ class change_password_form extends moodleform {
 
         // buttons
         if (empty($USER->preference['auth_forcepasswordchange'])) {
+            $buttonarray = array();
             $buttonarray[] = &$mform->createElement('submit', 'submitbutton', get_string('savechanges'));
             $buttonarray[] = &$mform->createElement('cancel');
             $mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
index 31038629cc2e56b296303e10d4ec763f1e9394dc..bc64b74d57fb8c50d1a9d0870f0c179ecc9e7b14 100644 (file)
@@ -21,6 +21,7 @@ class forgot_password_form extends moodleform {
         $mform->setType('action', PARAM_ALPHA);
 
         // buttons
+        $buttonarray = array();
         $buttonarray[] = &$mform->createElement('submit', 'submitbutton', get_string('ok'));
         $buttonarray[] = &$mform->createElement('cancel');
         $mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
index 6e76e1bff82468633b554204a20217af894bcd55..f1a6737c6054cee374cc89ca0b9804a44a75df1c 100644 (file)
@@ -50,6 +50,7 @@ class login_signup_form extends moodleform {
         $mform->setDefault('country', '');
 
         // buttons
+        $buttonarray = array();
         $buttonarray[] = &$mform->createElement('submit', 'submitbutton', get_string('createaccount'));
         $buttonarray[] = &$mform->createElement('cancel');
         $mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
index 00b4243bdbe24ec4d5d7d09d284b32bf1b8c13e9..1b7f2fda9663c349cf56c5f2ba92dec8861596a4 100644 (file)
@@ -256,6 +256,7 @@ class assignment_online_edit_form extends moodleform {
         $mform->setType('id', PARAM_INT);
 
         // buttons
+        $buttonarray = array();
         $buttonarray[] =& $mform->createElement('submit', 'submitbutton', get_string('savechanges'));
         $buttonarray[] =& $mform->createElement('reset', 'reset', get_string('revert'));
         $buttonarray[] =& $mform->createElement('cancel');
index 1a3a75e74e99197997372623478fbd441c15d9e4..dce890508bdff891ec247650026d1196ef6c588b 100644 (file)
@@ -929,6 +929,7 @@ class assignment_upload_notes_form extends moodleform {
         $mform->setType('id', PARAM_ALPHA);
 
         // buttons
+        $buttonarray = array();
         $buttonarray[] =& $mform->createElement('submit', 'submitbutton', get_string('savechanges'));
         $buttonarray[] =& $mform->createElement('reset', 'reset', get_string('revert'));
         $buttonarray[] =& $mform->createElement('cancel');
index e4441de06a54a0e09aa0f975edfc520416fdc3af..3fd7039b028b81269002563e4d43dbfad20c42e9 100644 (file)
@@ -54,6 +54,10 @@ function glossary_comment_add() {
     $mform = new glossary_comment_form('comment.php');
     $mform->set_defaults(array('eid'=>$eid, 'action'=>'add'));
 
+    if ($mform->is_cancelled()) {
+        redirect("comments.php?id=$cm->id&amp;eid=$entry->id");
+    }
+
     if ($data = $mform->data_submitted()) {
         trusttext_after_edit($data->entrycomment, $context);
 
index 0d26b7f6cb4ac6ddbc733f918d021772da1b5cb1..dec379e3eff1173339b74761eaa21c921cef08f3 100644 (file)
@@ -25,9 +25,11 @@ class glossary_comment_form extends moodleform {
         $mform->setType('action', PARAM_ACTION);
 
         // buttons
-        $buttonarray=array();
-        $buttonarray[] = &$mform->createElement('submit', 'submitbutton', get_string('savechanges'));
-        $buttonarray[] = &$mform->createElement('reset', 'resetbutton', get_string('revert'));
+        $buttonarray = array();
+        $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);
     }
 }