mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 08:22:07 +02:00
MDL-59545 navigation: Missing editing icons on activity pages
This commit is contained in:
parent
b5f51883f0
commit
8af8eeef69
@ -4814,22 +4814,25 @@ class settings_navigation extends navigation_node {
|
||||
// Settings for the module
|
||||
if (has_capability('moodle/course:manageactivities', $this->page->cm->context)) {
|
||||
$url = new moodle_url('/course/modedit.php', array('update' => $this->page->cm->id, 'return' => 1));
|
||||
$modulenode->add(get_string('settings'), $url, navigation_node::TYPE_SETTING, null, 'modedit');
|
||||
$modulenode->add(get_string('settings'), $url, self::TYPE_SETTING, null, 'modedit', new pix_icon('i/settings', ''));
|
||||
}
|
||||
// Assign local roles
|
||||
if (count(get_assignable_roles($this->page->cm->context))>0) {
|
||||
$url = new moodle_url('/'.$CFG->admin.'/roles/assign.php', array('contextid'=>$this->page->cm->context->id));
|
||||
$modulenode->add(get_string('localroles', 'role'), $url, self::TYPE_SETTING, null, 'roleassign');
|
||||
$modulenode->add(get_string('localroles', 'role'), $url, self::TYPE_SETTING, null, 'roleassign',
|
||||
new pix_icon('i/role', ''));
|
||||
}
|
||||
// Override roles
|
||||
if (has_capability('moodle/role:review', $this->page->cm->context) or count(get_overridable_roles($this->page->cm->context))>0) {
|
||||
$url = new moodle_url('/'.$CFG->admin.'/roles/permissions.php', array('contextid'=>$this->page->cm->context->id));
|
||||
$modulenode->add(get_string('permissions', 'role'), $url, self::TYPE_SETTING, null, 'roleoverride');
|
||||
$modulenode->add(get_string('permissions', 'role'), $url, self::TYPE_SETTING, null, 'roleoverride',
|
||||
new pix_icon('i/permissions', ''));
|
||||
}
|
||||
// Check role permissions
|
||||
if (has_any_capability(array('moodle/role:assign', 'moodle/role:safeoverride','moodle/role:override', 'moodle/role:assign'), $this->page->cm->context)) {
|
||||
$url = new moodle_url('/'.$CFG->admin.'/roles/check.php', array('contextid'=>$this->page->cm->context->id));
|
||||
$modulenode->add(get_string('checkpermissions', 'role'), $url, self::TYPE_SETTING, null, 'rolecheck');
|
||||
$modulenode->add(get_string('checkpermissions', 'role'), $url, self::TYPE_SETTING, null, 'rolecheck',
|
||||
new pix_icon('i/checkpermissions', ''));
|
||||
}
|
||||
|
||||
// Add the context locking node.
|
||||
@ -4838,7 +4841,8 @@ class settings_navigation extends navigation_node {
|
||||
// Manage filters
|
||||
if (has_capability('moodle/filter:manage', $this->page->cm->context) && count(filter_get_available_in_context($this->page->cm->context))>0) {
|
||||
$url = new moodle_url('/filter/manage.php', array('contextid'=>$this->page->cm->context->id));
|
||||
$modulenode->add(get_string('filters', 'admin'), $url, self::TYPE_SETTING, null, 'filtermanage');
|
||||
$modulenode->add(get_string('filters', 'admin'), $url, self::TYPE_SETTING, null, 'filtermanage',
|
||||
new pix_icon('i/filter', ''));
|
||||
}
|
||||
// Add reports
|
||||
$reports = get_plugin_list_with_function('report', 'extend_navigation_module', 'lib.php');
|
||||
@ -4849,14 +4853,14 @@ class settings_navigation extends navigation_node {
|
||||
$featuresfunc = $this->page->activityname.'_supports';
|
||||
if (function_exists($featuresfunc) && $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, null, 'backup');
|
||||
$modulenode->add(get_string('backup'), $url, self::TYPE_SETTING, null, 'backup', new pix_icon('i/backup', ''));
|
||||
}
|
||||
|
||||
// Restore this activity
|
||||
$featuresfunc = $this->page->activityname.'_supports';
|
||||
if (function_exists($featuresfunc) && $featuresfunc(FEATURE_BACKUP_MOODLE2) && has_capability('moodle/restore:restoreactivity', $this->page->cm->context)) {
|
||||
$url = new moodle_url('/backup/restorefile.php', array('contextid'=>$this->page->cm->context->id));
|
||||
$modulenode->add(get_string('restore'), $url, self::TYPE_SETTING, null, 'restore');
|
||||
$modulenode->add(get_string('restore'), $url, self::TYPE_SETTING, null, 'restore', new pix_icon('i/restore', ''));
|
||||
}
|
||||
|
||||
// Allow the active advanced grading method plugin to append its settings
|
||||
|
@ -60,7 +60,7 @@ function report_competency_extend_navigation_module($navigation, $cm) {
|
||||
context_course::instance($cm->course))) {
|
||||
$url = new moodle_url('/report/competency/index.php', array('id' => $cm->course, 'mod' => $cm->id));
|
||||
$name = get_string('pluginname', 'report_competency');
|
||||
$navigation->add($name, $url, navigation_node::TYPE_SETTING, null, 'competencybreakdown')
|
||||
->set_show_in_secondary_navigation(false);
|
||||
$navigation->add($name, $url, navigation_node::TYPE_SETTING, null, 'competencybreakdown',
|
||||
new pix_icon('i/competencies', ''))->set_show_in_secondary_navigation(false);
|
||||
}
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ function report_log_can_access_user_report($user, $course) {
|
||||
function report_log_extend_navigation_module($navigation, $cm) {
|
||||
if (has_capability('report/log:view', context_course::instance($cm->course))) {
|
||||
$url = new moodle_url('/report/log/index.php', array('chooselog'=>'1','id'=>$cm->course,'modid'=>$cm->id));
|
||||
$navigation->add(get_string('logs'), $url, navigation_node::TYPE_SETTING, null, 'logreport')
|
||||
$navigation->add(get_string('logs'), $url, navigation_node::TYPE_SETTING, null, 'logreport', new pix_icon('i/report', ''))
|
||||
->set_show_in_secondary_navigation(false);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user