]> git.mjollnir.org Git - moodle.git/commitdiff
course MDL-19794 Upgraded print_header and build_navigation calls to use PAGE and...
authorsamhemelryk <samhemelryk>
Thu, 3 Sep 2009 08:47:24 +0000 (08:47 +0000)
committersamhemelryk <samhemelryk>
Thu, 3 Sep 2009 08:47:24 +0000 (08:47 +0000)
25 files changed:
course/category.php
course/delete.php
course/edit.php
course/enrol.php
course/import.php
course/import/activities/index.php
course/import/groups/index.php
course/importstudents.php
course/index.php
course/info.php
course/recent.php
course/report.php
course/report/log/index.php
course/report/log/indexlive.php
course/report/outline/index.php
course/report/participation/index.php
course/report/progress/index.php
course/report/stats/index.php
course/request.php
course/reset.php
course/scales.php
course/search.php
course/unenrol.php
course/user.php
course/view.php

index a738f6a1b201ea319a5d836940d3b7a66936088e..5ca6cfa47fea3ad5e647008e9e20899e26123e61 100644 (file)
         admin_externalpage_setup('coursemgmt', '', $urlparams, $CFG->wwwroot . '/course/category.php');
         $PAGE->set_context($context);   // Ensure that we are actually showing blocks etc for the cat context
         admin_externalpage_print_header();
-    } else {
-        $navbaritem = print_course_search('', true, 'navbar');
-        print_header("$site->shortname: $category->name", "$site->fullname: $strcourses", array(), '', '', true, $navbaritem);
+    } else {        
+        $PAGE->set_title("$site->shortname: $category->name");
+        $PAGE->set_heading("$site->fullname: $strcourses");
+        $PAGE->set_button(print_course_search('', true, 'navbar'));
+        echo $OUTPUT->header();
     }
 
 /// Print link to roles
index b513b144c95644ef79d41593ac2bb9711798da81..251a70dcc0b303054027d328058bd3901e21feb3 100644 (file)
     }
 
     $category = $DB->get_record("course_categories", array("id"=>$course->category));
-    $navlinks = array();
 
