Skip to content

Commit

Permalink
assignments MDL-19803 Updated print_header and build_navigation to OU…
Browse files Browse the repository at this point in the history
…TPUT and PAGE equivalents
  • Loading branch information
samhemelryk committed Sep 7, 2009
1 parent 67c351d commit 55c7042
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
10 changes: 4 additions & 6 deletions mod/assignment/index.php
Expand Up @@ -23,12 +23,10 @@
$strsubmitted = get_string("submitted", "assignment");
$strgrade = get_string("grade");

$navlinks = array();
$navlinks[] = array('name' => $strassignments, 'link' => '', 'type' => 'activity');
$navigation = build_navigation($navlinks);

print_header_simple($strassignments, "", $navigation, "", "", true, "", navmenu($course));

$PAGE->navbar->add($strassignments);
$PAGE->set_title($strassignments);
echo $OUTPUT->header();

if (!$cms = get_coursemodules_in_course('assignment', $course->id, 'm.assignmenttype, m.timedue')) {
notice(get_string('noassignments', 'assignment'), "../../course/view.php?id=$course->id");
die;
Expand Down
12 changes: 4 additions & 8 deletions mod/assignment/type/online/all.php
Expand Up @@ -41,13 +41,8 @@
$str->topic = get_string('topic');
$str->week = get_string('week');

// build navigation
$navlinks = array();
$navlinks[] = array('name' => $str->assignments,
'link' => "$CFG->wwwroot/mod/assignment/index.php?id=$id", 'type' => 'activity');
$navlinks[] = array('name' => $str->onlinetext, 'link' => '', 'type' => 'activity');
$navigation = build_navigation($navlinks);

$PAGE->navbar->add($str->assignments, new moodle_url($CFG->wwwroot.'/mod/assignment/index.php', array('id'=>$id)));
$PAGE->navbar->add($str->onlinetext);

// get all the assignments in the course
$assignments = get_all_instances_in_course('assignment',$course, $USER->id );
Expand Down Expand Up @@ -133,7 +128,8 @@
// DISPLAY
//===================

print_header_simple($str->assignments, "", $navigation, "", "", true, "", navmenu($course));
$PAGE->set_title($str->assignments);
echo $OUTPUT->header();

foreach ($views as $view) {
echo $OUTPUT->container_start('clearfix generalbox assignment');
Expand Down
8 changes: 5 additions & 3 deletions mod/assignment/type/upload/assignment.class.php
Expand Up @@ -798,7 +798,7 @@ function delete_responsefile() {


function delete_file() {
global $CFG, $DB, $OUTPUT;
global $CFG, $DB, $OUTPUT, $PAGE;

$file = required_param('file', PARAM_FILE);
$userid = required_param('userid', PARAM_INT);
Expand Down Expand Up @@ -832,7 +832,8 @@ function delete_file() {
if (empty($mode)) {
$this->view_header(get_string('delete'));
} else {
print_header(get_string('delete'));
$PAGE->set_title(get_string('delete'));
echo $OUTPUT->header();
}
echo $OUTPUT->heading(get_string('delete'));
echo $OUTPUT->confirm(get_string('confirmdeletefile', 'assignment', $file), new moodle_url('delete.php', $optionsyes), new moodle_url($urlreturn, $optionsreturn));
Expand Down Expand Up @@ -861,7 +862,8 @@ function delete_file() {
if (empty($mode)) {
$this->view_header(get_string('delete'));
} else {
print_header(get_string('delete'));
$PAGE->set_title(get_string('delete'));
echo $OUTPUT->header();
}
echo $OUTPUT->notification(get_string('deletefilefailed', 'assignment'));
echo $OUTPUT->continue_button($returnurl);
Expand Down

0 comments on commit 55c7042

Please sign in to comment.