mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-17465 - separate live log capability adn admin tree link
This commit is contained in:
parent
c25cedf2a5
commit
e0f81e94a6
10 changed files with 68 additions and 12 deletions
|
@ -35,8 +35,22 @@ $coursereport_log_capabilities = array(
|
|||
'admin' => CAP_ALLOW
|
||||
),
|
||||
|
||||
'clonepermissionsfrom' => 'moodle/site:viewreports',
|
||||
),
|
||||
|
||||
'coursereport/log:viewlive' => array(
|
||||
'riskbitmask' => RISK_PERSONAL,
|
||||
'captype' => 'read',
|
||||
'contextlevel' => CONTEXT_COURSE,
|
||||
'legacy' => array(
|
||||
'teacher' => CAP_ALLOW,
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'admin' => CAP_ALLOW
|
||||
),
|
||||
|
||||
'clonepermissionsfrom' => 'moodle/site:viewreports',
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
|
|
|
@ -137,14 +137,6 @@
|
|||
print_heading(get_string('chooselogs') .':');
|
||||
|
||||
print_log_selector_form($course, $user, $date, $modname, $modid, $modaction, $group, $showcourses, $showusers, $logformat);
|
||||
|
||||
echo '<br />';
|
||||
print_heading(get_string('chooselivelogs') .':');
|
||||
|
||||
echo '<center><h3>';
|
||||
link_to_popup_window('/course/report/log/live.php?id='. $course->id,'livelog', get_string('livelogs'), 500, 800);
|
||||
echo '</h3></center>';
|
||||
|
||||
}
|
||||
|
||||
print_footer($course);
|
||||
|
|
43
course/report/log/indexlive.php
Normal file
43
course/report/log/indexlive.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php // $Id$
|
||||
// Display link to live logs in separate window
|
||||
|
||||
require_once('../../../config.php');
|
||||
require_once('../../lib.php');
|
||||
require_once('lib.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$id = optional_param('id', 0, PARAM_INT);// Course ID
|
||||
|
||||
if (!$course = $DB->get_record('course', array('id'=>$id)) ) {
|
||||
error('That\'s an invalid course id'.$id);
|
||||
}
|
||||
|
||||
require_login($course);
|
||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
|
||||
require_capability('coursereport/log:viewlive', $context);
|
||||
|
||||
$strlogs = get_string('logs');
|
||||
$strreports = get_string('reports');
|
||||
|
||||
if ($course->id == SITEID) {
|
||||
admin_externalpage_setup('reportloglive');
|
||||
admin_externalpage_print_header();
|
||||
|
||||
} else {
|
||||
$navlinks = array();
|
||||
$navlinks[] = array('name' => $strreports, 'link' => "$CFG->wwwroot/course/report.php?id=$course->id", 'type' => 'misc');
|
||||
$navlinks[] = array('name' => $strlogs, 'link' => null, 'type' => 'misc');
|
||||
$navigation = build_navigation($navlinks);
|
||||
print_header($course->shortname .': '. $strlogs, $course->fullname, $navigation, '');
|
||||
}
|
||||
|
||||
print_heading(get_string('loglive', 'coursereport_log'));
|
||||
|
||||
echo '<div class="info">';
|
||||
link_to_popup_window('/course/report/log/live.php?id='. $course->id,'livelog', get_string('livelogs'), 500, 800);
|
||||
echo '<div>';
|
||||
|
||||
print_footer($course);
|
||||
|
||||
?>
|
|
@ -14,7 +14,7 @@
|
|||
require_login($course);
|
||||
|
||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
require_capability('coursereport/log:view', $context);
|
||||
require_capability('coursereport/log:viewlive', $context);
|
||||
|
||||
add_to_log($course->id, "course", "report live", "report/log/live.php?id=$course->id", $course->id);
|
||||
|
||||
|
|
|
@ -11,7 +11,9 @@
|
|||
print_heading(get_string('chooselogs') .':');
|
||||
|
||||
print_log_selector_form($course);
|
||||
}
|
||||
|
||||
if (has_capability('coursereport/log:viewlive', $context)) {
|
||||
print_heading(get_string('chooselivelogs') .':');
|
||||
echo '<p>';
|
||||
link_to_popup_window('/course/report/log/live.php?id='. $course->id,'livelog', get_string('livelogs'), 500, 800);
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
// //
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$plugin->version = 2007101500;
|
||||
$plugin->version = 2007101502;
|
||||
$plugin->requires = 2007101532;
|
||||
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue