backup MDL-22151 Added a backup link to the settings block for modules that support backup.

This commit is contained in:
Sam Hemelryk 2010-05-04 04:00:03 +00:00
parent f45dfeeb76
commit 59c7680fe2

View File

@ -2551,6 +2551,13 @@ class settings_navigation extends navigation_node {
$modulenode->add(get_string('filters', 'admin'), $url, self::TYPE_SETTING);
}
// Add a backup link
$featuresfunc = $this->page->activityname.'_supports';
if ($featuresfunc(FEATURE_BACKUP_MOODLE2) && has_capability('moodle/backup:backupactivity', $this->page->cm->context)) {
$url = new moodle_url('/backup/backup.php', array('id'=>$this->page->cm->course, 'cm'=>$this->page->cm->id));
$modulenode->add(get_string('backup'), $url, self::TYPE_SETTING);
}
$file = $CFG->dirroot.'/mod/'.$this->page->activityname.'/lib.php';
$function = $this->page->activityname.'_extend_settings_navigation';