]> git.mjollnir.org Git - moodle.git/commitdiff
group MDL-19798 Updated print_header and build_navigation to OUTPUT and PAGE equivalents
authorsamhemelryk <samhemelryk>
Mon, 7 Sep 2009 06:43:02 +0000 (06:43 +0000)
committersamhemelryk <samhemelryk>
Mon, 7 Sep 2009 06:43:02 +0000 (06:43 +0000)
group/assign.php
group/autogroup.php
group/delete.php
group/group.php
group/grouping.php
group/groupings.php
group/index.php
group/members.php
group/overview.php

index 4f4869a1cc73c1fcc651c657ab3d28014934a470..422d5bc0897d93703cd0bb71c1b09bd819afa77a 100644 (file)
@@ -94,13 +94,15 @@ $straddgroupstogroupings = get_string('addgroupstogroupings', 'group');
 
 $groupingname = format_string($grouping->name);
 
-$navlinks = array();
-$navlinks[] = array('name' => $strparticipants, 'link' => "$CFG->wwwroot/user/index.php?id=$courseid", 'type' => 'misc');
-$navlinks[] = array('name' => $strgroups, 'link' => "$CFG->wwwroot/group/index.php?id=$courseid", 'type' => 'misc');
-$navlinks[] = array('name' => $straddgroupstogroupings, 'link' => null, 'type' => 'misc');
-$navigation = build_navigation($navlinks);
-
-print_header("$course->shortname: $strgroups", $course->fullname, $navigation, '', '', true, '', user_login_string($course, $USER));
+$PAGE->navbar->add($strparticipants, new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$courseid)));
+$PAGE->navbar->add($strgroups, new moodle_url($CFG->wwwroot.'/group/index.php', array('id'=>$courseid)));
+$PAGE->navbar->add($straddgroupstogroupings);
+
+/// Print header
+$PAGE->set_title("$course->shortname: $strgroups");
+$PAGE->set_heading($course->fullname);
+$PAGE->set_headingmenu(user_login_string($course, $USER));
+echo $OUTPUT->header();
 
 ?>
 <div id="addmembersform">
index b937baf518720208a866c70c471e9ea2a89b473f..bf7a67fe73441aa1b89b3fae41fb9efff690d24d 100644 (file)
@@ -37,11 +37,6 @@ $strparticipants     = get_string('participants');
 $strautocreategroups = get_string('autocreategroups', 'group');
 
 // Print the page and form
-$navlinks = array(array('name'=>$strparticipants, 'link'=>$CFG->wwwroot.'/user/index.php?id='.$courseid, 'type'=>'misc'),
-                  array('name' => $strgroups, 'link' => "$CFG->wwwroot/group/index.php?id=$courseid", 'type' => 'misc'),
-                  array('name' => $strautocreategroups, 'link' => null, 'type' => 'misc'));
-$navigation = build_navigation($navlinks);
-
 $preview = '';
 $error = '';
 
@@ -231,8 +226,14 @@ if ($editform->is_cancelled()) {
     }
 }
 
+$PAGE->navbar->add($strparticipants, new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$courseid)));
+$PAGE->navbar->add($strgroups, new moodle_url($CFG->wwwroot.'/group/index.php', array('id'=>$courseid)));
+$PAGE->navbar->add($strautocreategroups);
+
 /// Print header
