New capability gradereport/outcomes:manage and implementation in tabs
This commit is contained in:
@@ -13,6 +13,16 @@ $gradereport_outcomes_capabilities = array(
|
||||
)
|
||||
),
|
||||
|
||||
'gradereport/outcomes:manage' => array(
|
||||
'riskbitmask' => RISK_CONFIG,
|
||||
'captype' => 'write',
|
||||
'contextlevel' => CONTEXT_COURSE,
|
||||
'legacy' => array(
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'admin' => CAP_ALLOW
|
||||
)
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,21 +1,28 @@
|
||||
<?php // $Id$
|
||||
$row = $tabs = array();
|
||||
|
||||
$row[] = new tabobject('outcomereport',
|
||||
$CFG->wwwroot.'/grade/report/outcomes/index.php?id='.$courseid,
|
||||
get_string('outcomereport', 'grades'));
|
||||
|
||||
// Needs capability here
|
||||
if ($courseid != SITEID) {
|
||||
$row[] = new tabobject('courseoutcomes',
|
||||
$CFG->wwwroot.'/grade/report/outcomes/course.php?id='.$courseid,
|
||||
get_string('courseoutcomes', 'gradereport_outcomes'));
|
||||
if ($courseid && ($courseid != SITEID)) {
|
||||
|
||||
$row[] = new tabobject('outcomereport',
|
||||
$CFG->wwwroot.'/grade/report/outcomes/index.php?id='.$courseid,
|
||||
get_string('outcomereport', 'grades'));
|
||||
|
||||
$coursecontext = get_context_instance(CONTEXT_COURSE, $courseid);
|
||||
if (has_capability('gradereport/outcomes:manage', $coursecontext)) {
|
||||
$row[] = new tabobject('courseoutcomes',
|
||||
$CFG->wwwroot.'/grade/report/outcomes/course.php?id='.$courseid,
|
||||
get_string('courseoutcomes', 'gradereport_outcomes'));
|
||||
}
|
||||
}
|
||||
|
||||
// Needs capability here
|
||||
$row[] = new tabobject('siteoutcomes',
|
||||
$CFG->wwwroot.'/grade/report/outcomes/site.php?id='.$courseid,
|
||||
get_string('siteoutcomes', 'gradereport_outcomes'));
|
||||
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
if (has_capability('gradereport/outcomes:manage', $sitecontext, NULL, false)) {
|
||||
$row[] = new tabobject('siteoutcomes',
|
||||
$CFG->wwwroot.'/grade/report/outcomes/site.php?id='.$courseid,
|
||||
get_string('siteoutcomes', 'gradereport_outcomes'));
|
||||
}
|
||||
|
||||
$tabs[] = $row;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?PHP // $Id$
|
||||
|
||||
$plugin->version = 2007072500;
|
||||
$plugin->version = 2007072501;
|
||||
$plugin->requires = 2007072402;
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user