$straddnote = get_string('addnewnote', 'notes');
-$navlinks = array();
-$navlinks[] = array('name' => $straddnote, 'link' => null, 'type' => 'misc');
-$navigation = build_navigation($navlinks);
+$PAGE->navbar->add($straddnote);
+$PAGE->set_title("$course->shortname: ".get_string('extendenrol'));
+$PAGE->set_heading($course->fullname);
-print_header("$course->shortname: ".get_string('extendenrol'), $course->fullname, $navigation, "", "", true, " ", navmenu($course));
+echo $OUTPUT->header();
// this will contain all available the based On select options, but we'll disable some on them on a per user basis
}
if ($user->deleted) {
- print_header();
+ echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('userdeleted'));
echo $OUTPUT->footer();
die;
$strparticipants = get_string('participants');
$userfullname = fullname($user, true);
- $navlinks = array();
+ $link = null;
if (has_capability('moodle/course:viewparticipants', $coursecontext) || has_capability('moodle/site:viewparticipants', $systemcontext)) {
- $navlinks[] = array('name' => $strparticipants, 'link' => "index.php?id=$course->id", 'type' => 'misc');
+ $link = new moodle_url($CFG->wwwroot."/user/index.php", array('id'=>$course->id));
}
- $navlinks[] = array('name' => $userfullname,
- 'link' => "view.php?id=$user->id&course=$course->id",
- 'type' => 'misc');
- $navlinks[] = array('name' => $streditmyprofile, 'link' => null, 'type' => 'misc');
- $navigation = build_navigation($navlinks);
- print_header("$course->shortname: $streditmyprofile", $course->fullname, $navigation, "");
+ $PAGE->navbar->add($strparticipants, null, null, navigation_node::TYPE_SETTING, $link);
+ $link = new moodle_url($CFG->wwwroot.'/user/view.php', array('id'=>$user->id, 'course'=>$course->id));
+ $PAGE->navbar->add($userfullname, null, null, navigation_node::TYPE_SETTING, $link);
+ $PAGE->navbar->add($streditmyprofile);
+ $PAGE->set_title("$course->shortname: $streditmyprofile");
+ $PAGE->set_heading($course->fullname);
+
+ echo $OUTPUT->header();
/// Print tabs at the top
$showroles = 1;
}
if ($user->deleted) {
- print_header();
+ echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('userdeleted'));
echo $OUTPUT->footer();
die;
} else if (!empty($USER->newadminuser)) {
$strinstallation = get_string('installation', 'install');
$strprimaryadminsetup = get_string('primaryadminsetup');
- $navigation = build_navigation(array(array('name'=>$strprimaryadminsetup, 'link'=>null, 'type'=>'misc')));
- print_header($strinstallation, $strinstallation, $navigation, "", "", false, " ", " ");
+
+ $PAGE->navbar->add($strprimaryadminsetup);
+ $PAGE->set_title($strinstallation);
+ $PAGE->set_heading($strinstallation);
+ $PAGE->set_cacheable(false);
+
+ echo $OUTPUT->header();
echo $OUTPUT->box(get_string('configintroadmin', 'admin'), 'generalbox boxwidthnormal boxaligncenter');
echo '<br />';
} else {
$strnewuser = get_string('newuser');
$userfullname = fullname($user, true);
- $navlinks = array();
+ $link = null;
if (has_capability('moodle/course:viewparticipants', $coursecontext) || has_capability('moodle/site:viewparticipants', $systemcontext)) {
- $navlinks[] = array('name' => $strparticipants, 'link' => "index.php?id=$course->id", 'type' => 'misc');
+ $link = new moodle_url($CFG->wwwroot."/user/index.php", array('id'=>$course->id));
}
- $navlinks[] = array('name' => $userfullname,
- 'link' => "view.php?id=$user->id&course=$course->id",
- 'type' => 'misc');
- $navlinks[] = array('name' => $streditmyprofile, 'link' => null, 'type' => 'misc');
- $navigation = build_navigation($navlinks);
- print_header("$course->shortname: $streditmyprofile", $course->fullname, $navigation, "");
+ $PAGE->navbar->add($strparticipants, null, null, navigation_node::TYPE_SETTING, $link);
+ $link = new moodle_url($CFG->wwwroot.'/user/view.php', array('id'=>$user->id, 'course'=>$course->id));
+ $PAGE->navbar->add($userfullname, null, null, navigation_node::TYPE_SETTING, $link);
+ $PAGE->navbar->add($streditmyprofile);
+
+ $PAGE->set_title("$course->shortname: $streditmyprofile");
+ $PAGE->set_heading($course->fullname);
+ echo $OUTPUT->header();
/// Print tabs at the top
$showroles = 1;
$currenttab = 'editprofile';
$a = new stdClass();
$a->fullname = fullname($user, true);
$stremailupdate = get_string('auth_emailupdate', 'auth_email', $a);
-print_header(format_string($SITE->fullname) . ": $stremailupdate", format_string($SITE->fullname) . ": $stremailupdate");
+
+$PAGE->set_title(format_string($SITE->fullname) . ": $stremailupdate");
+$PAGE->set_heading(format_string($SITE->fullname) . ": $stremailupdate");
+
+echo $OUTPUT->header();
if (empty($preferences['newemailattemptsleft'])) {
redirect("$CFG->wwwroot/user/view.php?id=$user->id");
/// Print headers
-$navlinks = array();
-$navlinks[] = array('name' => get_string('extendenrol'), 'link' => null, 'type' => 'misc');
-$navigation = build_navigation($navlinks);
+$PAGE->navbar->add(get_string('extendenrol'));
+$PAGE->set_title("$course->shortname: ".get_string('extendenrol'));
+$PAGE->set_heading( $course->fullname);
-print_header("$course->shortname: ".get_string('extendenrol'), $course->fullname, $navigation, "", "", true, " ", navmenu($course));
+echo $OUTPUT->header();
$timeformat = get_string('strftimedate');
$unlimited = get_string('unlimited');
redirect("$CFG->wwwroot/user/index.php?id=$id");
}
-/// Print headers
-
$straddnote = get_string('groupaddnewnote', 'notes');
-$navlinks = array();
-$navlinks[] = array('name' => $straddnote, 'link' => null, 'type' => 'misc');
-$navigation = build_navigation($navlinks);
+$PAGE->navbar->add($straddnote);
+$PAGE->set_title("$course->shortname: ".get_string('extendenrol'));
+$PAGE->set_heading($course->fullname);
-print_header("$course->shortname: ".get_string('extendenrol'), $course->fullname, $navigation, "", "", true, " ", navmenu($course));
+/// Print headers
+echo $OUTPUT->header();
// this will contain all available the based On select options, but we'll disable some on them on a per user basis
redirect("$CFG->wwwroot/user/index.php?id=$id", get_string('changessaved'));
}
-/// Print headers
-
-$navlinks = array();
-$navlinks[] = array('name' => get_string('extendenrol'), 'link' => null, 'type' => 'misc');
-$navigation = build_navigation($navlinks);
+$PAGE->navbar->add(get_string('extendenrol'));
+$PAGE->set_title("$course->shortname: ".get_string('extendenrol'));
+$PAGE->set_heading($course->fullname);
-print_header("$course->shortname: ".get_string('extendenrol'), $course->fullname, $navigation, "", "", true, " ", navmenu($course));
+/// Print headers
+echo $OUTPUT->header();
$timeformat = get_string('strftimedate');
$unlimited = get_string('unlimited');
$isseparategroups = ($course->groupmode == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $context));
- if ($isseparategroups and (!$currentgroup) ) {
- $navlinks = array();
- $navlinks[] = array('name' => get_string('participants'), 'link' => null, 'type' => 'misc');
- $navigation = build_navigation($navlinks);
+ $PAGE->navbar->add(get_string('participants'));
+ $PAGE->set_title("$course->shortname: ".get_string('participants'));
+ $PAGE->set_heading($course->fullname);
+
+ echo $OUTPUT->header();
- print_header("$course->shortname: ".get_string('participants'), $course->fullname, $navigation, "", "", true, " ", navmenu($course));
+ if ($isseparategroups and (!$currentgroup) ) {
+ // The user is not in the group so show message and exit
echo $OUTPUT->heading(get_string("notingroup"));
echo $OUTPUT->footer();
exit;
'accesssince' => $accesssince,
'search' => s($search)));
-/// Print headers
-
- $navlinks = array();
- $navlinks[] = array('name' => get_string('participants'), 'link' => null, 'type' => 'misc');
- $navigation = build_navigation($navlinks);
-
- print_header("$course->shortname: ".get_string('participants'), $course->fullname, $navigation, "", "", true, " ", navmenu($course));
-
/// setting up tags
if ($course->id == SITEID) {
$filtertype = 'site';
$strtitle = get_string('coursemessage');
- if (empty($messagebody)) {
- $formstart = "theform.messagebody";
- } else {
- $formstart = "";
- }
-
- $navlinks = array();
+ $link = null;
if (has_capability('moodle/course:viewparticipants', $coursecontext) || has_capability('moodle/site:viewparticipants', $systemcontext)) {
- $navlinks[] = array('name' => get_string('participants'), 'link' => "index.php?id=$course->id", 'type' => 'misc');
+ $link = new moodle_url($CFG->wwwroot."/user/index.php", array('id'=>$course->id));
+ }
+ $PAGE->navbar->add(get_string('participants'), null, null, navigation_node::TYPE_SETTING, $link);
+ $PAGE->navbar->add($strtitle);
+ $PAGE->set_title($strtitle);
+ $PAGE->set_heading($strtitle);
+ if (empty($messagebody)) {
+ $PAGE->set_focuscontrol('theform.messagebody');
}
- $navlinks[] = array('name' => $strtitle, 'link' => null, 'type' => 'misc');
- $navigation = build_navigation($navlinks);
-
- print_header($strtitle,$strtitle,$navigation,$formstart);
+ echo $OUTPUT->header();
// if messaging is disabled on site, we can still allow users with capabilities to send emails instead
if (empty($CFG->messaging)) {
echo $OUTPUT->notification(get_string('messagingdisabled','message'));
$strpolicyagreement = get_string('policyagreement');
$strpolicyagreementclick = get_string('policyagreementclick');
- print_header($strpolicyagreement, $SITE->fullname, build_navigation(array(array('name'=>$strpolicyagreement, 'link'=>null, 'type'=>'misc'))));
+ $PAGE->set_title($strpolicyagreement);
+ $PAGE->set_heading($SITE->fullname);
+ $PAGE->navbar->add($strpolicyagreement);
+ echo $OUTPUT->header();
echo $OUTPUT->heading($strpolicyagreement);
$mimetype = mimeinfo('type', $CFG->sitepolicy);
require_login($course, false);
-$navlinks[] = array('name' => $fullname, 'link' => $CFG->wwwroot . '/user/view.php?id=' . $user->id, 'type' => 'misc');
-$navlinks[] = array('name' => $strportfolios, 'link' => null, 'type' => 'misc');
-
-$navigation = build_navigation($navlinks);
-
-print_header("$course->fullname: $fullname: $strportfolios", $course->fullname,
- $navigation, "", "", true, " ", navmenu($course));
-
+echo $OUTPUT->header();
$currenttab = 'portfolioconf';
$showroles = 1;
include('tabs.php');
$page = optional_param('page', 0, PARAM_INT);
$perpage = optional_param('perpage', 10, PARAM_INT);
-$navlinks[] = array('name' => $fullname, 'link' => $CFG->wwwroot . '/user/view.php?id=' . $user->id, 'type' => 'misc');
-$navlinks[] = array('name' => $strportfolios, 'link' => null, 'type' => 'misc');
+$PAGE->set_title("$course->fullname: $fullname: $strportfolios");
+$PAGE->set_heading($course->fullname);
-$navigation = build_navigation($navlinks);
-
-print_header("$course->fullname: $fullname: $strportfolios", $course->fullname,
- $navigation, "", "", true, " ", navmenu($course));
+echo $OUTPUT->header();
$currenttab = 'portfoliologs';
$showroles = 1;
require_login($course, false);
-$navlinks[] = array('name' => $fullname, 'link' => $CFG->wwwroot . '/user/view.php?id=' . $user->id, 'type' => 'misc');
-$navlinks[] = array('name' => $strrepos, 'link' => null, 'type' => 'misc');
+$link = new moodle_url($CFG->wwwroot . '/user/view.php', array('id'=>$user->id));
+$PAGE->navbar->add($fullname, null, null, navigation_node::TYPE_SETTING, $link);
+$PAGE->navbar->add($strrepos);
+$PAGE->set_title("$course->fullname: $fullname: $strrepos");
+$PAGE->set_heading($course->fullname);
-$navigation = build_navigation($navlinks);
-
-print_header("$course->fullname: $fullname: $strrepos", $course->fullname,
- $navigation, "", "", true, " ", navmenu($course));
+echo $OUTPUT->header();
$currenttab = 'repositories';
include('tabs.php');
$fullname = fullname($user, has_capability('moodle/site:viewfullnames', $coursecontext));
- $navlinks = array();
+ $link = null;
if (has_capability('moodle/course:viewparticipants', $coursecontext) || has_capability('moodle/site:viewparticipants', $systemcontext)) {
- $navlinks[] = array('name' => $strparticipants, 'link' => "index.php?id=$course->id", 'type' => 'misc');
+ $link = new moodle_url($CFG->wwwroot."/user/index.php", array('id'=>$course->id));
}
+ $PAGE->navbar->add($strparticipants, null, null, navigation_node::TYPE_SETTING, $link);
/// If the user being shown is not ourselves, then make sure we are allowed to see them!
if (!$currentuser) {
+
+ $PAGE->set_title("$strpersonalprofile: ");
+ $PAGE->set_heading("$strpersonalprofile: ");
+
if ($course->id == SITEID) { // Reduce possibility of "browsing" userbase at site level
if ($CFG->forceloginforprofiles and !isteacherinanycourse()
and !isteacherinanycourse($user->id)
and !has_capability('moodle/user:viewdetails', $usercontext)) { // Teachers can browse and be browsed at site level. If not forceloginforprofiles, allow access (bug #4366)
- $navlinks[] = array('name' => $struser, 'link' => null, 'type' => 'misc');
- $navigation = build_navigation($navlinks);
-
- print_header("$strpersonalprofile: ", "$strpersonalprofile: ", $navigation, "", "", true, " ", navmenu($course));
+ $PAGE->navbar->add($struser);
+ echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('usernotavailable', 'error'));
echo $OUTPUT->footer();
exit;
if (!has_capability('moodle/course:view', $coursecontext, $user->id, false)) {
if (has_capability('moodle/course:view', $coursecontext)) {
- $navlinks[] = array('name' => $fullname, 'link' => null, 'type' => 'misc');
- $navigation = build_navigation($navlinks);
- print_header("$strpersonalprofile: ", "$strpersonalprofile: ", $navigation, "", "", true, " ", navmenu($course));
+ $PAGE->navbar->add($fullname);
echo $OUTPUT->heading(get_string('notenrolled', $fullname));
} else {
- $navlinks[] = array('name' => $struser, 'link' => null, 'type' => 'misc');
- $navigation = build_navigation($navlinks);
- print_header("$strpersonalprofile: ", "$strpersonalprofile: ", $navigation, "", "", true, " ", navmenu($course));
+ $PAGE->navbar->add($struser);
echo $OUTPUT->heading(get_string('notenrolledprofile'));
}
echo $OUTPUT->continue_button($_SERVER['HTTP_REFERER']);
// If groups are in use, make sure we can see that group
if (groups_get_course_groupmode($course) == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $coursecontext)) {
require_login();
-
///this is changed because of mygroupid
$gtrue = (bool)groups_get_all_groups($course->id, $user->id);
if (!$gtrue) {
- $navigation = build_navigation($navlinks);
- print_header("$strpersonalprofile: ", "$strpersonalprofile: ", $navigation, "", "", true, " ", navmenu($course));
print_error("groupnotamember", '', "../course/view.php?id=$course->id");
}
}
/// We've established they can see the user's name at least, so what about the rest?
- $navlinks[] = array('name' => $fullname, 'link' => null, 'type' => 'misc');
-
- $navigation = build_navigation($navlinks);
-
- print_header("$course->fullname: $strpersonalprofile: $fullname", $course->fullname,
- $navigation, "", "", true, " ", navmenu($course));
-
+ $PAGE->navbar->add($struser);
+ $PAGE->set_title("$course->fullname: $strpersonalprofile: $fullname");
+ $PAGE->set_heading($course->fullname);
+ echo $OUTPUT->header();
if (($course->id != SITEID) and ! isguest() ) { // Need to have access to a course to see that info
if (!has_capability('moodle/course:view', $coursecontext, $user->id)) {