-print_header_simple($strgroups, ': '.$strgroups, $navigation, '', '', true, '', navmenu($course));
+$PAGE->set_title($strgroups);
+$PAGE->set_heading(': '.$strgroups);
+echo $OUTPUT->header();
 echo $OUTPUT->heading($strautocreategroups);
 
 if ($error != '') {
index c7868d671d0431d4888db8190faf80fb6a5fcc3c..2b089fe817bffbfb20c068a57b7fa5e494e07d18 100644 (file)
@@ -54,7 +54,9 @@ if ($confirm && data_submitted()) {
     $DB->commit_sql();
     redirect($returnurl);
 } else {
-    print_header(get_string('deleteselectedgroup', 'group'), get_string('deleteselectedgroup', 'group'));
+    $PAGE->set_title(get_string('deleteselectedgroup', 'group'));
+    $PAGE->set_heading(get_string('deleteselectedgroup', 'group'));
+    echo $OUTPUT->header();
     $optionsyes = array('courseid'=>$courseid, 'groups'=>$groupids, 'sesskey'=>sesskey(), 'confirm'=>1);
     $optionsno = array('id'=>$courseid);
     if(count($groupnames)==1) {
index df9cfeadfe106a801924f7a8b12de4e747e65994..0c34712c81511ab692585e8f704de3a70f63818b 100644 (file)
@@ -57,7 +57,9 @@ $returnurl = $CFG->wwwroot.'/group/index.php?id='.$course->id.'&amp;group='.$id;
 
 if ($id and $delete) {
     if (!$confirm) {
-        print_header(get_string('deleteselectedgroup', 'group'), get_string('deleteselectedgroup', 'group'));
+        $PAGE->set_title(get_string('deleteselectedgroup', 'group'));
+        $PAGE->set_heading(get_string('deleteselectedgroup', 'group'));
+        echo $OUTPUT->header();
         $optionsyes = array('id'=>$id, 'delete'=>1, 'courseid'=>$courseid, 'sesskey'=>sesskey(), 'confirm'=>1);
         $optionsno  = array('id'=>$courseid);
         $formcontinue = html_form::make_button('group.php', $optionsyes, get_string('yes'), 'get');
@@ -103,15 +105,14 @@ if ($id) {
     $strheading = get_string('creategroup', 'group');
 }
 
-
-$navlinks = array(array('name'=>$strparticipants, 'link'=>$CFG->wwwroot.'/user/index.php?id='.$courseid, 'type'=>'misc'),
-                  array('name'=>$strgroups, 'link'=>$CFG->wwwroot.'/group/index.php?id='.$courseid, 'type'=>'misc'),
-                  array('name'=>$strheading, 'link'=>'', 'type'=>'misc'));
-$navigation = build_navigation($navlinks);
+$PAGE->navbar->add($strparticipants, new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$courseid)));
+$PAGE->navbar->add($strgroups, new moodle_url($CFG->wwwroot.'/group/index.php', array('id'=>$courseid)));
+$PAGE->navbar->add($strheading);
 
 /// Print header
-print_header_simple($strgroups, ': '.$strgroups, $navigation, '', '', true, '', navmenu($course));
-
+$PAGE->set_title($strgroups);
+$PAGE->set_heading(': '.$strgroups);
+echo $OUTPUT->header();
 echo '<div id="grouppicture">';
 if ($id) {
     print_group_picture($group, $course->id);
index 61b2ff97b02aee3c53051f34e185f882b94a3442..efd64d48855f497ac40e5e164d32156a96e0e3ca 100644 (file)
@@ -51,7 +51,9 @@ $returnurl = $CFG->wwwroot.'/group/groupings.php?id='.$course->id;
 
 if ($id and $delete) {
     if (!$confirm) {
-        print_header(get_string('deletegrouping', 'group'), get_string('deletegrouping', 'group'));
+        $PAGE->set_title(get_string('deletegrouping', 'group'));
+        $PAGE->set_heading(get_string('deletegrouping', 'group'));
+        echo $OUTPUT->header();
         $optionsyes = array('id'=>$id, 'delete'=>1, 'courseid'=>$courseid, 'sesskey'=>sesskey(), 'confirm'=>1);
         $optionsno  = array('id'=>$courseid);
         $formcontinue = html_form::make_button('grouping.php', $optionsyes, get_string('yes'), 'get');
@@ -99,15 +101,14 @@ if ($id) {
     $strheading = get_string('creategrouping', 'group');
 }
 
-$navlinks = array(array('name'=>$strparticipants, 'link'=>$CFG->wwwroot.'/user/index.php?id='.$courseid, 'type'=>'misc'),
-                  array('name'=>$strgroupings, 'link'=>$CFG->wwwroot.'/group/groupings.php?id='.$courseid, 'type'=>'misc'),
-                  array('name'=>$strheading, 'link'=>'', 'type'=>'misc'));
-$navigation = build_navigation($navlinks);
+$PAGE->navbar->add($strparticipants, new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$courseid)));
+$PAGE->navbar->add($strgroups, new moodle_url($CFG->wwwroot.'/group/groupings.php', array('id'=>$courseid)));
+$PAGE->navbar->add($strheading);
 
 /// Print header
-print_header_simple($strgroupings, ': '.$strgroupings, $navigation, '', '', true, '', navmenu($course));
-
-
+$PAGE->set_title($strgroupings);
+$PAGE->set_heading(': '.$strgroupings);
+echo $OUTPUT->header();
 echo $OUTPUT->heading($strheading);
 $editform->display();
 echo $OUTPUT->footer();
index a6619d71014fa628c9fd2a8dc4eb2a0aee86689e..f0679136810bcd3ab3920cb5bce02f5a00b8156a 100644 (file)
@@ -26,12 +26,13 @@ $struses         = get_string('activities');
 $strparticipants = get_string('participants');
 $strmanagegrping = get_String('showgroupsingrouping', 'group');
 
-$navlinks = array(array('name'=>$strparticipants, 'link'=>$CFG->wwwroot.'/user/index.php?id='.$courseid, 'type'=>'misc'),
-                  array('name'=>$strgroupings, 'link'=>'', 'type'=>'misc'));
-$navigation = build_navigation($navlinks);
+$PAGE->navbar->add($strparticipants, new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$courseid)));
+$PAGE->navbar->add($strgroupings);
 
 /// Print header
-print_header_simple($strgroupings, ': '.$strgroupings, $navigation, '', '', true, '', navmenu($course));
+$PAGE->set_title($strgroupings);
+$PAGE->set_heading(': '.$strgroupings);
+echo $OUTPUT->header();
 
 // Add tabs
 $currenttab = 'groupings';
index 60b351da731f426e7a13a4d7798dfac9fb41dc56..cacdf3534cf5b50cffb5ab70790d2cf0e5745f76 100644 (file)
@@ -124,12 +124,14 @@ switch ($action) {
 $strgroups = get_string('groups');
 $strparticipants = get_string('participants');
 
-$navlinks = array(array('name'=>$strparticipants, 'link'=>$CFG->wwwroot.'/user/index.php?id='.$courseid, 'type'=>'misc'),
-                  array('name'=>$strgroups, 'link'=>'', 'type'=>'misc'));
-$navigation = build_navigation($navlinks);
+$PAGE->navbar->add($strparticipants, new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$courseid)));
+$PAGE->navbar->add($strgroups);
 
 /// Print header
-print_header_simple($strgroups, ': '.$strgroups, $navigation, '', '', true, '', navmenu($course));
+$PAGE->set_title($strgroups);
+$PAGE->set_heading(': '.$strgroups);
+echo $OUTPUT->header();
+
 // Add tabs
 $currenttab = 'groups';
 require('tabs.php');
index 18d607a58fd0d3ed97af94840edbbee98c0e0121..d6d362f6e520bb535f4448bc302d1b92fa58e08f 100644 (file)
@@ -75,15 +75,17 @@ $strusergroupmembership = get_string('usergroupmembership', 'group');
 
 $groupname = format_string($group->name);
 
-$navlinks = array();
-$navlinks[] = array('name' => $strparticipants, 'link' => "$CFG->wwwroot/user/index.php?id=$courseid", 'type' => 'misc');
-$navlinks[] = array('name' => $strgroups, 'link' => "$CFG->wwwroot/group/index.php?id=$courseid", 'type' => 'misc');
-$navlinks[] = array('name' => $stradduserstogroup, 'link' => null, 'type' => 'misc');
-$navigation = build_navigation($navlinks);
-
 $PAGE->requires->js('group/clientlib.js');
 $PAGE->requires->js_function_call('init_add_remove_members_page');
-print_header("$course->shortname: $strgroups", $course->fullname, $navigation, '', '', true, '', user_login_string($course, $USER));
+$PAGE->navbar->add($strparticipants, new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$courseid)));
+$PAGE->navbar->add($strgroups, new moodle_url($CFG->wwwroot.'/group/index.php', array('id'=>$courseid)));
+$PAGE->navbar->add($stradduserstogroup);
+
+/// Print header
+$PAGE->set_title("$course->shortname: $strgroups");
+$PAGE->set_heading($course->fullname);
+$PAGE->set_headingmenu(user_login_string($course, $USER));
+echo $OUTPUT->header();
 check_theme_arrows();
 ?>
 
index 53b7b4ec377de11ffc841e91ed424c3dae1f9db9..c1f3db3847a80592656250f494bfb7435a7fd65f 100644 (file)
@@ -106,14 +106,14 @@ if ($rs = $DB->get_recordset_sql($sql, $params)) {
     $rs->close();
 }
 
-
-// Print the page and form
-$navlinks = array(array('name'=>$strparticipants, 'link'=>$CFG->wwwroot.'/user/index.php?id='.$courseid, 'type'=>'misc'),
-                  array('name'=>$strgroups, 'link'=>'', 'type'=>'misc'));
-$navigation = build_navigation($navlinks);
+$PAGE->navbar->add($strparticipants, new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$courseid)));
+$PAGE->navbar->add($strgroups);
 
 /// Print header
-print_header_simple($strgroups, ': '.$strgroups, $navigation, '', '', true, '', navmenu($course));
+$PAGE->set_title($strgroups);
+$PAGE->set_heading(': '.$strgroups);
+echo $OUTPUT->header();
+
 // Add tabs
 $currenttab = 'overview';
 require('tabs.php');