enrol MDL-19795 Upgraded print_header and build_navigation calls to OUTPUT/PAGE equivilants

This commit is contained in:
samhemelryk 2009-09-04 06:29:26 +00:00
parent 15ca5e5e0d
commit 01d082fa17
7 changed files with 52 additions and 49 deletions

View file

@ -29,8 +29,7 @@ class enrolment_plugin_authorize
*/
public function print_entry($course)
{
global $CFG, $USER, $OUTPUT;
global $form;
global $CFG, $USER, $OUTPUT, $PAGE, $form;
$zerocost = zero_cost($course);
if ($zerocost) {
@ -58,12 +57,11 @@ class enrolment_plugin_authorize
$strcourses = get_string('courses');
$strloginto = get_string('loginto', '', $course->shortname);
$navlinks = array();
$navlinks[] = array('name' => $strcourses, 'link' => "$CFG->wwwroot/course/", 'type' => 'misc');
$navlinks[] = array('name' => $strloginto, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header($strloginto, $course->fullname, $navigation);
$PAGE->navbar->add($strcourses, new moodle_url($CFG->wwwroot.'/course/'));
$PAGE->navbar->add($strloginto);
$PAGE->set_title($strloginto);
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
print_course($course, '80%');
if ($course->password) {

View file

@ -77,13 +77,15 @@ function authorize_print_orders($courseid, $userid) {
$popupmenu .= $OUTPUT->checkbox($checkbox, 'showonlymy');
}
$navlinks = array();
if (SITEID != $courseid) {
$navlinks[] = array('name' => $course->shortname, 'link' => "$CFG->wwwroot/course/view.php?id=".$course->id, 'type' => 'misc');
$PAGE->navbar->add($course->shortname, new moodle_url($CFG->wwwroot.'/course/view.php', array('id'=>$course->id)));
}
$navlinks[] = array('name' => $authstrs->paymentmanagement, 'link' => 'index.php', 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("$course->shortname: $authstrs->paymentmanagement", $authstrs->paymentmanagement, $navigation, '', '', false, $buttons, $popupmenu);
$PAGE->navbar->add($authstrs->paymentmanagement, 'index.php');
$PAGE->set_title("$course->shortname: $authstrs->paymentmanagement");
$PAGE->set_heading($authstrs->paymentmanagement);
$PAGE->set_headingmenu($popupmenu);
$PAGE->set_button($buttons);
echo $OUTPUT->header();
$table = new flexible_table('enrol-authorize');
$table->set_attribute('width', '100%');
@ -221,7 +223,7 @@ function authorize_print_orders($courseid, $userid) {
*/
function authorize_print_order($orderid)
{
global $CFG, $USER, $DB, $OUTPUT;
global $CFG, $USER, $DB, $OUTPUT, $PAGE;
global $strs, $authstrs;
$do = optional_param('do', '', PARAM_ALPHA);
@ -265,14 +267,16 @@ function authorize_print_order($orderid)
}
}
$navlinks = array();
if (SITEID != $course->id) {
$navlinks[] = array('name' => $course->shortname, 'link' => "$CFG->wwwroot/course/view.php?id=".$course->id, 'type' => 'misc');
if (SITEID != $courseid) {
$PAGE->navbar->add($course->shortname, new moodle_url($CFG->wwwroot.'/course/view.php', array('id'=>$course->id)));
}
$navlinks[] = array('name' => $authstrs->paymentmanagement, 'link' => 'index.php?course='.$course->id, 'type' => 'misc');
$navlinks[] = array('name' => $authstrs->orderid . ': ' . $orderid, 'link' => '', 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("$course->shortname: $authstrs->paymentmanagement", $authstrs->orderdetails, $navigation, '', '', false, $buttons);
$PAGE->navbar->add($authstrs->paymentmanagement, 'index.php?course='.$course->id);
$PAGE->navbar->add($authstrs->orderid . ': ' . $orderid, 'index.php');
$PAGE->set_title("$course->shortname: $authstrs->paymentmanagement");
$PAGE->set_heading($authstrs->orderdetails);
$PAGE->set_cacheable(false);
$PAGE->set_button($buttons);
echo $OUTPUT->header();
$table = new html_table();
$table->width = '100%';

View file

@ -13,14 +13,14 @@
/// Print header
$struploadcsv = get_string('uploadcsv', 'enrol_authorize');
$navlinks = array();
$navlinks[] = array('name' => get_string('paymentmanagement', 'enrol_authorize'), 'link' => 'index.php', 'type' => 'misc');
$navlinks[] = array('name' => $struploadcsv, 'link' => "uploadcsv.php", 'type' => 'misc');
$navigation = build_navigation($navlinks);
$managebutton = "<form method='get' action='index.php'><div><input type='submit' value='".get_string('paymentmanagement', 'enrol_authorize')."' /></div></form>";
print_header_simple($struploadcsv, '', $navigation, '', '', false, $managebutton);
$PAGE->navbar->add(get_string('paymentmanagement', 'enrol_authorize'), 'index.php');
$PAGE->navbar->add($struploadcsv, 'uploadcsv.php');
$PAGE->set_title($struploadcsv);
$PAGE->set_cacheable(false);
$PAGE->set_button($managebutton);
echo $OUTPUT->header();
print_heading_with_help($struploadcsv, 'authorize/uploadcsv', 'enrol');
/// Handle CSV file