+    $PAGE->navbar->add($stradministration, null, null, navigation_node::TYPE_CUSTOM,
+                       new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/index.php/'));
+    $PAGE->navbar->add($strcategories, null, null, navigation_node::TYPE_CUSTOM,
+                       new moodle_url($CFG->wwwroot.'/course/index.php'));
+    $PAGE->navbar->add($category->name, null, null, navigation_node::TYPE_CUSTOM,
+                       new moodle_url($CFG->wwwroot.'/course/category.php', array('id'=>$course->category)));
     if (! $delete) {
         $strdeletecheck = get_string("deletecheck", "", $course->shortname);
         $strdeletecoursecheck = get_string("deletecoursecheck");
 
-        $navlinks[] = array('name' => $stradministration, 'link' => "../$CFG->admin/index.php", 'type' => 'misc');
-        $navlinks[] = array('name' => $strcategories, 'link' => "index.php", 'type' => 'misc');
-        $navlinks[] = array('name' => $category->name, 'link' => "category.php?id=$course->category", 'type' => 'misc');
-        $navlinks[] = array('name' => $strdeletecheck, 'link' => null, 'type' => 'misc');
-        $navigation = build_navigation($navlinks);
-
-        print_header("$site->shortname: $strdeletecheck", $site->fullname, $navigation);
+        $PAGE->navbar->add($strdeletecheck);
+        $PAGE->set_title("$site->shortname: $strdeletecheck");
+        $PAGE->set_heading($site->fullname);
+        echo $OUTPUT->header();
 
         $message = "$strdeletecoursecheck<br /><br />" . format_string($course->fullname) .  " (" . format_string($course->shortname) . ")";
         echo $OUTPUT->confirm($message, "delete.php?id=$course->id&delete=".md5($course->timemodified), "category.php?id=$course->category");
 
     $strdeletingcourse = get_string("deletingcourse", "", format_string($course->shortname));
 
-    $navlinks[] = array('name' => $stradministration, 'link' => "../$CFG->admin/index.php", 'type' => 'misc');
-    $navlinks[] = array('name' => $strcategories, 'link' => "index.php", 'type' => 'misc');
-    $navlinks[] = array('name' => $category->name, 'link' => "category.php?id=$course->category", 'type' => 'misc');
-    $navlinks[] = array('name' => $strdeletingcourse, 'link' => null, 'type' => 'misc');
-    $navigation = build_navigation($navlinks);
-
-    print_header("$site->shortname: $strdeletingcourse", $site->fullname, $navigation);
-
+    $PAGE->navbar->add($strdeletingcourse);
+    $PAGE->set_title("$site->shortname: $strdeletingcourse");
+    $PAGE->set_heading($site->fullname);
+    echo $OUTPUT->header();
     echo $OUTPUT->heading($strdeletingcourse);
 
     delete_course($course);
index dcd04cff8c270a0d78724415510df7473462b729..7ba97e88c6e81b67d59ee2e8150bd78ff4c2d09e 100644 (file)
     $straddnewcourse = get_string("addnewcourse");
     $stradministration = get_string("administration");
     $strcategories = get_string("categories");
-    $navlinks = array();
 
     if (!empty($course)) {
-        $navlinks[] = array('name' => $streditcoursesettings,
-                            'link' => null,
-                            'type' => 'misc');
+        $PAGE->navbar->add($streditcoursesettings);
         $title = $streditcoursesettings;
         $fullname = $course->fullname;
     } else {
-        $navlinks[] = array('name' => $stradministration,
-                            'link' => "$CFG->wwwroot/$CFG->admin/index.php",
-                            'type' => 'misc');
-        $navlinks[] = array('name' => $strcategories,
-                            'link' => 'index.php',
-                            'type' => 'misc');
-        $navlinks[] = array('name' => $straddnewcourse,
-                            'link' => null,
-                            'type' => 'misc');
+        $PAGE->navbar->add($stradministration, null, null, navigation_node::TYPE_CUSTOM,
+                           new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/index.php'));
+        $PAGE->navbar->add($strcategories, null, null, navigation_node::TYPE_CUSTOM,
+                           new moodle_url($CFG->wwwroot.'/course/index.php'));
+        $PAGE->navbar->add($straddnewcourse);
         $title = "$site->shortname: $straddnewcourse";
         $fullname = $site->fullname;
     }
 
-    $navigation = build_navigation($navlinks);
-    print_header($title, $fullname, $navigation, $editform->focus());
+    $PAGE->set_title($title);
+    $PAGE->set_heading($fullname);
+    $PAGE->set_focuscontrol($editform->focus());
+    echo $OUTPUT->header();
     echo $OUTPUT->heading($streditcoursesettings);
 
     $editform->display();
index 76b95bd4dbac687613e2bcfb3a501e1d2b5e3f97..6dc1414b6d42c67d475966dba45cff7828014f40 100644 (file)
@@ -67,7 +67,7 @@
             foreach ($roles as $role) {
                 if ($role->timestart and ($role->timestart >= time())) {
                     $message = get_string('enrolmentnotyet', '', userdate($student->timestart));
-                    print_header();
+                    echo $OUTPUT->header();
                     notice($message, "$CFG->wwwroot/index.php");
                 }
             }
             ($course->enrollable == 2 && $course->enrolstartdate > 0 && $course->enrolstartdate > time()) ||
             ($course->enrollable == 2 && $course->enrolenddate > 0 && $course->enrolenddate <= time())
             ) {
-        print_header($course->shortname, $course->fullname, build_navigation(array(array('name'=>$course->shortname,'link'=>'','type'=>'misc'))) );
+        $PAGE->set_title($course->shortname);
+        $PAGE->set_heading($course->fullname);
+        $PAGE->navbar->add($course->shortname);
+        echo $OUTPUT->header();
         notice(get_string('notenrollable'), "$CFG->wwwroot/index.php");
     }
 
index 76c6312340098b273deb337dd81985dc156b2a1f..c5aba8e3b42a125f1f16c41e381f871262243510 100644 (file)
     }
 
     $strimport = get_string('import');
-    $navlinks = array();
-    $navlinks[] = array('name' => $strimport, 'link' => null, 'type' => 'misc');
-    $navigation = build_navigation($navlinks);
 
-    print_header($course->fullname.': '.$strimport, $course->fullname.': '.$strimport, $navigation);
+    $PAGE->set_title($course->fullname.': '.$strimport);
+    $PAGE->set_heading($course->fullname.': '.$strimport);
+    $PAGE->navbar->add($strimport);
+
+    echo $OUTPUT->header();
 
     $imports = get_plugin_list('import');
 
index df33fff667ba5c4746e6d765053b3eb362ff199d..fda7e13808fe5d0e7d878b05b8af65b77cf0e4ce 100644 (file)
         }
     }
 
