mirror of
https://github.com/moodle/moodle.git
synced 2025-01-30 03:58:34 +01:00
MDL-53765 mod_resource/mod_wiki: Removed update_module_button()
This commit is contained in:
parent
7752762674
commit
6a853f7521
@ -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
|
||||
*/
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user