]> git.mjollnir.org Git - moodle.git/commitdiff
admin MDL-19787 Upgraded print_header and build_navigation calls to use PAGE and...
authorsamhemelryk <samhemelryk>
Thu, 3 Sep 2009 05:11:33 +0000 (05:11 +0000)
committersamhemelryk <samhemelryk>
Thu, 3 Sep 2009 05:11:33 +0000 (05:11 +0000)
17 files changed:
admin/dbperformance.php
admin/index.php
admin/lang.php
admin/mnet/delete.html
admin/register.php
admin/roles/assign.php
admin/roles/check.php
admin/roles/override.php
admin/roles/tabs.php
admin/roles/usersroles.php
admin/settings.php
admin/timezone.php
admin/xmldb/actions/edit_field_save/edit_field_save.class.php
admin/xmldb/actions/edit_index_save/edit_index_save.class.php
admin/xmldb/actions/edit_key_save/edit_key_save.class.php
admin/xmldb/actions/edit_sentence_save/edit_sentence_save.class.php
admin/xmldb/actions/edit_table_save/edit_table_save.class.php

index 04c8669eb7de226e1bdd46240a5aa91def56e2ac..10aa4c6a22997268f0d1abeaea025e374f9b9f9f 100644 (file)
@@ -20,10 +20,12 @@ error('TODO: rewrite db perf code'); // TODO: rewrite
     $stradministration = get_string("administration");
     $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)) {
-        print_header("$site->shortname: $strdatabaseperformance", "$site->fullname", $navigation);
+        $PAGE->navbar->add($stradministration, null, null, navigation_node::TYPE_CUSTOM,
+                            new moodle_url($CFG->wwwroot.'/admin/index.php'));
+        $PAGE->navbar->add($strdatabaseperformance);
+        $PAGE->set_title("$site->shortname: $strdatabaseperformance");
+        $PAGE->set_heading($site->fullname);
+        echo $OUTPUT->header();
         exit;
     }