-    $navlinks = array();
-    $navlinks[] = array('name' => $course->shortname,
-                        'link' => "$CFG->wwwroot/course/view.php?id=$course->id",
-                        'type' => 'misc');
-    $navlinks[] = array('name' => get_string('import'),
-                        'link' => "$CFG->wwwroot/course/import.php?id=$course->id",
-                        'type' => 'misc');
-    $navlinks[] = array('name' => $strimportactivities, 'link' => null, 'type' => 'misc');
-    $navigation = build_navigation($navlinks);
+    $PAGE->navbar->add($course->shortname, null, null, navigation_node::TYPE_CUSTOM,
+                       new moodle_url($CFG->wwwroot.'/course/view.php', array('id'=>$course->id)));
+    $PAGE->navbar->add(get_string('import'), null, null, navigation_node::TYPE_CUSTOM,
+                       new moodle_url($CFG->wwwroot.'/course/import.php', array('id'=>$course->id)));
+    $PAGE->navbar->add($strimportactivities);
+
+    $PAGE->set_title("$course->shortname: $strimportactivities");
+    $PAGE->set_heading($course->fullname);
+    echo $OUTPUT->header();
 
-    print_header("$course->shortname: $strimportactivities", $course->fullname, $navigation);
     require_once('mod.php');
 
     echo $OUTPUT->footer();
index 478e12f4fc69e242687d3256a27c433c6bf42518..c3020c69e55d2c768d56171b2908a9f2ddcc1605 100755 (executable)
     }
 
 /// Print the header
-    $navlinks = array();
-    $navlinks[] = array('name' => $course->shortname,
-                        'link' => "$CFG->wwwroot/course/view.php?id=$course->id",
-                        'type' => 'misc');
-    $navlinks[] = array('name' => get_string('import'),
-                        'link' => "$CFG->wwwroot/course/import.php?id=$course->id",
-                        'type' => 'misc');
-    $navlinks[] = array('name' => $strimportgroups, 'link' => null, 'type' => 'misc');
-    $navigation = build_navigation($navlinks);
-
-    print_header("$course->shortname: $strimportgroups", $course->fullname, $navigation);
+    $PAGE->navbar->add($course->shortname, null, null, navigation_node::TYPE_CUSTOM,
+                       new moodle_url($CFG->wwwroot.'/course/view.php', array('id'=>$course->id)));
+    $PAGE->navbar->add(get_string('import'), null, null, navigation_node::TYPE_CUSTOM,
+                       new moodle_url($CFG->wwwroot.'/course/import.php', array('id'=>$course->id)));
+    $PAGE->navbar->add($strimportgroups);
+
+    $PAGE->set_title("$course->shortname: $strimportgroups");
+    $PAGE->set_heading($course->fullname);
+    echo $OUTPUT->header();
 
 /// If a file has been uploaded, then process it
 
index 9ac1efd2c840fe9c837b055cc2b87cc894ec5f05..473050e7fbf9751546dbb32a2220a0985e78b5c0 100644 (file)
     $strcourses   = get_string("courses");
     $strshowall = get_string("showall");
 
-    print_header("$course->shortname: $strassigncourses",
-                 $site->fullname,
-                 build_navigation(array(array('name' => $strassigncourses, 'link' => null, 'type' => 'misc'))), "searchtext");
-
+    $PAGE->navbar->add($strassigncourses);
+    $PAGE->set_title("$course->shortname: $strassigncourses");
+    $PAGE->set_heading($site->fullname);
+    $PAGE->set_focuscontrol("searchtext");
+    echo $OUTPUT->header();
 
 /// Print a help notice about the need to use this page
 
index e98d1b2536c8d86a2c6a26c14fcc767593e99e19..4de3d612b95bbfa8b50ee86f07d5319b4bc6169a 100644 (file)
             $strcourses = get_string('courses');
             $strcategories = get_string('categories');
 
