mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-10870 All files updated to new build_navigation() method.
This commit is contained in:
parent
d8c684de7e
commit
f1af7aaaf5
14 changed files with 125 additions and 91 deletions
|
@ -90,7 +90,7 @@
|
|||
$timeformat = get_string('strftimedate');
|
||||
$today = time();
|
||||
$today = make_timestamp(date('Y', $today), date('m', $today), date('d', $today), 0, 0, 0);
|
||||
|
||||
|
||||
$basemenu[0] = get_string('startdate') . ' (' . userdate($course->startdate, $timeformat) . ')';
|
||||
if ($course->enrollable != 2 || ($course->enrolstartdate == 0 || $course->enrolstartdate <= $today) && ($course->enrolenddate == 0 || $course->enrolenddate > $today)) {
|
||||
$basemenu[3] = get_string('today') . ' (' . userdate($today, $timeformat) . ')' ;
|
||||
|
@ -103,7 +103,7 @@
|
|||
$basemenu[5] = get_string('courseenrolenddate') . ' (' . userdate($course->enrolenddate, $timeformat) . ')';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Make sure this user can assign that role
|
||||
|
||||
if ($roleid) {
|
||||
|
@ -122,16 +122,22 @@
|
|||
|
||||
if ($context->contextlevel == CONTEXT_USER) {
|
||||
/// course header
|
||||
$navlinks = array();
|
||||
if ($courseid != SITEID) {
|
||||
print_header("$fullname", "$fullname",
|
||||
"<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> ->
|
||||
<a href=\"$CFG->wwwroot/user/index.php?id=$course->id\">$strparticipants</a> -> <a href=\"$CFG->wwwroot/user/view.php?id=$userid&course=$courseid\">$fullname</a> ->".$straction,
|
||||
"", "", true, " ", navmenu($course));
|
||||
$navlinks[] = array('name' => $course->shortname, 'link' => "$CFG->wwwroot/course/view.php?id=$course->id", 'type' => 'course');
|
||||
$navlinks[] = array('name' => $strparticipants, 'link' => "$CFG->wwwroot/user/index.php?id=$course->id", 'type' => 'misc');
|
||||
$navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$userid&course=$courseid", 'type' => 'misc');
|
||||
$navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
|
||||
$navigation = build_navigation($navlinks);
|
||||
|
||||
print_header("$fullname", "$fullname", $navigation, "", "", true, " ", navmenu($course));
|
||||
|
||||
/// site header
|
||||
} else {
|
||||
print_header("$course->fullname: $fullname", $course->fullname,
|
||||
"<a href=\"$CFG->wwwroot/user/view.php?id=$userid&course=$courseid\">$fullname</a> -> $straction", "", "", true, " ", navmenu($course));
|
||||
$navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$userid&course=$courseid", 'type' => 'misc');
|
||||
$navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
|
||||
$navigation = build_navigation($navlinks);
|
||||
print_header("$course->fullname: $fullname", $course->fullname, $navigation, "", "", true, " ", navmenu($course));
|
||||
}
|
||||
|
||||
$showroles = 1;
|
||||
|
@ -190,7 +196,7 @@
|
|||
$timestart = $course->enrolenddate;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if($extendperiod > 0) {
|
||||
$timeend = $timestart + $extendperiod;
|
||||
} else {
|
||||
|
@ -251,7 +257,7 @@
|
|||
if ($context->contextlevel==CONTEXT_SYSTEM) {
|
||||
print_box(get_string('globalroleswarning', 'role'));
|
||||
}
|
||||
|
||||
|
||||
if ($roleid) { /// prints a form to swap roles
|
||||
|
||||
/// Get all existing participants in this context.
|
||||
|
|
|
@ -100,8 +100,8 @@
|
|||
continue;
|
||||
}
|
||||
|
||||
if (isset($localoverrides[$capname])) {
|
||||
// Something exists, so update it
|
||||
if (isset($localoverrides[$capname])) {
|
||||
// Something exists, so update it
|
||||
assign_capability($capname, $value, $roleid, $context->id, true);
|
||||
} else { // insert a record
|
||||
if ($value != CAP_INHERIT) { // Ignore inherits
|
||||
|
@ -116,18 +116,22 @@
|
|||
/// Print the header and tabs
|
||||
|
||||
if ($context->contextlevel == CONTEXT_USER) {
|
||||
|
||||
$navlinks = array();
|
||||
/// course header
|
||||
if ($course->id != SITEID) {
|
||||
print_header("$fullname", "$fullname",
|
||||
"<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> ->
|
||||
<a href=\"$CFG->wwwroot/user/index.php?id=$course->id\">$strparticipants</a> -> <a href=\"$CFG->wwwroot/user/view.php?id=$userid&course=$course->id\">$fullname</a> -> $straction",
|
||||
"", "", true, " ", navmenu($course));
|
||||
$navlinks[] = array('name' => $course->shortname, 'link' => "$CFG->wwwroot/course/view.php?id=$course->id", 'type' => 'course');
|
||||
$navlinks[] = array('name' => $strparticipants, 'link' => "$CFG->wwwroot/user/index.php?id=$course->id", 'type' => 'misc');
|
||||
$navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$userid&course=$courseid", 'type' => 'misc');
|
||||
$navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
|
||||
$navigation = build_navigation($navlinks);
|
||||
print_header("$fullname", "$fullname", $navigation, "", "", true, " ", navmenu($course));
|
||||
|
||||
/// site header
|
||||
} else {
|
||||
print_header("$course->fullname: $fullname", $course->fullname,
|
||||
"<a href=\"$CFG->wwwroot/user/view.php?id=$userid&course=$course->id\">$fullname</a> -> $straction", "", "", true, " ", navmenu($course));
|
||||
$navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$userid&course=$courseid", 'type' => 'misc');
|
||||
$navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
|
||||
$navigation = build_navigation($navlinks);
|
||||
print_header("$course->fullname: $fullname", $course->fullname, $navigation, "", "", true, " ", navmenu($course));
|
||||
}
|
||||
$showroles = 1;
|
||||
$currenttab = 'override';
|
||||
|
|
|
@ -13,7 +13,10 @@ if ($currenttab != 'update') {
|
|||
|
||||
case CONTEXT_SYSTEM:
|
||||
$stradministration = get_string('administration');
|
||||
print_header($SITE->fullname, "$SITE->fullname","<a href=\"../index.php\">$stradministration</a> -> $straction");
|
||||
$navlinks[] = array('name' => $stradministration, 'link' => '../index.php', 'type' => 'misc');
|
||||
$navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
|
||||
$navigation = build_navigation($navlinks);
|
||||
print_header($SITE->fullname, "$SITE->fullname", $navigation);
|
||||
break;
|
||||
|
||||
case CONTEXT_PERSONAL:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue