]> git.mjollnir.org Git - moodle.git/commitdiff
course MDL-19794 Updated print_header_simple and build_navigation to OUTPUT and PAGE...
authorsamhemelryk <samhemelryk>
Tue, 8 Sep 2009 01:33:56 +0000 (01:33 +0000)
committersamhemelryk <samhemelryk>
Tue, 8 Sep 2009 01:33:56 +0000 (01:33 +0000)
course/editsection.php
course/enrol.php
course/loginas.php
course/mod.php
course/modedit.php
course/resources.php

index 50c0bb86329d11d5f9c43b0f9bdd835971131e8d..f3c32a65f609f9c6d78516b1af2e9be8e0739d14 100644 (file)
         $strsummaryof = get_string('summaryof', '', " $sectionname $section->section");
     }
 
-    print_header_simple($stredit, '', build_navigation(array(array('name' => $stredit, 'link' => null, 'type' => 'misc'))), 'theform.summary' );
-
+    $PAGE->set_title($stredit);
+    $PAGE->navbar->add($stredit);
+    $PAGE->set_focuscontrol('theform.summary');
+    echo $OUTPUT->header();
     print_heading_with_help($strsummaryof, 'summaries');
     $mform->display();
     echo $OUTPUT->footer();
index 6dc1414b6d42c67d475966dba45cff7828014f40..24ce7fe9cfa4557aacfb0cd0edc77e70a89d1ec9 100644 (file)
 
 /// Check if the course is a meta course  (bug 5734)
     if ($course->metacourse) {
-        print_header_simple();
+        echo $OUTPUT->header();
         notice(get_string('coursenotaccessible'), "$CFG->wwwroot/index.php");
     }
 
 /// Users can't enroll to site course
     if ($course->id == SITEID) {
-        print_header_simple();
+        echo $OUTPUT->header();
         notice(get_string('enrollfirst'), "$CFG->wwwroot/index.php");
     }
 
@@ -76,7 +76,7 @@
 
 /// Check if the course is enrollable
     if (!method_exists($enrol, 'print_entry')) {
-        print_header_simple();
+        echo $OUTPUT->header();
         notice(get_string('enrolmentnointernal'), "$CFG->wwwroot/index.php");
     }
 
index 5404f5bca645a09268f392db498471f104f40439..eb1263dad8b062d6463c1e14d033053627e06157 100644 (file)
@@ -69,8 +69,9 @@
     $strloginas    = get_string('loginas');
     $strloggedinas = get_string('loggedinas', '', $newfullname);
 
-    print_header_simple($strloggedinas, '', build_navigation(array(array('name'=>$strloggedinas, 'link'=>'','type'=>'misc'))),
-            '', '', true, '&nbsp;', navmenu($course));
+    $PAGE->set_title($strloggedinas);
+    $PAGE->navbar->add($strloggedinas);
+    echo $OUTPUT->header();
     notice($strloggedinas, "$CFG->wwwroot/course/view.php?id=$course->id");
 
 
index 5a4c73a6579bdfc89085e9d317e4e340ba637d80..a47e704e5c7d246e17bdca3d11d96615b6c6df75 100644 (file)
@@ -64,8 +64,9 @@
             $strdeletecheckfull = get_string('deletecheckfull', '', "$fullmodulename '$cm->name'");
 
             $PAGE->set_pagetype('mod-' . $cm->modname . '-delete');
-
-            print_header_simple($strdeletecheck, '', build_navigation(array(array('name'=>$strdeletecheck, 'link'=>'', 'type'=>'misc'))));
+            $PAGE->set_title($strdeletecheck);
+            $PAGE->navbar->add($strdeletecheck);
+            echo $OUTPUT->header();
 
             // print_simple_box_start('center', '60%', '#FFAAAA', 20, 'noticebox');
             echo $OUTPUT->box_start('noticebox');
index edc42c2899ae211a0d809c8dcf9a2b54917f4538..72df5fc58f671e179170c878673e7c7e37066da8 100644 (file)
         $streditinga = get_string('editinga', 'moodle', $fullmodulename);
         $strmodulenameplural = get_string('modulenameplural', $module->name);
 
-        $navlinks = array();
-        $navlinks[] = array('name' => $strmodulenameplural, 'link' => "$CFG->wwwroot/mod/$module->name/index.php?id=$course->id", 'type' => 'activity');
+        $PAGE->navbar->add($strmodulenameplural, new moodle_url($CFG->wwwroot.'/mod/'.$module->name.'/index.php', array('id'=>$course->id)));
         if ($navlinksinstancename) {
-            $navlinks[] = $navlinksinstancename;
+            $PAGE->navbar->add($navlinksinstancename);
         }
-        $navlinks[] = array('name' => $streditinga, 'link' => '', 'type' => 'title');
-
-        $navigation = build_navigation($navlinks);
-
-        print_header_simple($streditinga, '', $navigation, $mform->focus(), "", false);
+        $PAGE->navbar->add($streditinga);
+        $PAGE->set_title($streditinga);
+        $PAGE->set_focuscontrol($mform->focus());
+        $PAGE->set_cacheable(false);
+        echo $OUTPUT->header();
 
         if (!empty($cm->id)) {
             $context = get_context_instance(CONTEXT_MODULE, $cm->id);
index 4c64b44fab09516d826778fd243e9ed70579a2fd..e1fb68a0fca3e2024e670aa15c207725ca6f44c0 100644 (file)
@@ -61,8 +61,8 @@ $strlastmodified = get_string('lastmodified');
 $PAGE->set_url('course/resources.php', array('id' => $course->id));
 $PAGE->set_title($course->shortname.': '.$strresources);
 $PAGE->set_heading($course->fullname);
-$navlinks = array(array('name' => $strresources, 'link' => '', 'type' => 'activityinstance'));
-echo $OUTPUT->header(build_navigation($navlinks), navmenu($course));
+$PAGE->navbar->add($strresources);
+echo $OUTPUT->header();
 
 $modinfo = get_fast_modinfo($course);
 $cms = array();