mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 00:42:54 +02:00
MDL-11382 added a link 'Profil' to the administration block
This commit is contained in:
parent
b342e64f30
commit
70044d63c4
@ -213,26 +213,9 @@ class block_admin extends block_list {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// View own activity report
|
||||
$coursecontext = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
$personalcontext = get_context_instance(CONTEXT_USER, $USER->id);
|
||||
if ($course->id !== SITEID
|
||||
&& ($course->showreports
|
||||
|| has_capability('moodle/user:viewuseractivitiesreport', $context)
|
||||
|| has_capability('moodle/user:viewuseractivitiesreport', $coursecontext)
|
||||
|| has_capability('moodle/user:viewuseractivitiesreport', $personalcontext))){
|
||||
$this->content->items[]='<a href="'.$CFG->wwwroot.'/course/user.php?id='.$course->id.'&user='.$USER->id.'&mode=todaylogs'.'">'.get_string('activityreports').'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/report.gif" alt="" />';
|
||||
}
|
||||
|
||||
/// Edit your own profile
|
||||
if ($course->id !== SITEID && has_capability('moodle/user:editownprofile', $context)){
|
||||
$this->content->items[]='<a href="'.$CFG->wwwroot.'/user/edit.php?id='.$USER->id.'&course='.$course->id.'">'.get_string('editmyprofile').'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" alt="" />';
|
||||
}
|
||||
|
||||
|
||||
/// Link to the user own profile
|
||||
$this->content->items[]='<a href="'.$CFG->wwwroot.'/user/view.php?id='.$USER->id.'&course='.$course->id.'">'.get_string('profile').'</a>';
|
||||
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/user.gif" alt="" />';
|
||||
|
||||
return $this->content;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user