mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 00:16:46 +02:00
MDL-11379 and MDL-11380 fixed
This commit is contained in:
parent
6421ee7191
commit
2f6c662f41
4 changed files with 32 additions and 30 deletions
|
@ -32,7 +32,7 @@
|
|||
|
||||
$site = get_site();
|
||||
print_heading(format_string($site->fullname));
|
||||
|
||||
|
||||
if ($CFG->bloglevel >= 4) {
|
||||
if (has_capability('moodle/course:viewparticipants', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
|
||||
$toprow[] = new tabobject('participants', $CFG->wwwroot.'/user/index.php?id='.SITEID,
|
||||
|
@ -54,7 +54,7 @@
|
|||
|
||||
$toprow[] = new tabobject('participants', $CFG->wwwroot.'/user/index.php?id='.$filterselect,
|
||||
get_string('participants'));
|
||||
|
||||
|
||||
if ($CFG->bloglevel >= 3) {
|
||||
$toprow[] = new tabobject('blogs', $CFG->wwwroot.'/blog/index.php?filtertype=course&filterselect='.$filterselect, get_string('blogs','blog'));
|
||||
}
|
||||
|
@ -76,7 +76,7 @@
|
|||
$toprow[] = new tabobject('participants', $CFG->wwwroot.'/user/index.php?id='.$course->id.'&group='.$filterselect,
|
||||
get_string('participants'));
|
||||
|
||||
|
||||
|
||||
$toprow[] = new tabobject('blogs', $CFG->wwwroot.'/blog/index.php?filtertype=group&filterselect='.$filterselect, get_string('blogs','blog'));
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@
|
|||
}
|
||||
|
||||
/// Everyone can see posts for this user
|
||||
|
||||
|
||||
/// add logic to see course read posts permission
|
||||
if (has_capability('moodle/user:readuserposts', $personalcontext) || has_capability('mod/forum:viewdiscussion', get_context_instance(CONTEXT_COURSE, $course->id))) {
|
||||
$toprow[] = new tabobject('forumposts', $CFG->wwwroot.'/mod/forum/user.php?id='.$user->id.'&course='.$course->id,
|
||||
|
@ -176,10 +176,10 @@
|
|||
}
|
||||
|
||||
/// Current user must be teacher of the course or the course allows user to view their reports
|
||||
|
||||
|
||||
//print_object($course);
|
||||
//print_object($user);
|
||||
|
||||
|
||||
// add in logic to check course read report
|
||||
if (has_capability('moodle/user:viewuseractivitiesreport', $personalcontext) || ($course->showreports and $USER->id == $user->id) || has_capability('moodle/user:viewuseractivitiesreport', $coursecontext)) {
|
||||
|
||||
|
@ -203,12 +203,12 @@
|
|||
$secondrow[] = new tabobject('stats',$CFG->wwwroot.'/course/user.php?id='.$course->id.
|
||||
'&user='.$user->id.'&mode=stats',get_string('stats'));
|
||||
}
|
||||
|
||||
|
||||
if ($course->showgrades) {
|
||||
$secondrow[] = new tabobject('grade', $CFG->wwwroot.'/course/user.php?id='.$course->id.
|
||||
'&user='.$user->id.'&mode=grade', get_string('grade'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -218,25 +218,25 @@
|
|||
|
||||
/// this needs permission checkings
|
||||
|
||||
|
||||
|
||||
if (!empty($showroles) and !empty($user)) { // this variable controls whether this roles is showed, or not, so only user/view page should set this flag
|
||||
$usercontext = get_context_instance(CONTEXT_USER, $user->id);
|
||||
if (has_capability('moodle/role:assign',$usercontext)) {
|
||||
$toprow[] = new tabobject('roles', $CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$usercontext->id.'&userid='.$user->id.'&courseid='.$course->id
|
||||
,get_string('roles'));
|
||||
|
||||
|
||||
if (in_array($currenttab, array('assign', 'override'))) {
|
||||
$inactive = array('roles');
|
||||
$activetwo = array('roles');
|
||||
|
||||
|
||||
$secondrow = array();
|
||||
$secondrow[] = new tabobject('assign', $CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$usercontext->id.'&userid='.$user->id.'&courseid='.$course->id
|
||||
,get_string('assignroles', 'role'));
|
||||
$secondrow[] = new tabobject('override', $CFG->wwwroot.'/'.$CFG->admin.'/roles/override.php?contextid='.$usercontext->id.'&userid='.$user->id.'&courseid='.$course->id
|
||||
,get_string('overrideroles', 'role'));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// Add second row to display if there is one
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue