]> git.mjollnir.org Git - moodle.git/commitdiff
Fixes the displayed text and makes the new API lighter
authormudrd8mz <mudrd8mz>
Wed, 5 Aug 2009 11:50:17 +0000 (11:50 +0000)
committermudrd8mz <mudrd8mz>
Wed, 5 Aug 2009 11:50:17 +0000 (11:50 +0000)
lib/outputlib.php

index e63004087e4603eebe60eb24bb505d8c1e71c2a0..91deec5fbfdbaf767d36f87605315671c5c69c0a 100644 (file)
@@ -2806,20 +2806,21 @@ class moodle_core_renderer extends moodle_renderer_base {
     }
 
     /**
-     * Prints the 'update this xxx' button that appears on module pages.
+     * Prints the 'Update this Modulename' button that appears on module pages.
      *
      * @param string $cmid the course_module id.
-     * @param string $modulename the module name - get_string('modulename', 'xxx')
+     * @param string $modulename the module name, eg. "forum", "quiz" or "workshop"
      * @return string the HTML for the button, if this user has permission to edit it, else an empty string.
      */
     public function update_module_button($cmid, $modulename) {
         global $CFG;
         if (has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_MODULE, $cmid))) {
+            $modulename = get_string('modulename', $modulename);
             $string = get_string('updatethis', '', $modulename);
 
             $form = new html_form();
             $form->url = new moodle_url("$CFG->wwwroot/course/mod.php", array('update' => $cmid, 'return' => true, 'sesskey' => sesskey()));
-            $form->button->text = $modulename;
+            $form->button->text = $string;
             return $this->button($form);
         } else {
             return '';