-            $navlinks = array();
-            $navlinks[] = array('name'=>$strcategories,'link'=>'','type'=>'misc');
-            $navigation = build_navigation($navlinks);
-            print_header("$site->shortname: $strcategories", $strcourses, $navigation, '', '', true, update_category_button());
+            $PAGE->navbar->add($strcategories);
+            $PAGE->set_title("$site->shortname: $strcategories");
+            $PAGE->set_heading($strcourses);
+            $PAGE->set_button(update_category_button());
+            echo $OUTPUT->header();
             echo $OUTPUT->heading($strcategories);
             echo skip_main_destination();
             echo $OUTPUT->box_start('categorybox');
             echo $OUTPUT->box_end();
             print_course_search();
         } else {
-            $strfulllistofcourses = get_string('fulllistofcourses');
-            print_header("$site->shortname: $strfulllistofcourses", $strfulllistofcourses,
-                    build_navigation(array(array('name'=>$strfulllistofcourses, 'link'=>'','type'=>'misc'))),
-                         '', '', true, update_category_button());
+            $PAGE->navbar->add($strfulllistofcourses);
+            $PAGE->set_title("$site->shortname: $strfulllistofcourses");
+            $PAGE->set_heading($strfulllistofcourses);
+            $PAGE->set_button(update_category_button());
+            echo $OUTPUT->header();
             echo skip_main_destination();
             echo $OUTPUT->box_start('courseboxes');
             print_courses(0);
index abc74cd77bdeb39463b8c37471221241dc12146f..e450a1e116747d2a19e7c4e05f508ea6b2c9e57e 100644 (file)
@@ -33,8 +33,8 @@
         print_error('coursehidden', '', $CFG->wwwroot .'/');
     }
 
-    print_header(get_string("summaryof", "", $course->fullname));
-
+    $PAGE->set_title(get_string("summaryof", "", $course->fullname));
+    echo $OUTPUT->header();
     echo $OUTPUT->heading(format_string($course->fullname) . '<br />(' . format_string($course->shortname) . ')');
 
     if ($course->guest || $course->password) {
index ced879bf65264d3696eace561527c874ab884a6a..97bcaea53128e76f1494dfc4acffa686acb27e90 100644 (file)
@@ -18,8 +18,6 @@
 
     $context = get_context_instance(CONTEXT_COURSE, $course->id);
 
-    $meta = '<meta name="robots" content="none" />'; // prevent duplicate content in search engines MDL-7299
-
     $lastlogin = time() - COURSE_MAX_RECENT_PERIOD;
     if (!isguestuser() and !empty($USER->lastcourseaccess[$COURSE->id])) {
         if ($USER->lastcourseaccess[$COURSE->id] > $lastlogin) {
     }
 
     $strrecentactivity = get_string('recentactivity');
-    $navlinks = array();
-    $navlinks[] = array('name' => $strrecentactivity, 'link' => "recent.php?id=$course->id", 'type' => 'misc');
-    $navlinks[] = array('name' => $userinfo, 'link' => null, 'type' => 'misc');
-    $navigation = build_navigation($navlinks);
-    print_header("$course->shortname: $strrecentactivity", $course->fullname, $navigation, '', $meta);
+    $PAGE->navbar->add($strrecentactivity, null, null, navigation_node::TYPE_CUSTOM,
+                       new moodle_url($CFG->wwwroot.'/course/recent.php', array('id'=>$course->id)));
+    $PAGE->navbar->add($userinfo);
+    $PAGE->set_title("$course->shortname: $strrecentactivity");
+    $PAGE->set_heading($course->fullname);
+    echo $OUTPUT->header();
     echo $OUTPUT->heading(format_string($course->fullname) . ": $userinfo", 3);
 
     $mform->display();
index 753a91265c2272498596a2e08271282be342ef0f..951ae588e20ffe05133ca2cea0cc8c1331147db6 100644 (file)
 
     $strreports = get_string('reports');
 
-    $navlinks = array();
-    $navlinks[] = array('name' => $strreports, 'link' => null, 'type' => 'misc');
-    $navigation = build_navigation($navlinks);
-    print_header($course->fullname.': '.$strreports, $course->fullname.': '.$strreports, $navigation);
+    $PAGE->navbar->add($strreports);
+    $PAGE->set_title($course->fullname.': '.$strreports);
+    $PAGE->set_heading($course->fullname.': '.$strreports);
+    echo $OUTPUT->header();
 
     $reports = get_plugin_list('coursereport');
 
index 9b5c2839bbf385157f38547b8a546a356f6b1ad3..008e7ea003beb580b1dc71d76a765874eff687a4 100644 (file)
                     admin_externalpage_print_header();
 
                 } else {
-                    $navlinks[] = array('name' => $strreports, 'link' => "$CFG->wwwroot/course/report.php?id=$course->id", 'type' => 'misc');
-                    $navlinks[] = array('name' => $strlogs, 'link' => "index.php?id=$course->id", 'type' => 'misc');
-                    $navlinks[] = array('name' => "$userinfo, $dateinfo", 'link' => null, 'type' => 'misc');
-                    $navigation = build_navigation($navlinks);
-                    print_header($course->shortname .': '. $strlogs, $course->fullname, $navigation);
+                    $PAGE->set_title($course->shortname .': '. $strlogs);
+                    $PAGE->set_heading($course->fullname);
+                    $PAGE->navbar->add($strreports, null, null, navigation_node::TYPE_CUSTOM,
+                                       new moodle_url($CFG->wwwroot.'/course/report.php', array('id'=>$course->id)));
+                    $PAGE->navbar->add($strlogs, null, null, navigation_node::TYPE_CUSTOM,
+                                       new moodle_url($CFG->wwwroot.'/course/index.php', array('id'=>$course->id)));
+                    $PAGE->navbar->add("$userinfo, $dateinfo");
+                    echo $OUTPUT->header();
                 }
 
                 echo $OUTPUT->heading(format_string($course->fullname) . ": $userinfo, $dateinfo (".usertimezone().")");
                     admin_externalpage_setup('reportlog');
                     admin_externalpage_print_header();
         } else {
-            $navlinks[] = array('name' => $strreports, 'link' => "$CFG->wwwroot/course/report.php?id=$course->id", 'type' => 'misc');
-            $navlinks[] = array('name' => $strlogs, 'link' => null, 'type' => 'misc');
-            $navigation = build_navigation($navlinks);
-            print_header($course->shortname .': '. $strlogs, $course->fullname, $navigation, '');
+            $PAGE->set_title($course->shortname .': '. $strlogs);
+            $PAGE->set_heading($course->fullname);
+            $PAGE->navbar->add($strreports, null, null, navigation_node::TYPE_CUSTOM,
+                               new moodle_url($CFG->wwwroot.'/course/report.php', array('id'=>$course->id)));
+            $PAGE->navbar->add($strlogs);
+            echo $OUTPUT->header();
         }
 
         echo $OUTPUT->heading(get_string('chooselogs') .':');
