From: nicolasconnault Date: Thu, 6 Aug 2009 08:15:43 +0000 (+0000) Subject: MDL-19794 Migrated calls to print_heading X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=7c5286cd85b257746c3f9fd6e0eb7bf1bb3bc92c;p=moodle.git MDL-19794 Migrated calls to print_heading --- diff --git a/course/category.php b/course/category.php index ee2f2e71a3..7c51750304 100644 --- a/course/category.php +++ b/course/category.php @@ -226,7 +226,7 @@ if (!$courses) { if (empty($subcategorieswereshown)) { - print_heading(get_string("nocoursesyet")); + echo $OUTPUT->heading(get_string("nocoursesyet")); } } else if ($numcourses <= COURSE_MAX_SUMMARIES_PER_PAGE and !$page and !$editingon) { diff --git a/course/delete.php b/course/delete.php index e367ad05f1..16b7a87751 100644 --- a/course/delete.php +++ b/course/delete.php @@ -72,12 +72,12 @@ print_header("$site->shortname: $strdeletingcourse", $site->fullname, $navigation); - print_heading($strdeletingcourse); + echo $OUTPUT->heading($strdeletingcourse); delete_course($course); fix_course_sortorder(); //update course count in catagories - print_heading( get_string("deletedcourse", "", format_string($course->shortname)) ); + echo $OUTPUT->heading( get_string("deletedcourse", "", format_string($course->shortname)) ); print_continue("category.php?id=$course->category"); diff --git a/course/edit.php b/course/edit.php index 5ba15b74fb..904da6a6e2 100644 --- a/course/edit.php +++ b/course/edit.php @@ -142,7 +142,7 @@ $navigation = build_navigation($navlinks); print_header($title, $fullname, $navigation, $editform->focus()); - print_heading($streditcoursesettings); + echo $OUTPUT->heading($streditcoursesettings); $editform->display(); diff --git a/course/editcategory.php b/course/editcategory.php index 2335258010..fa446c1bf0 100644 --- a/course/editcategory.php +++ b/course/editcategory.php @@ -108,7 +108,7 @@ if ($id) { $navigation = build_navigation($navlinks); print_header($title, $fullname, $navigation, $mform->focus()); -print_heading($strtitle); +echo $OUTPUT->heading($strtitle); $mform->display(); diff --git a/course/format/weeks/format.php b/course/format/weeks/format.php index c671a51ecf..d75ef476af 100644 --- a/course/format/weeks/format.php +++ b/course/format/weeks/format.php @@ -211,10 +211,10 @@ echo '
'; if (!has_capability('moodle/course:viewhiddensections', $context) and !$thissection->visible) { // Hidden for students - print_heading($currenttext.$weekperiod.' ('.get_string('notavailable').')', null, 3, 'weekdates'); + echo $OUTPUT->heading($currenttext.$weekperiod.' ('.get_string('notavailable').')', 3, 'weekdates'); } else { - print_heading($currenttext.$weekperiod, null, 3, 'weekdates'); + echo $OUTPUT->heading($currenttext.$weekperiod, 3, 'weekdates'); echo '
'; $summaryformatoptions->noclean = true; diff --git a/course/import/activities/mod.php b/course/import/activities/mod.php index 741d1cd041..944aa1a2a4 100644 --- a/course/import/activities/mod.php +++ b/course/import/activities/mod.php @@ -37,7 +37,7 @@ $cat_courses = array(); } - print_heading(get_string("importactivities")); + echo $OUTPUT->heading(get_string("importactivities")); $options = array(); foreach ($taught_courses as $tcourse) { diff --git a/course/importstudents.php b/course/importstudents.php index e6a20b7669..b63a96f018 100644 --- a/course/importstudents.php +++ b/course/importstudents.php @@ -50,7 +50,7 @@ /// Print a help notice about the need to use this page - print_heading(get_string('childcourses')); + echo $OUTPUT->heading(get_string('childcourses')); if (!$frm = data_submitted()) { $note = get_string("importmetacoursenote"); diff --git a/course/index.php b/course/index.php index 98896519c8..219a2711ba 100644 --- a/course/index.php +++ b/course/index.php @@ -59,7 +59,7 @@ $navlinks[] = array('name'=>$strcategories,'link'=>'','type'=>'misc'); $navigation = build_navigation($navlinks); print_header("$site->shortname: $strcategories", $strcourses, $navigation, '', '', true, update_category_button()); - print_heading($strcategories); + echo $OUTPUT->heading($strcategories); echo skip_main_destination(); print_box_start('categorybox'); print_whole_category_list(); @@ -101,7 +101,7 @@ require_capability('moodle/category:manage', $context); require_capability('moodle/category:manage', get_category_or_system_context($deletecat->parent)); - $heading = get_string('deletecategory', '', format_string($deletecat->name)); + $heading = get_string('deletecategory', format_string($deletecat->name)); require_once('delete_category_form.php'); $mform = new delete_category_form(null, $deletecat); $mform->set_data(array('delete'=>$delete)); @@ -112,14 +112,14 @@ } else if (!$data= $mform->get_data()) { require_once($CFG->libdir . '/questionlib.php'); admin_externalpage_print_header(); - print_heading($heading); + echo $OUTPUT->heading($heading); $mform->display(); admin_externalpage_print_footer(); exit(); } admin_externalpage_print_header(); - print_heading($heading); + echo $OUTPUT->heading($heading); if ($data->fulldelete) { $deletedcourses = category_delete_full($deletecat, true); @@ -214,7 +214,7 @@ /// Print headings admin_externalpage_print_header(); - print_heading($strcategories); + echo $OUTPUT->heading($strcategories); /// Print out the categories with all the knobs $strcategories = get_string('categories'); diff --git a/course/info.php b/course/info.php index 2397aa57d4..cbb1d0fc55 100644 --- a/course/info.php +++ b/course/info.php @@ -35,7 +35,7 @@ print_header(get_string("summaryof", "", $course->fullname)); - print_heading(format_string($course->fullname) . '
(' . format_string($course->shortname) . ')'); + echo $OUTPUT->heading(format_string($course->fullname) . '
(' . format_string($course->shortname) . ')'); if ($course->guest || $course->password) { print_box_start('generalbox icons'); diff --git a/course/lib.php b/course/lib.php index 576d3eb2b3..85385cdb69 100644 --- a/course/lib.php +++ b/course/lib.php @@ -809,7 +809,7 @@ function print_log_graph($course, $userid=0, $type="course.png", $date=0) { function print_overview($courses) { - global $CFG, $USER, $DB; + global $CFG, $USER, $DB, $OUTPUT; $htmlarray = array(); if ($modules = $DB->get_records('modules')) { @@ -829,7 +829,7 @@ function print_overview($courses) { if (empty($course->visible)) { $linkcss = 'class="dimmed"'; } - print_heading(''. format_string($course->fullname).''); + echo $OUTPUT->heading(''. format_string($course->fullname).''); if (array_key_exists($course->id,$htmlarray)) { foreach ($htmlarray[$course->id] as $modname => $html) { echo $html; @@ -2090,7 +2090,7 @@ function print_courses($category) { } echo "\n"; } else { - print_heading(get_string("nocoursesyet")); + echo $OUTPUT->heading(get_string("nocoursesyet")); $context = get_context_instance(CONTEXT_SYSTEM); if (has_capability('moodle/course:create', $context)) { $options = array(); diff --git a/course/pending.php b/course/pending.php index bc13b3d287..3dcf75b653 100644 --- a/course/pending.php +++ b/course/pending.php @@ -156,9 +156,9 @@ $pending = $DB->get_records('course_request'); if (empty($pending)) { - print_heading(get_string('nopendingcourses')); + echo $OUTPUT->heading(get_string('nopendingcourses')); } else { - print_heading(get_string('coursespending')); + echo $OUTPUT->heading(get_string('coursespending')); /// Build a table of all the requests. $table->class = 'pendingcourserequests generaltable'; diff --git a/course/recent.php b/course/recent.php index d97672ddbd..bae1101d08 100644 --- a/course/recent.php +++ b/course/recent.php @@ -57,7 +57,7 @@ $navlinks[] = array('name' => $userinfo, 'link' => null, 'type' => 'misc'); $navigation = build_navigation($navlinks); print_header("$course->shortname: $strrecentactivity", $course->fullname, $navigation, '', $meta); - print_heading(format_string($course->fullname) . ": $userinfo", '', 3); + echo $OUTPUT->heading(format_string($course->fullname) . ": $userinfo", 3); $mform->display(); diff --git a/course/report/log/index.php b/course/report/log/index.php index 052a5716af..39232cb730 100644 --- a/course/report/log/index.php +++ b/course/report/log/index.php @@ -88,7 +88,7 @@ print_header($course->shortname .': '. $strlogs, $course->fullname, $navigation); } - print_heading(format_string($course->fullname) . ": $userinfo, $dateinfo (".usertimezone().")"); + echo $OUTPUT->heading(format_string($course->fullname) . ": $userinfo, $dateinfo (".usertimezone().")"); print_mnet_log_selector_form($hostid, $course, $user, $date, $modname, $modid, $modaction, $group, $showcourses, $showusers, $logformat); if($hostid == $CFG->mnet_localhost_id) { @@ -134,7 +134,7 @@ print_header($course->shortname .': '. $strlogs, $course->fullname, $navigation, ''); } - print_heading(get_string('chooselogs') .':'); + echo $OUTPUT->heading(get_string('chooselogs') .':'); print_log_selector_form($course, $user, $date, $modname, $modid, $modaction, $group, $showcourses, $showusers, $logformat); } diff --git a/course/report/log/indexlive.php b/course/report/log/indexlive.php index 67aa3c6f21..c0d909721a 100644 --- a/course/report/log/indexlive.php +++ b/course/report/log/indexlive.php @@ -32,7 +32,7 @@ print_header($course->shortname .': '. $strlogs, $course->fullname, $navigation, ''); } - print_heading(get_string('loglive', 'coursereport_log')); + echo $OUTPUT->heading(get_string('loglive', 'coursereport_log')); echo '
'; link_to_popup_window('/course/report/log/live.php?id='. $course->id,'livelog', get_string('livelogs'), 500, 800); diff --git a/course/report/log/mod.php b/course/report/log/mod.php index 970253b84c..84177a421c 100644 --- a/course/report/log/mod.php +++ b/course/report/log/mod.php @@ -8,15 +8,15 @@ require_once($CFG->dirroot.'/course/report/log/lib.php'); if (has_capability('coursereport/log:view', $context)) { - print_heading(get_string('chooselogs') .':'); + echo $OUTPUT->heading(get_string('chooselogs') .':'); print_log_selector_form($course); } if (has_capability('coursereport/log:viewlive', $context)) { - print_heading(get_string('chooselivelogs') .':'); + echo $OUTPUT->heading(get_string('chooselivelogs') .':'); echo '

'; link_to_popup_window('/course/report/log/live.php?id='. $course->id,'livelog', get_string('livelogs'), 500, 800); echo '

'; } -?> \ No newline at end of file +?> diff --git a/course/report/outline/index.php b/course/report/outline/index.php index 26c9204994..fe949fa106 100644 --- a/course/report/outline/index.php +++ b/course/report/outline/index.php @@ -37,7 +37,7 @@ print_header("$course->shortname: $stractivityreport", $course->fullname, $navigation); - print_heading(format_string($course->fullname)); + echo $OUTPUT->heading(format_string($course->fullname)); if (!$logstart = $DB->get_field_sql("SELECT MIN(time) FROM {log}")) { print_error('logfilenotavailable'); diff --git a/course/report/stats/report.php b/course/report/stats/report.php index c048ba8f7c..961724cdef 100644 --- a/course/report/stats/report.php +++ b/course/report/stats/report.php @@ -106,7 +106,7 @@ $stats = stats_fix_zeros($stats,$param->timeafter,$param->table,(!empty($param->line2))); - print_heading(format_string($course->shortname).' - '.get_string('statsreport'.$report) + echo $OUTPUT->heading(format_string($course->shortname).' - '.get_string('statsreport'.$report) .((!empty($user)) ? ' '.get_string('statsreportforuser').' ' .fullname($user,true) : '') .((!empty($roleid)) ? ' '.$DB->get_field('role','name', array('id'=>$roleid)) : '')); diff --git a/course/request.php b/course/request.php index 73eb6a28c6..80bdb8015a 100644 --- a/course/request.php +++ b/course/request.php @@ -58,7 +58,7 @@ } else if ($data = $requestform->get_data()) { print_header($strtitle, $strtitle, build_navigation($strtitle), $requestform->focus()); - print_heading($strtitle); + echo $OUTPUT->heading($strtitle); /// Record the request. $data->requester = $USER->id; @@ -92,8 +92,8 @@ /// Show the request form. print_header($strtitle, $strtitle, build_navigation($strtitle), $requestform->focus()); - print_heading($strtitle); + echo $OUTPUT->heading($strtitle); $requestform->display(); print_footer(); -?> \ No newline at end of file +?> diff --git a/course/reset.php b/course/reset.php index bce5ea64ba..28abd8037a 100755 --- a/course/reset.php +++ b/course/reset.php @@ -45,7 +45,7 @@ if ($mform->is_cancelled()) { } else { print_header($course->fullname.': '.$strresetcourse, $course->fullname.': '.$strresetcourse, $navigation); - print_heading($strresetcourse); + echo $OUTPUT->heading($strresetcourse); $data->reset_start_date_old = $course->startdate; $status = reset_course_userdata($data); @@ -74,7 +74,7 @@ if ($mform->is_cancelled()) { } print_header($course->fullname.': '.$strresetcourse, $course->fullname.': '.$strresetcourse, $navigation); -print_heading($strresetcourse); +echo $OUTPUT->heading($strresetcourse); print_simple_box(get_string('resetinfo'), 'center', '60%'); diff --git a/course/scales.php b/course/scales.php index b06af3d154..da8e88679d 100644 --- a/course/scales.php +++ b/course/scales.php @@ -35,7 +35,7 @@ $scalemenu = make_menu_from_list($scale->scale); print_simple_box_start("center"); - print_heading($scale->name); + echo $OUTPUT->heading($scale->name); echo "
"; choose_from_menu($scalemenu, "", "", ""); echo "
"; @@ -49,7 +49,7 @@ } if ($scales = $DB->get_records("scale", array("courseid"=>$course->id), "name ASC")) { - print_heading($strcustomscales); + echo $OUTPUT->heading($strcustomscales); if (has_capability('moodle/course:managescales', $context)) { echo "

("; @@ -61,7 +61,7 @@ $scalemenu = make_menu_from_list($scale->scale); print_simple_box_start("center"); - print_heading($scale->name); + echo $OUTPUT->heading($scale->name); echo "

"; choose_from_menu($scalemenu, "", "", ""); echo "
"; @@ -79,12 +79,12 @@ } if ($scales = $DB->get_records("scale", array("courseid"=>0), "name ASC")) { - print_heading($strstandardscales); + echo $OUTPUT->heading($strstandardscales); foreach ($scales as $scale) { $scalemenu = make_menu_from_list($scale->scale); print_simple_box_start("center"); - print_heading($scale->name); + echo $OUTPUT->heading($scale->name); echo "
"; choose_from_menu($scalemenu, "", "", ""); echo "
"; diff --git a/course/search.php b/course/search.php index 06c33ad39c..f7a0a7ee7b 100644 --- a/course/search.php +++ b/course/search.php @@ -211,7 +211,7 @@ $lastcategory = -1; if ($courses) { - print_heading("$strsearchresults: $totalcount"); + echo $OUTPUT->heading("$strsearchresults: $totalcount"); $encodedsearch = urlencode($search); ///add the module parameter to the paging bar if they exists @@ -349,10 +349,10 @@ } else { if (!empty($search)) { - print_heading(get_string("nocoursesfound", "", s($search))); + echo $OUTPUT->heading(get_string("nocoursesfound", s($search))); } else { - print_heading( $strnovalidcourses ); + echo $OUTPUT->heading( $strnovalidcourses ); } } diff --git a/course/user.php b/course/user.php index 904e2b75b3..a770b1bf3e 100644 --- a/course/user.php +++ b/course/user.php @@ -33,7 +33,7 @@ if ($user->deleted) { print_header(); - print_heading(get_string('userdeleted')); + echo $OUTPUT->heading(get_string('userdeleted')); print_footer(); die; }