MDL-10870 All files updated to new build_navigation() method.

This commit is contained in:
nicolasconnault 2007-08-17 07:25:47 +00:00
parent d8c684de7e
commit f1af7aaaf5
14 changed files with 125 additions and 91 deletions

View file

@ -18,9 +18,11 @@
$stradministration = get_string("administration"); $stradministration = get_string("administration");
$site = get_site(); $site = get_site();
$navigation = build_navigation(array(
array('name'=>$stradministration, 'link'=>'index.php', 'type'=>'misc'),
array('name'=>$strdatabaseperformance, 'link'=>null, 'type'=>'misc')));
if (!empty($topframe)) { if (!empty($topframe)) {
print_header("$site->shortname: $strdatabaseperformance", "$site->fullname", print_header("$site->shortname: $strdatabaseperformance", "$site->fullname", $navigation);
"<a $CFG->frametarget href=\"index.php\">$stradministration</a> -> Database performance");
exit; exit;
} }

View file

@ -129,7 +129,8 @@
error_reporting($CFG->debug); error_reporting($CFG->debug);
if (empty($agreelicense)) { if (empty($agreelicense)) {
$strlicense = get_string('license'); $strlicense = get_string('license');
print_header($strlicense, $strlicense, $strlicense, "", "", false, "&nbsp;", "&nbsp;"); $navigation = build_navigation(array(array('name'=>$strlicense, 'link'=>null, 'type'=>'misc')));
print_header($strlicense, $strlicense, $navigation, "", "", false, "&nbsp;", "&nbsp;");
print_heading("<a href=\"http://moodle.org\">Moodle</a> - Modular Object-Oriented Dynamic Learning Environment"); print_heading("<a href=\"http://moodle.org\">Moodle</a> - Modular Object-Oriented Dynamic Learning Environment");
print_heading(get_string('copyrightnotice')); print_heading(get_string('copyrightnotice'));
print_box(text_to_html(get_string('gpl')), 'copyrightnotice'); print_box(text_to_html(get_string('gpl')), 'copyrightnotice');
@ -141,7 +142,8 @@
} }
if (empty($confirmrelease)) { if (empty($confirmrelease)) {
$strcurrentrelease = get_string("currentrelease"); $strcurrentrelease = get_string("currentrelease");
print_header($strcurrentrelease, $strcurrentrelease, $strcurrentrelease, "", "", false, "&nbsp;", "&nbsp;"); $navigation = build_navigation(array(array('name'=>$strcurrentrelease, 'link'=>null, 'type'=>'misc')));
print_header($strcurrentrelease, $strcurrentrelease, $navigation, "", "", false, "&nbsp;", "&nbsp;");
print_heading("Moodle $release"); print_heading("Moodle $release");
print_box(get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes'), 'generalbox boxaligncenter boxwidthwide'); print_box(get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes'), 'generalbox boxaligncenter boxwidthwide');
echo '<form action="index.php"><div>'; echo '<form action="index.php"><div>';
@ -157,7 +159,8 @@
$strdatabasesetup = get_string("databasesetup"); $strdatabasesetup = get_string("databasesetup");
$strdatabasesuccess = get_string("databasesuccess"); $strdatabasesuccess = get_string("databasesuccess");
print_header($strdatabasesetup, $strdatabasesetup, $strdatabasesetup, $navigation = build_navigation(array(array('name'=>$strdatabasesetup, 'link'=>null, 'type'=>'misc')));
print_header($strdatabasesetup, $strdatabasesetup, $navigation,
"", upgrade_get_javascript(), false, "&nbsp;", "&nbsp;"); "", upgrade_get_javascript(), false, "&nbsp;", "&nbsp;");
/// return to original debugging level /// return to original debugging level
$CFG->debug = $origdebug; $CFG->debug = $origdebug;
@ -267,7 +270,8 @@
} }
if (empty($confirmupgrade)) { if (empty($confirmupgrade)) {
print_header($strdatabasechecking, $stradministration, $strdatabasechecking, $navigation = build_navigation(array(array('name'=>$strdatabasechecking, 'link'=>null, 'type'=>'misc')));
print_header($strdatabasechecking, $stradministration, $navigation,
"", "", false, "&nbsp;", "&nbsp;"); "", "", false, "&nbsp;", "&nbsp;");
notice_yesno(get_string('upgradesure', 'admin', $a->newversion), 'index.php?confirmupgrade=1', 'index.php'); notice_yesno(get_string('upgradesure', 'admin', $a->newversion), 'index.php?confirmupgrade=1', 'index.php');
@ -275,7 +279,8 @@
} else if (empty($confirmrelease)){ } else if (empty($confirmrelease)){
$strcurrentrelease = get_string("currentrelease"); $strcurrentrelease = get_string("currentrelease");
print_header($strcurrentrelease, $strcurrentrelease, $strcurrentrelease, "", "", false, "&nbsp;", "&nbsp;"); $navigation = build_navigation(array(array('name'=>$strcurrentrelease, 'link'=>null, 'type'=>'misc')));
print_header($strcurrentrelease, $strcurrentrelease, $navigation, "", "", false, "&nbsp;", "&nbsp;");
print_heading("Moodle $release"); print_heading("Moodle $release");
print_box(get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes')); print_box(get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes'));
@ -300,7 +305,8 @@
die; die;
} else { } else {
$strdatabasesuccess = get_string("databasesuccess"); $strdatabasesuccess = get_string("databasesuccess");
print_header($strdatabasechecking, $stradministration, $strdatabasechecking, $navigation = build_navigation(array(array('name'=>$strdatabasesuccess, 'link'=>null, 'type'=>'misc')));
print_header($strdatabasechecking, $stradministration, $navigation,
"", upgrade_get_javascript(), false, "&nbsp;", "&nbsp;"); "", upgrade_get_javascript(), false, "&nbsp;", "&nbsp;");
/// return to original debugging level /// return to original debugging level

View file

@ -1,7 +1,10 @@
<?php <?php
print_header("$site->shortname: $strmnetsettings", "$site->fullname", $navlinks = array();
'<a href="'.$CFG->wwwroot.'/admin/index.php">'.$stradministration.'</a> -> '. $navlinks[] = array('name' => $stradministration, 'link' => $CFG->wwwroot.'/admin/index.php', 'type' => 'misc');
'<a href="'.$CFG->wwwroot.'/admin/mnet/index.php">'.get_string('mnetsettings', 'mnet').'</a> -> Delete host'); $navlinks[] = array('name' => get_string('mnetsettings', 'mnet'), 'link' => $CFG->wwwroot.'/admin/mnet/index.php', 'type' => 'misc');
$navlinks[] = array('name' => get_string('deletehost', 'mnet'), 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("$site->shortname: $strmnetsettings", "$site->fullname", $navigation);
print_heading(get_string('mnetsettings', 'mnet')); print_heading(get_string('mnetsettings', 'mnet'));
?> ?>

View file

@ -33,9 +33,11 @@
$stradministration = get_string("administration"); $stradministration = get_string("administration");
$strregistration = get_string("registration"); $strregistration = get_string("registration");
$strregistrationinfo = get_string("registrationinfo"); $strregistrationinfo = get_string("registrationinfo");
$navlinks = array();
print_header("$site->shortname: $strregistration", $site->fullname, $navlinks[] = array('name' => $stradministration, 'link' => "../$CFG->admin/index.php", 'type' => 'misc');
"<a href=\"../$CFG->admin/index.php\">$stradministration</a> -> $strregistration"); $navlinks[] = array('name' => $strregistration, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("$site->shortname: $strregistration", $site->fullname, $navigation);
print_heading($strregistration); print_heading($strregistration);

View file

@ -122,16 +122,22 @@
if ($context->contextlevel == CONTEXT_USER) { if ($context->contextlevel == CONTEXT_USER) {
/// course header /// course header
$navlinks = array();
if ($courseid != SITEID) { if ($courseid != SITEID) {
print_header("$fullname", "$fullname", $navlinks[] = array('name' => $course->shortname, 'link' => "$CFG->wwwroot/course/view.php?id=$course->id", 'type' => 'course');
"<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> -> $navlinks[] = array('name' => $strparticipants, 'link' => "$CFG->wwwroot/user/index.php?id=$course->id", 'type' => 'misc');
<a href=\"$CFG->wwwroot/user/index.php?id=$course->id\">$strparticipants</a> -> <a href=\"$CFG->wwwroot/user/view.php?id=$userid&amp;course=$courseid\">$fullname</a> ->".$straction, $navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$userid&amp;course=$courseid", 'type' => 'misc');
"", "", true, "&nbsp;", navmenu($course)); $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("$fullname", "$fullname", $navigation, "", "", true, "&nbsp;", navmenu($course));
/// site header /// site header
} else { } else {
print_header("$course->fullname: $fullname", $course->fullname, $navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$userid&amp;course=$courseid", 'type' => 'misc');
"<a href=\"$CFG->wwwroot/user/view.php?id=$userid&amp;course=$courseid\">$fullname</a> -> $straction", "", "", true, "&nbsp;", navmenu($course)); $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("$course->fullname: $fullname", $course->fullname, $navigation, "", "", true, "&nbsp;", navmenu($course));
} }
$showroles = 1; $showroles = 1;

View file

@ -116,18 +116,22 @@
/// Print the header and tabs /// Print the header and tabs
if ($context->contextlevel == CONTEXT_USER) { if ($context->contextlevel == CONTEXT_USER) {
$navlinks = array();
/// course header /// course header
if ($course->id != SITEID) { if ($course->id != SITEID) {
print_header("$fullname", "$fullname", $navlinks[] = array('name' => $course->shortname, 'link' => "$CFG->wwwroot/course/view.php?id=$course->id", 'type' => 'course');
"<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> -> $navlinks[] = array('name' => $strparticipants, 'link' => "$CFG->wwwroot/user/index.php?id=$course->id", 'type' => 'misc');
<a href=\"$CFG->wwwroot/user/index.php?id=$course->id\">$strparticipants</a> -> <a href=\"$CFG->wwwroot/user/view.php?id=$userid&amp;course=$course->id\">$fullname</a> -> $straction", $navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$userid&amp;course=$courseid", 'type' => 'misc');
"", "", true, "&nbsp;", navmenu($course)); $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("$fullname", "$fullname", $navigation, "", "", true, "&nbsp;", navmenu($course));
/// site header /// site header
} else { } else {
print_header("$course->fullname: $fullname", $course->fullname, $navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$userid&amp;course=$courseid", 'type' => 'misc');
"<a href=\"$CFG->wwwroot/user/view.php?id=$userid&amp;course=$course->id\">$fullname</a> -> $straction", "", "", true, "&nbsp;", navmenu($course)); $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("$course->fullname: $fullname", $course->fullname, $navigation, "", "", true, "&nbsp;", navmenu($course));
} }
$showroles = 1; $showroles = 1;
$currenttab = 'override'; $currenttab = 'override';

View file

@ -13,7 +13,10 @@ if ($currenttab != 'update') {
case CONTEXT_SYSTEM: case CONTEXT_SYSTEM:
$stradministration = get_string('administration'); $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; break;
case CONTEXT_PERSONAL: case CONTEXT_PERSONAL:

View file

@ -47,8 +47,12 @@
$blocks = blocks_setup($PAGE,BLOCKS_PINNED_TRUE); $blocks = blocks_setup($PAGE,BLOCKS_PINNED_TRUE);
$blocks_preferred_width = bounded_number(180, blocks_preferred_width($blocks[BLOCK_POS_LEFT]), 210); $blocks_preferred_width = bounded_number(180, blocks_preferred_width($blocks[BLOCK_POS_LEFT]), 210);
print_header($strtitle,$strtitle,'<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/index.php">'. $navlinks = array(array('name' => get_string('administration'),
get_string('administration').'</a> -> '.$strtitle); 'link' => "$CFG->wwwroot/$CFG->admin/index.php",
'type' => 'misc'));
$navlinks[] = array('name' => $strtitle, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header($strtitle,$strtitle,$navigation);
echo '<table border="0" cellpadding="3" cellspacing="0" width="100%" id="layout-table">'; echo '<table border="0" cellpadding="3" cellspacing="0" width="100%" id="layout-table">';
echo '<tr valign="top">'; echo '<tr valign="top">';

View file

@ -13,7 +13,7 @@
$strusers = get_string("users"); $strusers = get_string("users");
$strall = get_string("all"); $strall = get_string("all");
print_header($strtimezone, $strtimezone, $strtimezone); print_header($strtimezone, $strtimezone, build_navigation(array(array('name' => $strtimezone, 'link' => null, 'type' => 'misc'))));
print_heading(""); print_heading("");

View file

@ -50,6 +50,7 @@ $string['selectahost'] = 'Please select a remote Moodle host.';
$string['selectaccesslevel'] = 'Please select an access level from the list.'; $string['selectaccesslevel'] = 'Please select an access level from the list.';
$string['noaclentries'] = 'No entries in the SSO access control list'; $string['noaclentries'] = 'No entries in the SSO access control list';
$string['deleteaserver'] = 'Deleting a Server'; $string['deleteaserver'] = 'Deleting a Server';
$string['deletehost'] = 'Delete host';
$string['nosite'] = 'Could not find site-level course'; $string['nosite'] = 'Could not find site-level course';
$string['postrequired'] = 'The delete function requires a POST request.'; $string['postrequired'] = 'The delete function requires a POST request.';
$string['hostdeleted'] = 'Ok - host deleted'; $string['hostdeleted'] = 'Ok - host deleted';

View file

@ -2784,6 +2784,9 @@ function admin_externalpage_setup($section) {
} }
/**
* TODO document
*/
function admin_externalpage_print_header() { function admin_externalpage_print_header() {
global $CFG, $PAGE, $SITE, $THEME; global $CFG, $PAGE, $SITE, $THEME;

View file

@ -2246,17 +2246,17 @@ function get_html_lang($dir = false) {
* @uses $USER * @uses $USER
* @uses $CFG * @uses $CFG
* @uses $SESSION * @uses $SESSION
* @param string $title Appears at the top of the window * @param string $title Appears at the top of the window
* @param string $heading Appears at the top of the page * @param string $heading Appears at the top of the page
* @param string $navigation Premade navigation string (for use as breadcrumbs links) * @param array $navigation Array of $navlinks arrays (keys: name, link, type) for use as breadcrumbs links
* @param string $focus Indicates form element to get cursor focus on load eg inputform.password * @param string $focus Indicates form element to get cursor focus on load eg inputform.password
* @param string $meta Meta tags to be added to the header * @param string $meta Meta tags to be added to the header
* @param boolean $cache Should this page be cacheable? * @param boolean $cache Should this page be cacheable?
* @param string $button HTML code for a button (usually for module editing) * @param string $button HTML code for a button (usually for module editing)
* @param string $menu HTML code for a popup menu * @param string $menu HTML code for a popup menu
* @param boolean $usexml use XML for this page * @param boolean $usexml use XML for this page
* @param string $bodytags This text will be included verbatim in the <body> tag (useful for onload() etc) * @param string $bodytags This text will be included verbatim in the <body> tag (useful for onload() etc)
* @param bool $return If true, return the visible elements of the header instead of echoing them. * @param bool $return If true, return the visible elements of the header instead of echoing them.
*/ */
function print_header ($title='', $heading='', $navigation='', $focus='', function print_header ($title='', $heading='', $navigation='', $focus='',
$meta='', $cache=true, $button='&nbsp;', $menu='', $meta='', $cache=true, $button='&nbsp;', $menu='',

View file

@ -98,7 +98,7 @@ class assignment_base {
$this->navigation[] = array('name' => $this->strassignment, 'link' => '', 'type' => 'activityinstance'); $this->navigation[] = array('name' => $this->strassignment, 'link' => '', 'type' => 'activityinstance');
$navigation = build_navigation($this->navigation); $navigation = build_navigation($this->navigation);
print_header($pagetitle, $this->course->fullname, "$this->navigation $this->strassignment", print_header($pagetitle, $this->course->fullname, $this->navigation,
"", "", true, '', navmenu($this->course, $this->cm)); "", "", true, '', navmenu($this->course, $this->cm));
notice(get_string("activityiscurrentlyhidden"), "$CFG->wwwroot/course/view.php?id={$this->course->id}"); notice(get_string("activityiscurrentlyhidden"), "$CFG->wwwroot/course/view.php?id={$this->course->id}");
} }

View file

@ -1,5 +1,5 @@
<form method="post" action="module.php" id="form"> <form method="post" action="module.php" id="form">
<div"> <div>
<input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>" /> <input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>" />
</div> </div>