]> git.mjollnir.org Git - moodle.git/commitdiff
notes MDL-19806 Updated print_header and build_navigation to OUTPUT and PAGE equivalents
authorsamhemelryk <samhemelryk>
Mon, 7 Sep 2009 05:43:15 +0000 (05:43 +0000)
committersamhemelryk <samhemelryk>
Mon, 7 Sep 2009 05:43:15 +0000 (05:43 +0000)
mod/data/comment.php
mod/data/edit.php
mod/data/export.php
mod/data/field/latlong/kml.php
mod/data/import.php
mod/data/index.php
mod/data/lib.php
mod/data/report.php
mod/data/templates.php
mod/data/view.php

index 1d65c6d2cfc9a17384cf86acb355f878673a6099..151204394fbabac2255be65b824725abff2d9c14 100755 (executable)
                 redirect('view.php?rid='.$record->id.'&amp;page='.$page, get_string('commentdeleted', 'data'));
 
             } else {    //print confirm delete form
-                print_header();
+                echo $OUTPUT->header();
                 data_print_comment($data, $comment, $page);
 
                 echo $OUTPUT->confirm(get_string('deletecomment','data'),
 
     }
 
-    print_header();
+    echo $OUTPUT->header();
     data_print_comments($data, $record, $page, $mform);
     echo $OUTPUT->footer();
 
index 21b4fa6d060774e653f6eee9db4190fd60c03157..51b8a329b84642669ba75ebb5d69c5b57818a9ef 100755 (executable)
@@ -68,8 +68,8 @@
     if (empty($cm->visible) and !has_capability('moodle/course:viewhiddenactivities', $context)) {
         $strdatabases = get_string("modulenameplural", "data");
 
-        $navigation = build_navigation('', $cm);
-        print_header_simple(format_string($data->name), "", $navigation, "", "", true, '', navmenu($course, $cm));
+        $PAGE->set_title(format_string($data->name));
+        echo $OUTPUT->header();
         notice(get_string("activityiscurrentlyhidden"));
     }
 
 /// Print the page header
     $strdata = get_string('modulenameplural','data');
 
-    $navigation = build_navigation('', $cm);
-    print_header_simple($data->name, '', $navigation,
-                        '', '', true, update_module_button($cm->id, $course->id, get_string('modulename', 'data')),
-                        navmenu($course, $cm), '', '');
+    $PAGE->set_title($data->name);
+    $PAGE->set_button(update_module_button($cm->id, $course->id, get_string('modulename', 'data')));
+    echo $OUTPUT->header();
 
 /// Check to see if groups are being used here
     groups_print_activity_menu($cm, 'edit.php?d='.$data->id);
index 915b2821adf85ebe74f328d614f35288784cd3bf..2242aef2f459c2c20b54af18dbc14e2acc5d427b 100644 (file)
@@ -55,10 +55,9 @@ if($mform->is_cancelled()) {
     redirect('view.php?d='.$data->id);
 } elseif (!$formdata = (array) $mform->get_data()) {
     // build header to match the rest of the UI
-    $nav = build_navigation('', $cm);
-    print_header_simple($data->name, '', $nav,
-        '', '', true, update_module_button($cm->id, $course->id, get_string('modulename', 'data')),
-        navmenu($course, $cm), '', '');
+    $PAGE->set_title($data->name);
+    $PAGE->set_button(update_module_button($cm->id, $course->id, get_string('modulename', 'data')));
+    echo $OUTPUT->header();
     echo $OUTPUT->heading(format_string($data->name));
 
     // these are for the tab display
index 690d8dc652f803f6c83022fa5b190fbd4a36e901..fa451ac41b9fa9ecd0bab54dcfee6b149491746f 100644 (file)
@@ -57,9 +57,8 @@ require_course_login($course, true, $cm);
 
 /// If it's hidden then it's don't show anything.  :)
 if (empty($cm->visible) and !has_capability('moodle/course:viewhiddenactivities',get_context_instance(CONTEXT_MODULE, $cm->id))) {
-    $navigation = build_navigation('', $cm);
-    print_header_simple(format_string($data->name), "", $navigation,
-        "", "", true, '', navmenu($course, $cm));
+    $PAGE->set_title($data->name);
+    echo $OUTPUT->header();
     notice(get_string("activityiscurrentlyhidden"));
 }
 
index 878d565a2d8aa053516714ff888b9e745efec43b..6aad72b4a3fdb635c94339dad53ec40bc306de39 100755 (executable)
@@ -65,8 +65,8 @@
 /// Print the page header
     $strdata = get_string('modulenameplural','data');
     
-    $navigation = build_navigation('', $cm);
-    print_header_simple($data->name, "", $navigation, "", "", true, "", navmenu($course));
+    $PAGE->set_title($data->name);
+    echo $OUTPUT->header();
     echo $OUTPUT->heading(format_string($data->name));
 
 /// Groups needed for Add entry tab
index 12c4b8ae824fa3cfe53bb233f1d00db497d20518..9f1497e88112d7d90a896623422edc8263ac1e5a 100755 (executable)
     $strdata = get_string('modulename','data');
     $strdataplural  = get_string('modulenameplural','data');
 
-    $navlinks = array();
-    $navlinks[] = array('name' => $strdata, 'link' => "index.php?id=$course->id", 'type' => 'activity');
-    $navigation = build_navigation($navlinks);
-
-    print_header_simple($strdata, '', $navigation, '', '', true, "", navmenu($course));
+    $PAGE->navbar->add($strdata, new moodle_url($CFG->wwwroot.'/mod/data/index.php', array('id'=>$course->id)));
+    $PAGE->set_title($strdata);
+    echo $OUTPUT->header();
 
     if (! $datas = get_all_instances_in_course("data", $course)) {
         notice(get_string('thereareno', 'moodle',$strdataplural) , "$CFG->wwwroot/course/view.php?id=$course->id");
index e1da11585199f6030d6007b6a69b470dbe3e403b..2ebe924f25744f3c3ad766effc90d1818b91d8dc 100755 (executable)
@@ -2051,13 +2051,11 @@ function data_get_available_presets($context) {
  */
 function data_print_header($course, $cm, $data, $currenttab='') {
 
-    global $CFG, $displaynoticegood, $displaynoticebad, $OUTPUT;
-
-    $navigation = build_navigation('', $cm);
-    print_header_simple($data->name, '', $navigation,
-            '', '', true, update_module_button($cm->id, $course->id, get_string('modulename', 'data')),
-            navmenu($course, $cm));
+    global $CFG, $displaynoticegood, $displaynoticebad, $OUTPUT, $PAGE;
 
+    $PAGE->set_title($data->name);
+    $PAGE->set_button(update_module_button($cm->id, $course->id, get_string('modulename', 'data')));
+    echo $OUTPUT->header();
     echo $OUTPUT->heading(format_string($data->name));
 
 // Groups needed for Add entry tab
index 8ff382b4a639bf7bbee66bf55c0f7e64daf6ed17..6a181e008ebf25c054b40bbe939c68b04b3a0d28 100755 (executable)
@@ -47,7 +47,8 @@
     $strrating  = get_string('rating', 'data');
     $strname    = get_string('name');
 
-    print_header($strratings);
+    $PAGE->set_title($strratings);
+    echo $OUTPUT->header();
 
     if (!$ratings = data_get_ratings($record->id, $sqlsort)) {
         print_error('noratingforrecord', 'data');
index c4f0d8d1e59c89a7a324305659e315ed88d4cedc..1c252bbf48b7a086277b216803aac0e01fc3d804 100755 (executable)
     $bodytag .= '" ';
 
     $PAGE->requires->js('mod/data/data.js');
-    $navigation = build_navigation('', $cm);
-    print_header_simple($data->name, '', $navigation,
-                        '', '', true, update_module_button($cm->id, $course->id, get_string('modulename', 'data')),
-                        navmenu($course, $cm), '', $bodytag);
-
+    $PAGE->set_title($data->name);
+    $PAGE->set_button(update_module_button($cm->id, $course->id, get_string('modulename', 'data')));
+    echo $OUTPUT->header();
     echo $OUTPUT->heading(format_string($data->name));
 
 
index 09dbdfb20dd92e87b42060517a194d22542eccd4..2d8c0325142e878de793e4733512b3fb6422fecd 100755 (executable)
     }
     $buttons .= '</tr></table>';
 
-    $navigation = build_navigation(array(), $cm);
-    print_header($title, $course->fullname, $navigation, '', '', true, $buttons, navmenu($course, $cm));
-
+    $PAGE->set_title($title);
+    $PAGE->set_heading($course->fullname);
+    $PAGE->set_button($buttons);
+    echo $OUTPUT->header();
+    
 /// Check to see if groups are being used here
     $returnurl = 'view.php?d='.$data->id.'&amp;search='.s($search).'&amp;sort='.s($sort).'&amp;order='.s($order).'&amp;';
     groups_print_activity_menu($cm, $returnurl);