diff --git a/mod/data/edit.php b/mod/data/edit.php index 55367da4f54..d814e240063 100755 --- a/mod/data/edit.php +++ b/mod/data/edit.php @@ -85,6 +85,7 @@ if (empty($cm->visible) and !has_capability('moodle/course:viewhiddenactivities' $strdatabases = get_string("modulenameplural", "data"); $PAGE->set_title(format_string($data->name)); + $PAGE->set_heading(format_string($course->fullname)); echo $OUTPUT->header(); notice(get_string("activityiscurrentlyhidden")); } @@ -134,11 +135,12 @@ $strdata = get_string('modulenameplural','data'); if ($rid) { $PAGE->navbar->add(get_string('editentry', 'data')); -} else { +} else if ($import) { $PAGE->navbar->add(get_string('add', 'data')); } $PAGE->set_title($data->name); +$PAGE->set_heading($course->fullname); echo $OUTPUT->header(); /// Check to see if groups are being used here @@ -305,9 +307,9 @@ if ($data->addtemplate){ $patterns[]="[[".$field->field->name."#id]]"; $replacements[] = 'field_'.$field->field->id; } - $newtext = str_ireplace($patterns, $replacements, $data->{$mode}); + $newtext = str_ireplace($patterns, $replacements, $data->{$mode}); -} else { //if the add template is not yet defined, print the default form! +} else { //if the add template is not yet defined, print the default form! echo data_generate_default_template($data, 'addtemplate', $rid, true, false); $newtext = ''; } diff --git a/mod/data/export.php b/mod/data/export.php index e51e20fc368..bd031b1e540 100644 --- a/mod/data/export.php +++ b/mod/data/export.php @@ -74,7 +74,6 @@ foreach ($fieldrecords as $fieldrecord) { $fields[]= data_get_field($fieldrecord, $data); } -$PAGE->navbar->add(get_string('export','data')); $mform = new mod_data_export_form('export.php?d='.$data->id, $fields, $cm); @@ -83,6 +82,7 @@ if($mform->is_cancelled()) { } elseif (!$formdata = (array) $mform->get_data()) { // build header to match the rest of the UI $PAGE->set_title($data->name); + $PAGE->set_heading($course->fullname); echo $OUTPUT->header(); echo $OUTPUT->heading(format_string($data->name)); diff --git a/mod/data/field.php b/mod/data/field.php index 17d10197328..2403024b911 100755 --- a/mod/data/field.php +++ b/mod/data/field.php @@ -246,9 +246,10 @@ foreach ($directories as $directory){ $menufield[$directory] = get_string($directory,'data'); //get from language files } asort($menufield); //sort in alphabetical order +$PAGE->set_title(get_string('course') . ': ' . $course->fullname); +$PAGE->set_heading($course->fullname); $PAGE->set_pagetype('mod-data-field-' . $newtype); -$PAGE->navbar->add(get_string('fields', 'data')); if (($mode == 'new') && (!empty($newtype)) && confirm_sesskey()) { /// Adding a new field data_print_header($course, $cm, $data,'fields'); diff --git a/mod/data/import.php b/mod/data/import.php index 34ae1b0b566..646a288eef3 100755 --- a/mod/data/import.php +++ b/mod/data/import.php @@ -81,7 +81,9 @@ require_capability('mod/data:manageentries', $context); /// Print the page header $strdata = get_string('modulenameplural','data'); +$PAGE->navbar->add(get_string('add', 'data')); $PAGE->set_title($data->name); +$PAGE->set_heading($course->fullname); echo $OUTPUT->header(); echo $OUTPUT->heading(format_string($data->name)); diff --git a/mod/data/index.php b/mod/data/index.php index eaca5208b20..00178570847 100755 --- a/mod/data/index.php +++ b/mod/data/index.php @@ -49,6 +49,7 @@ $strdataplural = get_string('modulenameplural','data'); $PAGE->navbar->add($strdata, new moodle_url('/mod/data/index.php', array('id'=>$course->id))); $PAGE->set_title($strdata); +$PAGE->set_heading($course->fullname); echo $OUTPUT->header(); if (! $datas = get_all_instances_in_course("data", $course)) { diff --git a/mod/data/preset.php b/mod/data/preset.php index b97756bf121..af0525cd061 100644 --- a/mod/data/preset.php +++ b/mod/data/preset.php @@ -104,8 +104,8 @@ if ($userid && ($userid != $USER->id) && !has_capability('mod/data:viewalluserpr /* Need sesskey security check here for import instruction */ $sesskey = sesskey(); - -$PAGE->navbar->add(get_string('presets', 'data')); +$PAGE->set_title(get_string('course') . ': ' . $course->fullname); +$PAGE->set_heading($course->fullname); /********************************************************************/ /* Output */ diff --git a/mod/data/templates.php b/mod/data/templates.php index d8539214e8d..6e1a6d88a84 100755 --- a/mod/data/templates.php +++ b/mod/data/templates.php @@ -88,9 +88,13 @@ $bodytag .= 'if (typeof('.$editorobj.') != \'undefined\') { currEditor = '.$edit $bodytag .= 'currTextarea = document.getElementById(\'tempform\').template;'; $bodytag .= '" '; -$PAGE->navbar->add(get_string($mode,'data')); +if ($mode == 'singletemplate') { + $PAGE->navbar->add(get_string($mode,'data')); +} + $PAGE->requires->js('/mod/data/data.js'); $PAGE->set_title($data->name); +$PAGE->set_heading($course->fullname); echo $OUTPUT->header(); echo $OUTPUT->heading(format_string($data->name));