index 30d07175b9a1ffd03102d9c35a15bdbac05c3002..0fcedd9fee49ad54b162241eb6eaacba60133316 100644 (file)
         admin_externalpage_print_header();
 
     } else {
-        $navlinks = array();
-        $navlinks[] = array('name' => $strreports, 'link' => "$CFG->wwwroot/course/report.php?id=$course->id", 'type' => 'misc');
-        $navlinks[] = array('name' => $strlogs, 'link' => null, 'type' => 'misc');
-        $navigation = build_navigation($navlinks);
-        print_header($course->shortname .': '. $strlogs, $course->fullname, $navigation, '');
+        $PAGE->set_title($course->shortname .': '. $strlogs);
+        $PAGE->set_heading($course->fullname);
+        $PAGE->navbar->add($strreports, null, null, navigation_node::TYPE_CUSTOM,
+                           new moodle_url($CFG->wwwroot.'/course/report.php', array('id'=>$course->id)));
+        $PAGE->navbar->add($strlogs);
+        echo $OUTPUT->header();
     }
 
     echo $OUTPUT->heading(get_string('loglive', 'coursereport_log'));
index 1da10bd94cb6d8fa3df62910503aee2691f2a889..a56c3ca398ef406f391a5019612f91de72f6f4e4 100644 (file)
     $strreports        = get_string('reports');
     $strviews          = get_string('views');
 
-    $navlinks = array();
-    $navlinks[] = array('name' => $strreports, 'link' => "../../report.php?id=$course->id", 'type' => 'misc');
-    $navlinks[] = array('name' => $stractivityreport, 'link' => null, 'type' => 'misc');
-    $navigation = build_navigation($navlinks);
-
-    print_header("$course->shortname: $stractivityreport", $course->fullname, $navigation);
-
+    $PAGE->set_title($course->shortname .': '. $stractivityreport);
+    $PAGE->set_heading($course->fullname);
+    $PAGE->navbar->add($strreports, null, null, navigation_node::TYPE_CUSTOM,
+                       new moodle_url($CFG->wwwroot.'/course/report.php', array('id'=>$course->id)));
+    $PAGE->navbar->add($stractivityreport);
+    echo $OUTPUT->header();
     echo $OUTPUT->heading(format_string($course->fullname));
 
     if (!$logstart = $DB->get_field_sql("SELECT MIN(time) FROM {log}")) {
index b01ffbc37d8a19da53514c4b618e8f75b2853043..970cf4554504606e5c930e1fb277c958486215a4 100644 (file)
         $action = '';
     }
 
