notes MDL-19806 Updated print_header and build_navigation to OUTPUT and PAGE equivalents
This commit is contained in:
@@ -110,7 +110,7 @@
|
||||
redirect('view.php?rid='.$record->id.'&page='.$page, get_string('commentdeleted', 'data'));
|
||||
|
||||
} else { //print confirm delete form
|
||||
print_header();
|
||||
echo $OUTPUT->header();
|
||||
data_print_comment($data, $comment, $page);
|
||||
|
||||
echo $OUTPUT->confirm(get_string('deletecomment','data'),
|
||||
@@ -123,7 +123,7 @@
|
||||
|
||||
}
|
||||
|
||||
print_header();
|
||||
echo $OUTPUT->header();
|
||||
data_print_comments($data, $record, $page, $mform);
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
|
||||
+5
-6
@@ -68,8 +68,8 @@
|
||||
if (empty($cm->visible) and !has_capability('moodle/course:viewhiddenactivities', $context)) {
|
||||
$strdatabases = get_string("modulenameplural", "data");
|
||||
|
||||
$navigation = build_navigation('', $cm);
|
||||
print_header_simple(format_string($data->name), "", $navigation, "", "", true, '', navmenu($course, $cm));
|
||||
$PAGE->set_title(format_string($data->name));
|
||||
echo $OUTPUT->header();
|
||||
notice(get_string("activityiscurrentlyhidden"));
|
||||
}
|
||||
|
||||
@@ -108,10 +108,9 @@
|
||||
/// Print the page header
|
||||
$strdata = get_string('modulenameplural','data');
|
||||
|
||||
$navigation = build_navigation('', $cm);
|
||||
print_header_simple($data->name, '', $navigation,
|
||||
'', '', true, update_module_button($cm->id, $course->id, get_string('modulename', 'data')),
|
||||
navmenu($course, $cm), '', '');
|
||||
$PAGE->set_title($data->name);
|
||||
$PAGE->set_button(update_module_button($cm->id, $course->id, get_string('modulename', 'data')));
|
||||
echo $OUTPUT->header();
|
||||
|
||||
/// Check to see if groups are being used here
|
||||
groups_print_activity_menu($cm, 'edit.php?d='.$data->id);
|
||||
|
||||
+3
-4
@@ -55,10 +55,9 @@ if($mform->is_cancelled()) {
|
||||
redirect('view.php?d='.$data->id);
|
||||
} elseif (!$formdata = (array) $mform->get_data()) {
|
||||
// build header to match the rest of the UI
|
||||
$nav = build_navigation('', $cm);
|
||||
print_header_simple($data->name, '', $nav,
|
||||
'', '', true, update_module_button($cm->id, $course->id, get_string('modulename', 'data')),
|
||||
navmenu($course, $cm), '', '');
|
||||
$PAGE->set_title($data->name);
|
||||
$PAGE->set_button(update_module_button($cm->id, $course->id, get_string('modulename', 'data')));
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(format_string($data->name));
|
||||
|
||||
// these are for the tab display
|
||||
|
||||
@@ -57,9 +57,8 @@ require_course_login($course, true, $cm);
|
||||
|
||||
/// If it's hidden then it's don't show anything. :)
|
||||
if (empty($cm->visible) and !has_capability('moodle/course:viewhiddenactivities',get_context_instance(CONTEXT_MODULE, $cm->id))) {
|
||||
$navigation = build_navigation('', $cm);
|
||||
print_header_simple(format_string($data->name), "", $navigation,
|
||||
"", "", true, '', navmenu($course, $cm));
|
||||
$PAGE->set_title($data->name);
|
||||
echo $OUTPUT->header();
|
||||
notice(get_string("activityiscurrentlyhidden"));
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -65,8 +65,8 @@
|
||||
/// Print the page header
|
||||
$strdata = get_string('modulenameplural','data');
|
||||
|
||||
$navigation = build_navigation('', $cm);
|
||||
print_header_simple($data->name, "", $navigation, "", "", true, "", navmenu($course));
|
||||
$PAGE->set_title($data->name);
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(format_string($data->name));
|
||||
|
||||
/// Groups needed for Add entry tab
|
||||
|
||||
+3
-5
@@ -43,11 +43,9 @@
|
||||
$strdata = get_string('modulename','data');
|
||||
$strdataplural = get_string('modulenameplural','data');
|
||||
|
||||
$navlinks = array();
|
||||
$navlinks[] = array('name' => $strdata, 'link' => "index.php?id=$course->id", 'type' => 'activity');
|
||||
$navigation = build_navigation($navlinks);
|
||||
|
||||
print_header_simple($strdata, '', $navigation, '', '', true, "", navmenu($course));
|
||||
$PAGE->navbar->add($strdata, new moodle_url($CFG->wwwroot.'/mod/data/index.php', array('id'=>$course->id)));
|
||||
$PAGE->set_title($strdata);
|
||||
echo $OUTPUT->header();
|
||||
|
||||
if (! $datas = get_all_instances_in_course("data", $course)) {
|
||||
notice(get_string('thereareno', 'moodle',$strdataplural) , "$CFG->wwwroot/course/view.php?id=$course->id");
|
||||
|
||||
+4
-6
@@ -2051,13 +2051,11 @@ function data_get_available_presets($context) {
|
||||
*/
|
||||
function data_print_header($course, $cm, $data, $currenttab='') {
|
||||
|
||||
global $CFG, $displaynoticegood, $displaynoticebad, $OUTPUT;
|
||||
|
||||
$navigation = build_navigation('', $cm);
|
||||
print_header_simple($data->name, '', $navigation,
|
||||
'', '', true, update_module_button($cm->id, $course->id, get_string('modulename', 'data')),
|
||||
navmenu($course, $cm));
|
||||
global $CFG, $displaynoticegood, $displaynoticebad, $OUTPUT, $PAGE;
|
||||
|
||||
$PAGE->set_title($data->name);
|
||||
$PAGE->set_button(update_module_button($cm->id, $course->id, get_string('modulename', 'data')));
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(format_string($data->name));
|
||||
|
||||
// Groups needed for Add entry tab
|
||||
|
||||
+2
-1
@@ -47,7 +47,8 @@
|
||||
$strrating = get_string('rating', 'data');
|
||||
$strname = get_string('name');
|
||||
|
||||
print_header($strratings);
|
||||
$PAGE->set_title($strratings);
|
||||
echo $OUTPUT->header();
|
||||
|
||||
if (!$ratings = data_get_ratings($record->id, $sqlsort)) {
|
||||
print_error('noratingforrecord', 'data');
|
||||
|
||||
@@ -79,11 +79,9 @@
|
||||
$bodytag .= '" ';
|
||||
|
||||
$PAGE->requires->js('mod/data/data.js');
|
||||
$navigation = build_navigation('', $cm);
|
||||
print_header_simple($data->name, '', $navigation,
|
||||
'', '', true, update_module_button($cm->id, $course->id, get_string('modulename', 'data')),
|
||||
navmenu($course, $cm), '', $bodytag);
|
||||
|
||||
$PAGE->set_title($data->name);
|
||||
$PAGE->set_button(update_module_button($cm->id, $course->id, get_string('modulename', 'data')));
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(format_string($data->name));
|
||||
|
||||
|
||||
|
||||
+5
-3
@@ -288,9 +288,11 @@
|
||||
}
|
||||
$buttons .= '</tr></table>';
|
||||
|
||||
$navigation = build_navigation(array(), $cm);
|
||||
print_header($title, $course->fullname, $navigation, '', '', true, $buttons, navmenu($course, $cm));
|
||||
|
||||
$PAGE->set_title($title);
|
||||
$PAGE->set_heading($course->fullname);
|
||||
$PAGE->set_button($buttons);
|
||||
echo $OUTPUT->header();
|
||||
|
||||
/// Check to see if groups are being used here
|
||||
$returnurl = 'view.php?d='.$data->id.'&search='.s($search).'&sort='.s($sort).'&order='.s($order).'&';
|
||||
groups_print_activity_menu($cm, $returnurl);
|
||||
|
||||
Reference in New Issue
Block a user