index b545108317f1b0d5790d948f966624bd2af25d21..bd771b1f56e7ae87d179ec755c4fd33f508b948a 100644 (file)
@@ -119,8 +119,11 @@ if (!core_tables_exist()) {
 
     if (empty($agreelicense)) {
         $strlicense = get_string('license');
-        $navigation = build_navigation(array(array('name'=>$strlicense, 'link'=>null, 'type'=>'misc')));
-        print_header($strinstallation.' - Moodle '.$CFG->target_release, $strinstallation, $navigation, '', '', false, '&nbsp;', '&nbsp;');
+        $PAGE->navbar->add($strlicense);
+        $PAGE->set_title($strinstallation.' - Moodle '.$CFG->target_release);
+        $PAGE->set_heading($strinstallation);
+        $PAGE->set_cacheable(false);
+        echo $OUTPUT->header();
         echo $OUTPUT->heading('<a href="http://moodle.org">Moodle</a> - Modular Object-Oriented Dynamic Learning Environment');
         echo $OUTPUT->heading(get_string('copyrightnotice'));
         $copyrightnotice = text_to_html(get_string('gpl'));
@@ -133,8 +136,11 @@ if (!core_tables_exist()) {
     }
     if (empty($confirmrelease)) {
         $strcurrentrelease = get_string('currentrelease');
-        $navigation = build_navigation(array(array('name'=>$strcurrentrelease, 'link'=>null, 'type'=>'misc')));
-        print_header($strinstallation.' - Moodle '.$CFG->target_release, $strinstallation, $navigation, '', '', false, '&nbsp;', '&nbsp;');
+        $PAGE->navbar->add($strcurrentrelease);
+        $PAGE->set_title($strinstallation.' - Moodle '.$CFG->target_release);
+        $PAGE->set_heading($strinstallation);
+        $PAGE->set_cacheable(false);
+        echo $OUTPUT->header();
         echo $OUTPUT->heading("Moodle $release");
         $releasenoteslink = get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes');
         $releasenoteslink = str_replace('target="_blank"', 'onclick="this.target=\'_blank\'"', $releasenoteslink); // extremely ugly validation hack
@@ -153,9 +159,12 @@ if (!core_tables_exist()) {
     }
 
     $strdatabasesetup = get_string('databasesetup');
-    $navigation = build_navigation(array(array('name'=>$strdatabasesetup, 'link'=>null, 'type'=>'misc')));
     upgrade_get_javascript();
-    print_header($strinstallation.' - Moodle '.$CFG->target_release, $strinstallation, $navigation, '', '', false, '&nbsp;', '&nbsp;');
+    $PAGE->navbar->add($strdatabasesetup);
+    $PAGE->set_title($strinstallation.' - Moodle '.$CFG->target_release);
+    $PAGE->heading($strinstallation);
+    $PAGE->set_cacheable(false);
+    echo $OUTPUT->header();
 
     if (!$DB->setup_is_unicodedb()) {
         if (!$DB->change_db_encoding()) {
@@ -186,8 +195,11 @@ if ($version > $CFG->version) {  // upgrade
     $strdatabasechecking = get_string('databasechecking', '', $a);
 
     if (empty($confirmupgrade)) {
-        $navigation = build_navigation(array(array('name'=>$strdatabasechecking, 'link'=>null, 'type'=>'misc')));
-        print_header($strdatabasechecking, $stradministration, $navigation, '', '', false, '&nbsp;', '&nbsp;');
+        $PAGE->navbar->add($strdatabasechecking);
+        $PAGE->set_title($strdatabasechecking);
+        $PAGE->heading($stradministration);
+        $PAGE->set_cacheable(false);
+        echo $OUTPUT->header();
         $continueform = new html_form();
         $continueform->method = 'get';
         $continueform->url = new moodle_url('index.php', array('confirmupgrade' => 1));
@@ -200,8 +212,11 @@ if ($version > $CFG->version) {  // upgrade
 
     } else if (empty($confirmrelease)){
         $strcurrentrelease = get_string('currentrelease');
-        $navigation = build_navigation(array(array('name'=>$strcurrentrelease, 'link'=>null, 'type'=>'misc')));
-        print_header($strcurrentrelease, $strcurrentrelease, $navigation, '', '', false, '&nbsp;', '&nbsp;');
+        $PAGE->navbar->add($strcurrentrelease);
+        $PAGE->set_title($strcurrentrelease);
+        $PAGE->heading($strcurrentrelease);
+        $PAGE->set_cacheable(false);
+        echo $OUTPUT->header();
         echo $OUTPUT->heading("Moodle $release");
         $releasenoteslink = get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/en/Release_Notes');
         $releasenoteslink = str_replace('target="_blank"', 'onclick="this.target=\'_blank\'"', $releasenoteslink); // extremely ugly validation hack
@@ -225,8 +240,11 @@ if ($version > $CFG->version) {  // upgrade
 
     } elseif (empty($confirmplugins)) {
         $strplugincheck = get_string('plugincheck');
-        $navigation = build_navigation(array(array('name'=>$strplugincheck, 'link'=>null, 'type'=>'misc')));
-        print_header($strplugincheck, $strplugincheck, $navigation, '', '', false, '&nbsp;', '&nbsp;');
+        $PAGE->navbar->add($strplugincheck);
+        $PAGE->set_title($strplugincheck);
+        $PAGE->heading($strplugincheck);
+        $PAGE->set_cacheable(false);
+        echo $OUTPUT->header();
         echo $OUTPUT->heading($strplugincheck);
         echo $OUTPUT->box_start('generalbox', 'notice');
         print_string('pluginchecknotice');
index d0856d6f21469e746c9d1378ee5dd0bfdfd52983..e29ed1d6b965ee9a3e5665bc17966afdb0a77deb 100644 (file)
             $title = $strlanguage;
             break;
     }
-    $navlinks[] = array('name' => $strlanguage, 'link' => "$CFG->wwwroot/$CFG->admin/lang.php", 'type' => 'misc');
-    $navigation = build_navigation($navlinks);
 
     admin_externalpage_print_header();
 
index f6f691c8fde3de2c562229cf8409379d62ddee7c..ac3786f841af9073d4bf6187de52e515f275fb8b 100644 (file)
@@ -1,11 +1,13 @@
 <?php
-$navlinks = array();
-$navlinks[] = array('name' => $stradministration, 'link' => "$CFG->wwwroot/$CFG->admin/index.php", 'type' => 'misc');
-$navlinks[] = array('name' => get_string('mnetsettings', 'mnet'), 'link' => "$CFG->wwwroot/$CFG->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);
+$PAGE->navbar->add($stradministration, null, null, navigation_node::TYPE_CUSTOM, 
+                   new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/index.php'));
+$PAGE->navbar->add(get_string('mnetsettings', 'mnet'), null, null, navigation_node::TYPE_CUSTOM,
+                   new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/mnet/index.php'));
+$PAGE->navbar->add(get_string('deletehost', 'mnet'));
 
+$PAGE->set_title("$site->shortname: $strmnetsettings");
+$PAGE->set_heading($site->fullname);
+echo $OUTPUT->header();
 echo $OUTPUT->heading(get_string('mnetsettings', 'mnet'));
 ?>
 <div id="trustedhosts"><!-- See theme/standard/styles_layout.css #trustedhosts .generaltable for rules -->
index f47d0a9ffbd3c9a7e186969c73f1c66dab1a0661..a2e0f5b83ec262a96b7683868837adc7be074e8a 100644 (file)
     $strregistration = get_string("registration");
     $strregistrationinfo = get_string("registrationinfo");
 
-    $navlinks = array();
-    $navlinks[] = array('name' => $stradministration, 'link' => "../$CFG->admin/index.php", 'type' => 'misc');
-    $navlinks[] = array('name' => $strregistration, 'link' => null, 'type' => 'misc');
-    $navigation = build_navigation($navlinks);
-
     echo $OUTPUT->heading($strregistration);
 
     echo $OUTPUT->box($strregistrationinfo);
index ae035c8c21a3345e1e85db3f76aac821e5ccf079..201639a5d5daec7f9fb20d8f4b0c21265b0086f5 100755 (executable)
         $fullname = fullname($user, has_capability('moodle/site:viewfullnames', $context));
 
         /// course header
-        $navlinks = array();
+        $PAGE->set_title($title);
         if ($courseid != SITEID) {
             if (has_capability('moodle/course:viewparticipants', get_context_instance(CONTEXT_COURSE, $courseid))) {
-                $navlinks[] = array('name' => get_string('participants'), 'link' => "$CFG->wwwroot/user/index.php?id=$courseid", 'type' => 'misc');
+                $PAGE->navbar->add(get_string('participants'), null, null, navigation_node::TYPE_CUSTOM,
+                                   new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$courseid)));
             }
-            $navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$userid&amp;course=$courseid", 'type' => 'misc');
-            $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
-            $navigation = build_navigation($navlinks);
-
-            print_header($title, $fullname, $navigation, '', '', true, '&nbsp;', navmenu($course));
-
-        /// site header
+            $PAGE->set_heading($fullname);
         } else {
-            $navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$userid&amp;course=$courseid", 'type' => 'misc');
-            $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
-            $navigation = build_navigation($navlinks);
-            print_header($title, $course->fullname, $navigation, '', '', true, '&nbsp;', navmenu($course));
+            $PAGE->set_heading($course->fullname);
         }
+        $PAGE->navbar->add($fullname, null, null, navigation_node::TYPE_CUSTOM,
+                   new moodle_url("$CFG->wwwroot/user/view.php", array('id'=>$userid,'course'=>$courseid)));
+        $PAGE->navbar->add($straction);
+        echo $OUTPUT->header();
 
         $showroles = 1;
         $currenttab = 'assign';
index b0e3eacc9d9c7f9b6c5e7f3d3a0cca69feaac552..6041234112a6ce38ec452c79b5e35e30643c9b24 100755 (executable)
         $user = $DB->get_record('user', array('id' => $userid));
         $fullname = fullname($user, has_capability('moodle/site:viewfullnames', $context));
 
-        /// course header
-        $navlinks = array();
+        $PAGE->set_title($title);
         if ($courseid != SITEID) {
             if (has_capability('moodle/course:viewparticipants', get_context_instance(CONTEXT_COURSE, $courseid))) {
-                $navlinks[] = array('name' => get_string('participants'), 'link' => "$CFG->wwwroot/user/index.php?id=$courseid", 'type' => 'misc');
+                $PAGE->navbar->add(get_string('participants'), null, null, navigation_node::TYPE_CUSTOM,
+                                   new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$courseid)));
             }
-            $navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$userid&amp;course=$courseid", 'type' => 'misc');
-            $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
-            $navigation = build_navigation($navlinks);
-
-            print_header($title, $fullname, $navigation, '', '', true, '&nbsp;', navmenu($course));
-
-        /// site header
+            $PAGE->set_heading($fullname);
         } else {
-            $navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$userid&amp;course=$courseid", 'type' => 'misc');
-            $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
-            $navigation = build_navigation($navlinks);
-            print_header($title, $course->fullname, $navigation, "", "", true, "&nbsp;", navmenu($course));
+            $PAGE->set_heading($course->fullname);
         }
+        $PAGE->navbar->add($fullname, null, null, navigation_node::TYPE_CUSTOM,
+                   new moodle_url("$CFG->wwwroot/user/view.php", array('id'=>$userid,'course'=>$courseid)));
+        $PAGE->navbar->add($straction);
+        echo $OUTPUT->header();
 
         $showroles = 1;
         $currenttab = 'check';
index a573bceb0e5558cfe9b96d79b864d32bd91609ad..3278e8418c506510ed146edb1910071f39c6668c 100755 (executable)
         $user = $DB->get_record('user', array('id'=>$userid));
         $fullname = fullname($user, has_capability('moodle/site:viewfullnames', $context));
 
-        /// course header
-        $navlinks = array();
-        if ($course->id != SITEID) {
+        $PAGE->set_title($title);
+        if ($courseid != SITEID) {
             if (has_capability('moodle/course:viewparticipants', get_context_instance(CONTEXT_COURSE, $course->id))) {
-                $navlinks[] = array('name' => get_string('participants'), 'link' => "$CFG->wwwroot/user/index.php?id=$course->id", 'type' => 'misc');
+                $PAGE->navbar->add(get_string('participants'), null, null, navigation_node::TYPE_CUSTOM,
+                                   new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$course->id)));
             }
-            $navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$userid&amp;course=$courseid", 'type' => 'misc');
-            $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
-            $navigation = build_navigation($navlinks);
-            print_header($title, "$fullname", $navigation, "", "", true, "&nbsp;", navmenu($course));
-
-        /// site header
+            $PAGE->set_heading($fullname);
         } else {
-            $navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$userid&amp;course=$courseid", 'type' => 'misc');
-            $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
-            $navigation = build_navigation($navlinks);
-            print_header($title, $course->fullname, $navigation, "", "", true, "&nbsp;", navmenu($course));
+            $PAGE->set_heading($course->fullname);
         }
+        $PAGE->navbar->add($fullname, null, null, navigation_node::TYPE_CUSTOM,
+                   new moodle_url("$CFG->wwwroot/user/view.php", array('id'=>$userid,'course'=>$courseid)));
+        $PAGE->navbar->add($straction);
+        echo $OUTPUT->header();
+
         $showroles = 1;
         $currenttab = 'override';
         include_once($CFG->dirroot.'/user/tabs.php');
index 569dac303eec49a9e0f074c2083bb234f13ae12b..25b6853b75d18859f1e4de1f26bbead8ebe31e95 100755 (executable)
@@ -44,23 +44,23 @@ if (!isset($availablefilters)) {
     }
 }
 
-$navlinks = array();
 if ($currenttab != 'update') {
     switch ($context->contextlevel) {
 
         case CONTEXT_SYSTEM:
             $stradministration = get_string('administration');
-            $navlinks[] = array('name' => $stradministration, 'link' => '../index.php', 'type' => 'misc');
-            $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
-            $navigation = build_navigation($navlinks);
             if (empty($title)) {
                 $title = $SITE->fullname;
             }
-            print_header($title, "$SITE->fullname", $navigation);
+            $PAGE->navbar->add($stradministration, null, null, navigation_node::TYPE_SETTING, new moodle_url($CFG->wwwroot.'/admin/'));
+            $PAGE->navbar->add($straction);
+            $PAGE->set_title($title);
+            $PAGE->set_heading($SITE->fullname);
+            echo $OUTPUT->header();
             break;
 
         case CONTEXT_USER:
-            print_header();
+            echo $OUTPUT->header();
             break;
 
         case CONTEXT_COURSECAT:
@@ -69,18 +69,15 @@ if ($currenttab != 'update') {
             $strcategory = get_string("category");
             $strcourses = get_string("courses");
 
-            $navlinks[] = array('name' => $strcategories,
-                                'link' => "$CFG->wwwroot/course/index.php",
-                                'type' => 'misc');
-            $navlinks[] = array('name' => $category->name,
-                                'link' => "$CFG->wwwroot/course/category.php?id=$category->id",
-                                'type' => 'misc');
-            $navigation = build_navigation($navlinks);
-
             if (empty($title)) {
                 $title = "$SITE->shortname: $category->name";
             }
-            print_header($title, "$SITE->fullname: $strcourses", $navigation, "", "", true);
+            
+            $PAGE->navbar->add($strcategories, null, null, navigation_node::TYPE_SETTING, new moodle_url($CFG->wwwroot.'/course/index.php'));
+            $PAGE->navbar->add($category->name, null, null, navigation_node::TYPE_SETTING, new moodle_url($CFG->wwwroot.'/course/category.php', array('id'=>$category->id)));
+            $PAGE->set_title($title);
+            $PAGE->set_heading("$SITE->fullname: $strcourses");
+            echo $OUTPUT->header();
             break;
 
         case CONTEXT_COURSE:
@@ -88,14 +85,14 @@ if ($currenttab != 'update') {
                 $course = $DB->get_record('course', array('id'=>$context->instanceid));
 
                 require_login($course);
-                $navlinks[] = array('name' => get_string('roles'),
-                                    'link' => "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=$context->id",
-                                    'type' => 'misc');
-                $navigation = build_navigation($navlinks);
                 if (empty($title)) {
                     $title = get_string("editcoursesettings");
                 }
-                print_header($title, $course->fullname, $navigation);
+                $roleslink = new moodle_url("$CFG->wwwroot/$CFG->admin/roles/assign.php", array('contextid'=>$context->id));
+                $PAGE->navbar->add(get_string('roles'), null, null, navigation_node::TYPE_SETTING, $roleslink);
+                $PAGE->set_title($title);
+                $PAGE->set_heading($course->fullname);
+                echo $OUTPUT->header();
             }
             break;
 
@@ -108,12 +105,13 @@ if ($currenttab != 'update') {
             }
 
             require_login($course);
-            $navigation = build_navigation(get_string('roles'), $cm);
 
+            $PAGE->navigation->add(get_string('roles'));
+            
             if (empty($title)) {
                 $title = get_string("editinga", "moodle", $fullmodulename);
             }
-            print_header_simple($title, '', $navigation, '', '', false);
+            print_header_simple($title, '', '', '', '', false);
 
             break;
 
@@ -122,8 +120,6 @@ if ($currenttab != 'update') {
                 $blockname = print_context_name($context);
 
                 $parentcontext = get_context_instance_by_id($blockinstance->parentcontextid);
-                $navlinks[] = array('name' => $blockname, 'link' => null, 'type' => 'misc');
-                $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
                 switch ($parentcontext->contextlevel) {
                     case CONTEXT_SYSTEM:
                         break;
@@ -150,7 +146,11 @@ if ($currenttab != 'update') {
 
 
                 }
-                print_header("$straction: $blockname", $PAGE->course->fullname, build_navigation($navlinks));
+                $PAGE->navbar->add($blockname);
+                $PAGE->navbar->add($straction);
+                $PAGE->set_title("$straction: $blockname");
+                $PAGE->set_heading($PAGE->course->fullname);
+                echo $OUTPUT->header();
             }
             break;
 
index 292ed65cde16611fa804c85ca0b56e87e5211c0c..a94c591a6773ac312bb222d64edfc4fecd058487 100644 (file)
@@ -122,24 +122,20 @@ $straction = get_string('thisusersroles', 'role');
 $title = get_string('xroleassignments', 'role', $fullname);
 
 /// Course header
-$navlinks = array();
+$PAGE->set_title($title);
 if ($courseid != SITEID) {
+    $PAGE->set_heading($fullname);
     if (has_capability('moodle/course:viewparticipants', $coursecontext)) {
-        $navlinks[] = array('name' => get_string('participants'), 'link' => "$CFG->wwwroot/user/index.php?id=$courseid", 'type' => 'misc');
+        $PAGE->navbar->add(get_string('participants'), null, null, navigation_node::TYPE_CUSTOM,
+                           new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$courseid)));
     }
-    $navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$userid&amp;course=$courseid", 'type' => 'misc');
-    $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
-    $navigation = build_navigation($navlinks);
-
-    print_header($title, $fullname, $navigation, '', '', true, '&nbsp;', navmenu($course));
-
-/// Site header
 } else {
-    $navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$userid&amp;course=$courseid", 'type' => 'misc');
-    $navlinks[] = array('name' => $straction, 'link' => null, 'type' => 'misc');
-    $navigation = build_navigation($navlinks);
-    print_header($title, $course->fullname, $navigation, '', '', true, '&nbsp;', navmenu($course));
+    $PAGE->set_heading($course->fullname);
 }
+$PAGE->navbar->add($fullname, null, null, navigation_node::TYPE_CUSTOM,
+                   new moodle_url("$CFG->wwwroot/user/view.php", array('id'=>$userid,'course'=>$courseid)));
+$PAGE->navbar->add($straction);
+echo $OUTPUT->header();
 
 $showroles = 1;
 $currenttab = 'usersroles';
index 35a41d037d81d9028d838afa26a314ba938a3acb..62a76615f1a9bdd4ff855c248ca46320ca3c4b5e 100644 (file)
@@ -56,8 +56,12 @@ if ($PAGE->user_allowed_editing() && $adminediting != -1) {
 }
 
 /// print header stuff ------------------------------------------------------------
+$PAGE->set_focuscontrol($focus);
 if (empty($SITE->fullname)) {
-    print_header($settingspage->visiblename, $settingspage->visiblename, '', $focus);
+    $PAGE->set_title($settingspage->visiblename);
+    $PAGE->set_heading($settingspage->visiblename);
+    
+    echo $OUTPUT->header();
     echo $OUTPUT->box(get_string('configintrosite', 'admin'));
 
     if ($errormsg !== '') {
@@ -96,13 +100,11 @@ if (empty($SITE->fullname)) {
     }
 
     $visiblepathtosection = array_reverse($settingspage->visiblepath);
-    $navlinks = array();
-    foreach ($visiblepathtosection as $element) {
-        $navlinks[] = array('name' => $element, 'link' => null, 'type' => 'misc');
-    }
-    $navigation = build_navigation($navlinks);
 
-    print_header("$SITE->shortname: " . implode(": ",$visiblepathtosection), $SITE->fullname, $navigation, $focus, '', true, $buttons, '');
+    $PAGE->set_title("$SITE->shortname: " . implode(": ",$visiblepathtosection));
+    $PAGE->set_heading($SITE->fullname);
+    $PAGE->set_button($buttons);
+    echo $OUTPUT->header();
 
     if ($errormsg !== '') {
         echo $OUTPUT->notification($errormsg);
index 1be7c872dccb5d8a4c345647ba6dc0b21344ad21..576f4e0f52683338f97c4e585e818c31ca30fbe1 100644 (file)
     $strusers = get_string("users");
     $strall = get_string("all");
 
-    print_header($strtimezone, $strtimezone, build_navigation(array(array('name' => $strtimezone, 'link' => null, 'type' => 'misc'))));
-
+    $PAGE->set_title($strtimezone);
+    $PAGE->set_heading($strtimezone);
+    $PAGE->navbar->add($strtimezone);
+    echo $OUTPUT->header();
+    
     echo $OUTPUT->heading("");
 
     if (data_submitted() and !empty($zone) and confirm_sesskey()) {
index 1126346ada58ea2c2f1391c5f3b81e54038dd606..53650a0f618eda78c41fd7eeca6cba45ef295be2 100644 (file)
@@ -232,11 +232,11 @@ class edit_field_save extends XMLDBAction {
             $tempfield->setDefault($default);
         /// Prepare the output
             $site = get_site();
-            $navlinks = array();
-            $navlinks[] = array('name' => $this->str['administration'], 'link' => '../index.php', 'type' => 'misc');
-            $navlinks[] = array('name' => 'XMLDB', 'link' => 'index.php', 'type' => 'misc');
-            $navigation = build_navigation($navlinks);
-            print_header("$site->shortname: XMLDB", "$site->fullname", $navigation);
+            $PAGE->navbar->add($this->str['administration'], null, null. navigation_node::TYPE_CUSTOM, '../index.php');
+            $PAGE->navbar->add('XMLDB', null, null. navigation_node::TYPE_CUSTOM, 'index.php');
+            $PAGE->set_title("$site->shortname: XMLDB");
+            $PAGE->set_heading($site->fullname);
+            echo $OUTPUT->header();
             notice ('<p>' .implode(', ', $errors) . '</p>
                      <p>' . $tempfield->readableInfo() . '</p>',
                     'index.php?action=edit_field&amp;field=' .$field->getName() . '&amp;table=' . $table->getName()
index 1ed4db46a2d3677c15f3fb3abb4b3fe8b7f08d47..d72ca9b0edc050c63e847f1e102932af382c4f3f 100644 (file)
@@ -164,11 +164,11 @@ class edit_index_save extends XMLDBAction {
             $tempindex->setFields($fieldsarr);
         /// Prepare the output
             $site = get_site();
-            $navlinks = array();
-            $navlinks[] = array('name' => $this->str['administration'], 'link' => '../index.php', 'type' => 'misc');
-            $navlinks[] = array('name' => 'XMLDB', 'link' => 'index.php', 'type' => 'misc');
-            $navigation = build_navigation($navlinks);
-            print_header("$site->shortname: XMLDB", "$site->fullname", $navigation);
+            $PAGE->navbar->add($this->str['administration'], null, null. navigation_node::TYPE_CUSTOM, '../index.php');
+            $PAGE->navbar->add('XMLDB', null, null. navigation_node::TYPE_CUSTOM, 'index.php');
+            $PAGE->set_title("$site->shortname: XMLDB");
+            $PAGE->set_heading($site->fullname);
+            echo $OUTPUT->header();
             notice ('<p>' .implode(', ', $errors) . '</p>
                      <p>' . $tempindex->readableInfo() . '</p>',
                     'index.php?action=edit_index&amp;index=' .$index->getName() . '&amp;table=' . $table->getName() . '&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)));
index 0b59aedc792ee180031d12e238756fe1c28c7cf7..eb011fb41070058bf9267d4d6e807ca8720bf79a 100644 (file)
@@ -240,11 +240,11 @@ class edit_key_save extends XMLDBAction {
             }
         /// Prepare the output
             $site = get_site();
-            $navlinks = array();
-            $navlinks[] = array('name' => $this->str['administration'], 'link' => '../index.php', 'type' => 'misc');
-            $navlinks[] = array('name' => 'XMLDB', 'link' => 'index.php', 'type' => 'misc');
-            $navigation = build_navigation($navlinks);
-            print_header("$site->shortname: XMLDB", "$site->fullname", $navigation);
+            $PAGE->navbar->add($this->str['administration'], null, null. navigation_node::TYPE_CUSTOM, '../index.php');
+            $PAGE->navbar->add('XMLDB', null, null. navigation_node::TYPE_CUSTOM, 'index.php');
+            $PAGE->set_title("$site->shortname: XMLDB");
+            $PAGE->set_heading($site->fullname);
+            echo $OUTPUT->header();
 
             notice ('<p>' .implode(', ', $errors) . '</p>
                      <p>' . $tempkey->readableInfo() . '</p>',
index a08c68e0a3ff21a9c7c0caff85e7876035c79a98..4fa2fcaecd2915b2bfa41c56439c8c690ca3a533 100644 (file)
@@ -120,11 +120,11 @@ class edit_sentence_save extends XMLDBAction {
         if (!empty($errors)) {
         /// Prepare the output
             $site = get_site();
-            $navlinks = array();
-            $navlinks[] = array('name' => $this->str['administration'], 'link' => '../index.php', 'type' => 'misc');
-            $navlinks[] = array('name' => 'XMLDB', 'link' => 'index.php', 'type' => 'misc');
-            $navigation = build_navigation($navlinks);
-            print_header("$site->shortname: XMLDB", "$site->fullname", $navigation);
+            $PAGE->navbar->add($this->str['administration'], null, null. navigation_node::TYPE_CUSTOM, '../index.php');
+            $PAGE->navbar->add('XMLDB', null, null. navigation_node::TYPE_CUSTOM, 'index.php');
+            $PAGE->set_title("$site->shortname: XMLDB");
+            $PAGE->set_heading($site->fullname);
+            echo $OUTPUT->header();
             notice ('<p>' .implode(', ', $errors) . '</p>
                      <p>' . s($sentence) . '</p>',
                     'index.php?action=edit_sentence&amp;sentence=' .$sentenceparam . '&amp;statement=' . urlencode($statementparam) . '&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)));
index f86710d9d8d1b92819ec125e098c48351d2a8362..283abcdb37b3874190cc23415516769ca000d2a6 100644 (file)
@@ -103,13 +103,14 @@ class edit_table_save extends XMLDBAction {
 
         if (!empty($errors)) {
             $temptable = new xmldb_table($name);
-                                                                                                                                      /// Prepare the output
+            /// Prepare the output
             $site = get_site();
-            $navlinks = array();
-            $navlinks[] = array('name' => $this->str['administration'], 'link' => '../index.php', 'type' => 'misc');
-            $navlinks[] = array('name' => 'XMLDB', 'link' => 'index.php', 'type' => 'misc');
-            $navigation = build_navigation($navlinks);
-            print_header("$site->shortname: XMLDB", "$site->fullname", $navigation);
+            $PAGE->navbar->add($this->str['administration'], null, null. navigation_node::TYPE_CUSTOM, '../index.php');
+            $PAGE->navbar->add('XMLDB', null, null. navigation_node::TYPE_CUSTOM, 'index.php');
+            $PAGE->set_title("$site->shortname: XMLDB");
+            $PAGE->set_heading($site->fullname);
+            echo $OUTPUT->header();
+
             notice ('<p>' .implode(', ', $errors) . '</p>
                      <p>' . $temptable->readableInfo() . '</p>',
                      'index.php?action=edit_table&amp;table=' . $tableparam . '&amp;dir=' . urlencode(str_replace($CFG->dirroot, '', $dirpath)));