-    $navlinks = array();
-    $navlinks[] = array('name' => $strreports, 'link' => "../../report.php?id=$course->id", 'type' => 'misc');
-    $navlinks[] = array('name' => $strparticipation, 'link' => null, 'type' => 'misc');
-    $navigation = build_navigation($navlinks);
-    print_header("$course->shortname: $strparticipation", $course->fullname, $navigation);
+    $PAGE->set_title($course->shortname .': '. $strparticipation);
+    $PAGE->set_heading($course->fullname);
+    $PAGE->navbar->add($strreports, null, null, navigation_node::TYPE_CUSTOM,
+                       new moodle_url($CFG->wwwroot.'/course/report.php', array('id'=>$course->id)));
+    $PAGE->navbar->add($strparticipation);
+    echo $OUTPUT->header();
 
     $modinfo = get_fast_modinfo($course);
 
index 42e0ed649d00f76ffab3e39945b9a51308188bb1..0bca1fd6294251fae915a3738cb4d0e17068bdf4 100644 (file)
@@ -83,10 +83,14 @@ if($csv) {
     // Navigation and header
     $strreports = get_string("reports");
     $strcompletion = get_string('completionreport','completion');
-    $navlinks = array();
-    $navlinks[] = array('name' => $strreports, 'link' => "../../report.php?id=$course->id", 'type' => 'misc');
-    $navlinks[] = array('name' => $strcompletion, 'link' => null, 'type' => 'misc');
-    print_header($strcompletion,$course->fullname,build_navigation($navlinks));
+
+    $PAGE->set_title($strcompletion);
+    $PAGE->set_heading($course->fullname);
+    $PAGE->navbar->add($strreports, null, null, navigation_node::TYPE_CUSTOM,
+                       new moodle_url($CFG->wwwroot.'/course/report.php', array('id'=>$course->id)));
+    $PAGE->navbar->add($strcompletion);
+    echo $OUTPUT->header();
+
     if($svgcleverness) {
         $PAGE->requires->yui_lib('event');
         $PAGE->requires->js('course/report/progress/textrotate.js');
index d74f878db8679284dbeb937a221c2be17bdae5c8..48c66dd4643cc0803e14893a762cf1acb72aa231 100644 (file)
         $strreports = get_string("reports");
         $strstats = get_string('stats');
 
-        $menu = report_stats_mode_menu($course, $mode, $time, "$CFG->wwwroot/course/report/stats/index.php");
-
-        $navlinks = array();
-        $navlinks[] = array('name' => $strreports, 'link' => "../../report.php?id=$course->id", 'type' => 'misc');
-        $navlinks[] = array('name' => $strstats, 'link' => null, 'type' => 'misc');
-        $navigation = build_navigation($navlinks);
-
-        print_header("$course->shortname: $strstats", $course->fullname, $navigation, '', '', true, '&nbsp;', $menu);
+        $PAGE->set_title("$course->shortname: $strstats");
+        $PAGE->set_heading($course->fullname);
+        $PAGE->set_headingmenu();
+        $PAGE->navbar->add($strreports, null, null, navigation_node::TYPE_CUSTOM,
+                           new moodle_url($CFG->wwwroot.'/course/report.php', array('id'=>$course->id)));
+        $PAGE->navbar->add($strstats);
+        echo $OUTPUT->header(report_stats_mode_menu($course, $mode, $time, "$CFG->wwwroot/course/report/stats/index.php"));
     }
 
     require($CFG->dirroot.'/course/report/stats/report.php');
index 74577c14263451d11ec33877f040a5c5c645749b..3e9b69659b530b1c2d3829354e1e0a833f95536a 100644 (file)
         redirect($returnurl);
 
     } else if ($data = $requestform->get_data()) {
-        print_header($strtitle, $strtitle, build_navigation($strtitle), $requestform->focus());
+        $PAGE->set_title($strtitle);
+        $PAGE->set_heading($strtitle);
+        $PAGE->navbar->add($strtitle);
+        $PAGE->set_focuscontrol($requestform->focus());
+        echo $OUTPUT->header();
         echo $OUTPUT->heading($strtitle);
 
     /// Record the request.
     }
 
 /// Show the request form.
