From: moodler Date: Wed, 16 Oct 2002 04:53:44 +0000 (+0000) Subject: Changes related to module editing buttons X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=7ce20f09cb96b3e3834f991ff3f4ca364d9dde92;p=moodle.git Changes related to module editing buttons --- diff --git a/course/mod.php b/course/mod.php index 1e7f8b6ac3..9653003ae5 100644 --- a/course/mod.php +++ b/course/mod.php @@ -5,6 +5,18 @@ require("../config.php"); require("lib.php"); + if (isset($cancel)) { + if ($SESSION->returnpage) { + $return = $SESSION->returnpage; + unset($SESSION->returnpage); + save_session("SESSION"); + redirect($return); + } else { + redirect("view.php?id=$mod->course"); + } + } + + if (isset($course) && isset($HTTP_POST_VARS)) { // add or update form submitted if (isset($SESSION->modform)) { // Variables are stored in the session @@ -85,10 +97,6 @@ exit; } - if (isset($return)) { - $SESSION->returnpage = $HTTP_REFERER; - save_session("SESSION"); - } if (isset($move)) { @@ -168,6 +176,11 @@ error("This course section doesn't exist"); } + if (isset($return)) { + $SESSION->returnpage = "$CFG->wwwroot/mod/$module->name/view.php?id=$cm->id"; + save_session("SESSION"); + } + $form->coursemodule = $cm->id; $form->section = $cm->section; // The section ID $form->course = $course->id; diff --git a/lang/en/moodle.php b/lang/en/moodle.php index 8d445678f6..efa33d0833 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -454,6 +454,7 @@ $string['updatesevery'] = "Updates every \$a seconds"; $string['updatethiscourse'] = "Update this course"; $string['updatinga'] = "Updating a \$a"; $string['updatingain'] = "Updating a \$a->what in \$a->in"; +$string['updatethis'] = "Update this \$a"; $string['upload'] = "Upload"; $string['uploadafile'] = "Upload a file"; $string['uploadthisfile'] = "Upload this file"; diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 8ab9db854d..888173ae37 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -357,22 +357,23 @@ function update_course_icon($courseid) { $string = get_string("turneditingon"); $edit = "on"; } - return "
wwwroot/course/view.php\"> - - -
"; + return "
wwwroot/course/view.php\">". + "". + "". + "
"; } } -function update_module_icon($moduleid, $courseid) { -// Used to be an icon, but it's now a simple form button +function update_module_button($moduleid, $courseid, $string) { +// Prints the editing button on a module "view" page global $CFG; if (isteacher($courseid)) { - return "
wwwroot/course/mod.php\"> - - -
"; + $string = get_string("updatethis", "", $string); + return "
wwwroot/course/mod.php\">". + "". + "". + "
"; } } @@ -2013,7 +2014,10 @@ function check_browser_version($brand="MSIE", $version=5.5) { function can_use_richtext_editor() { global $USER, $CFG; - return (check_browser_version("MSIE", 5.5) and $USER->htmleditor and $CFG->htmleditor); + if ($USER->htmleditor and $CFG->htmleditor) { + return check_browser_version("MSIE", 5.5); + } + return false; }