Skip to content

Commit

Permalink
group MDL-19798 Updated print_header and build_navigation to OUTPUT a…
Browse files Browse the repository at this point in the history
…nd PAGE equivalents
  • Loading branch information
samhemelryk committed Sep 7, 2009
1 parent 2458610 commit b87573d
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 51 deletions.
16 changes: 9 additions & 7 deletions group/assign.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@

$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">
Expand Down
13 changes: 7 additions & 6 deletions group/autogroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@
$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 = '';

Expand Down Expand Up @@ -231,8 +226,14 @@
}
}

$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 != '') {
Expand Down
4 changes: 3 additions & 1 deletion group/delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@
$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) {
Expand Down
17 changes: 9 additions & 8 deletions group/group.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@

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');
Expand Down Expand Up @@ -103,15 +105,14 @@
$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);
Expand Down
17 changes: 9 additions & 8 deletions group/grouping.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@

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');
Expand Down Expand Up @@ -99,15 +101,14 @@
$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();
Expand Down
9 changes: 5 additions & 4 deletions group/groupings.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@
$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';
Expand Down
10 changes: 6 additions & 4 deletions group/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,14 @@
$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');
Expand Down
16 changes: 9 additions & 7 deletions group/members.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,17 @@

$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();
?>

Expand Down
12 changes: 6 additions & 6 deletions group/overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@
$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');
Expand Down

0 comments on commit b87573d

Please sign in to comment.