-    print_header($strtitle, $strtitle, build_navigation($strtitle), $requestform->focus());
+
+    $PAGE->set_title($strtitle);
+    $PAGE->set_heading($strtitle);
+    $PAGE->navbar->add($strtitle);
+    $PAGE->set_focuscontrol($requestform->focus());
+    echo $OUTPUT->header();
     echo $OUTPUT->heading($strtitle);
     $requestform->display();
     echo $OUTPUT->footer();
index 15b68184dc30a880a9cba92506f1e1c949c8cfac..8de087423d728e752db0d7d8f4f0ead1804d8015 100755 (executable)
@@ -24,8 +24,9 @@ $strreset       = get_string('reset');
 $strresetcourse = get_string('resetcourse');
 $strremove      = get_string('remove');
 
-$navlinks = array(array('name' => $strresetcourse, 'link' => null, 'type' => 'misc'));
-$navigation = build_navigation($navlinks);
+$PAGE->navbar->add($strresetcourse);
+$PAGE->set_title($course->fullname.': '.$strresetcourse);
+$PAGE->set_heading($course->fullname.': '.$strresetcourse);
 
 $mform = new course_reset_form();
 
@@ -44,7 +45,7 @@ if ($mform->is_cancelled()) {
         $mform = new course_reset_form();
 
     } else {
-        print_header($course->fullname.': '.$strresetcourse, $course->fullname.': '.$strresetcourse, $navigation);
+        echo $OUTPUT->header();
         echo $OUTPUT->heading($strresetcourse);
 
         $data->reset_start_date_old = $course->startdate;
@@ -73,7 +74,7 @@ if ($mform->is_cancelled()) {
     }
 }
 
-print_header($course->fullname.': '.$strresetcourse, $course->fullname.': '.$strresetcourse, $navigation);
+echo $OUTPUT->header();
 echo $OUTPUT->heading($strresetcourse);
 
 echo $OUTPUT->box(get_string('resetinfo'));
index 8c44d7daf6fbd07d1135d889087bbc65883416ea..11d3968f5e80759895ffab0fda9a5031eb85da05 100644 (file)
@@ -26,7 +26,8 @@
     $strhelptext = get_string("helptext");
     $stractivities = get_string("activities");
 
