From 6a853f7521c43d002b8ee0ae62df8ccd3d55a623 Mon Sep 17 00:00:00 2001 From: Rex Lorenzo Date: Fri, 8 Apr 2016 15:20:26 -0700 Subject: [PATCH] MDL-53765 mod_resource/mod_wiki: Removed update_module_button() --- lib/deprecatedlib.php | 27 --------------------------- mod/resource/locallib.php | 1 - mod/wiki/pagelib.php | 8 -------- 3 files changed, 36 deletions(-) diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index fcc6cfba0be..65065cf9bc8 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -1111,33 +1111,6 @@ function print_checkbox($name, $value, $checked = true, $label = '', $alt = '', throw new coding_exception('print_checkbox() can not be used any more. Please use html_writer::checkbox() instead.'); } -/** - * Prints the 'update this xxx' button that appears on module pages. - * - * @deprecated since Moodle 2.0 - * - * @param string $cmid the course_module id. - * @param string $ignored not used any more. (Used to be courseid.) - * @param string $string the module name - get_string('modulename', 'xxx') - * @return string the HTML for the button, if this user has permission to edit it, else an empty string. - */ -function update_module_button($cmid, $ignored, $string) { - global $CFG, $OUTPUT; - - // debugging('update_module_button() has been deprecated. Please change your code to use $OUTPUT->update_module_button().'); - - //NOTE: DO NOT call new output method because it needs the module name we do not have here! - - if (has_capability('moodle/course:manageactivities', context_module::instance($cmid))) { - $string = get_string('updatethis', '', $string); - - $url = new moodle_url("$CFG->wwwroot/course/mod.php", array('update' => $cmid, 'return' => true, 'sesskey' => sesskey())); - return $OUTPUT->single_button($url, $string); - } else { - return ''; - } -} - /** * @deprecated use $OUTPUT->navbar() instead */ diff --git a/mod/resource/locallib.php b/mod/resource/locallib.php index 09eec96885a..83d731a3f6f 100644 --- a/mod/resource/locallib.php +++ b/mod/resource/locallib.php @@ -253,7 +253,6 @@ function resource_print_header($resource, $cm, $course) { $PAGE->set_title($course->shortname.': '.$resource->name); $PAGE->set_heading($course->fullname); $PAGE->set_activity_record($resource); - $PAGE->set_button(update_module_button($cm->id, '', get_string('modulename', 'resource'))); echo $OUTPUT->header(); } diff --git a/mod/wiki/pagelib.php b/mod/wiki/pagelib.php index 76c597315e6..660f92e0baf 100644 --- a/mod/wiki/pagelib.php +++ b/mod/wiki/pagelib.php @@ -978,14 +978,6 @@ class page_wiki_preview extends page_wiki_edit { private $newcontent; - function __construct($wiki, $subwiki, $cm) { - global $PAGE, $CFG, $OUTPUT; - parent::__construct($wiki, $subwiki, $cm); - $buttons = $OUTPUT->update_module_button($cm->id, 'wiki'); - $PAGE->set_button($buttons); - - } - function print_header() { global $PAGE, $CFG; -- 2.43.0