-    print_header($strscales);
+    $PAGE->set_title($strscales);
+    echo $OUTPUT->header();
 
     if ($scaleid) {
         if ($scale = $DB->get_record("scale", array('id'=>$scaleid))) {
index 0cc7ddb1eb9e04ccd6aa86e6b10b8068ca650f80..8442064abf31d4d70f7acdd420e3a47f4ec61c6d 100644 (file)
     $strnovalidcourses = get_string('novalidcourses');
 
     if (empty($search) and empty($blocklist) and empty($modulelist)) {
-        $navlinks = array();
-        $navlinks[] = array('name' => $strcourses, 'link' => "index.php", 'type' => 'misc');
-        $navlinks[] = array('name' => $strsearch, 'link' => null, 'type' => 'misc');
-        $navigation = build_navigation($navlinks);
+        $PAGE->navbar->add($strcourses, null, null, navigation_node::TYPE_CUSTOM, new moodle_url($CFG->wwwroot.'/course/index.php'));
+        $PAGE->navbar->add($strsearch);
+        $PAGE->set_title("$site->fullname : $strsearch");
+        $PAGE->set_heading($site->fullname);
 
-        print_header("$site->fullname : $strsearch", $site->fullname, $navigation, "", "");
+        echo $OUTPUT->header();
         echo $OUTPUT->box_start();
         echo "<center>";
         echo "<br />";
         }
     }
 
-    $navlinks = array();
-    $navlinks[] = array('name' => $strcourses, 'link' => 'index.php', 'type' => 'misc');
-    $navlinks[] = array('name' => $strsearch, 'link' => 'search.php', 'type' => 'misc');
+    $PAGE->navbar->add($strcourses, null, null, navigation_node::TYPE_CUSTOM, new moodle_url($CFG->wwwroot.'/course/index.php'));
+    $PAGE->navbar->add($strsearch, null, null, navigation_node::TYPE_CUSTOM, new moodle_url($CFG->wwwroot.'/course/search.php'));
     if (!empty($search)) {
-        $navlinks[] = array('name' => "'".s($search)."'", 'link' => null, 'type' => 'misc');
+        $PAGE->navbar->add(s($search));
     }
-    $navigation = build_navigation($navlinks);
+    $PAGE->set_title("$site->fullname : $strsearchresults");
+    $PAGE->set_heading($site->fullname);
+    $PAGE->set_button($searchform);
 
-    print_header("$site->fullname : $strsearchresults", $site->fullname, $navigation, "", "", "", $searchform);
+    echo $OUTPUT->header();
 
     $lastcategory = -1;
     if ($courses) {
index cd1070fa181c0aac226131028392f4a4bd60e8e2..92b23eadec34233f3e304543e28944a159f94460 100644 (file)
 
 
     $strunenrol = get_string('unenrol');
-    $navlinks = array();
-    $navlinks[] = array('name' => $strunenrol, 'link' => null, 'type' => 'misc');
-    $navigation = build_navigation($navlinks);
-
-    print_header("$course->shortname: $strunenrol", $course->fullname, $navigation);
-
+    $PAGE->navbar->add($strunenrol);
+    $PAGE->set_title("$course->shortname: $strunenrol");
+    $PAGE->set_heading($course->fullname);
+    echo $OUTPUT->header();
     if ($userid) {
         if (!$user = $DB->get_record('user', array('id'=>$userid))) {
             print_error('nousers');
index 2f3e8e3103389e09d97bc738f756f18154ac4721..127727b7fe5abc9e35e9777db22accc804325a54 100644 (file)
@@ -32,7 +32,7 @@
     }
 
     if ($user->deleted) {
-        print_header();
+        echo $OUTPUT->header();
         echo $OUTPUT->heading(get_string('userdeleted'));
         echo $OUTPUT->footer();
         die;
     $strmode           = get_string($mode);
     $fullname          = fullname($user, true);
 
-    $navlinks = array();
-
+    $link = null;
     if ($course->id != SITEID && has_capability('moodle/course:viewparticipants', $coursecontext)) {
-        $navlinks[] = array('name' => $strparticipants, 'link' => "../user/index.php?id=$course->id", 'type' => 'misc');
+        $link = new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$course->id));
     }
-
-    $navlinks[] = array('name' => $fullname, 'link' => "../user/view.php?id=$user->id&amp;course=$course->id", 'type' => 'misc');
-    $navlinks[] = array('name' => $stractivityreport, 'link' => null, 'type' => 'misc');
-    $navlinks[] = array('name' => $strmode, 'link' => null, 'type' => 'misc');
-    $navigation = build_navigation($navlinks);
-
-    print_header("$course->shortname: $stractivityreport ($mode)", $course->fullname, $navigation);
-
+    $PAGE->navbar->add($strparticipants, null, null, navigation_node::TYPE_CUSTOM, $link);
+    $PAGE->navbar->add($fullname, null, null, navigation_node::TYPE_CUSTOM,
+                       new moodle_url($CFG->wwwroot.'/user/view.php', array('id'=>$user->id, 'course'=>$course->id)));
+    $PAGE->navbar->add($stractivityreport);
+    $PAGE->navbar->add($strmode);
+    $PAGE->set_title("$course->shortname: $stractivityreport ($mode)");
+    $PAGE->set_heading($course->fullname);
+    echo $OUTPUT->header();
 
 /// Print tabs at top
 /// This same call is made in:
index a17f966a08f93efdd451265a42ad208a482043c7..c8f3d5cae5744456c4431d7be79938c63047ba5d 100644 (file)
     }
 
     $title = get_string('course') . ': ' . $course->fullname;
-    $navigation = build_navigation(array());
-    print_header($title, $course->fullname, $navigation, '', '', true,
-                 $buttons, user_login_string($course, $USER), false, $bodytags);
+
+    $PAGE->set_title($title);
+    $PAGE->set_heading($course->fullname);
+    $PAGE->set_button($buttons);
+    $PAGE->set_headingmenu(user_login_string($course, $USER));
+    echo $OUTPUT->header();
 
     if ($completion->is_enabled() && ajaxenabled()) {
         // This value tracks whether there has been a dynamic change to the page.