]> git.mjollnir.org Git - moodle.git/commitdiff
moodle_page: MDL-12212 remove deprecated calls from course/view.php and page_course...
authortjhunt <tjhunt>
Wed, 6 May 2009 09:19:46 +0000 (09:19 +0000)
committertjhunt <tjhunt>
Wed, 6 May 2009 09:19:46 +0000 (09:19 +0000)
course/view.php
lib/pagelib.php
lib/weblib.php
mod/forum/index.php

index d34ab666b19e3a482312c5c19b6751dc6fd10c28..d0d0cb83b36f86b80eaecf970b041d8ac7d7deef 100644 (file)
@@ -89,7 +89,6 @@
         $course->format = 'weeks';  // Default format is weeks
     }
 
-    $PAGE = page_create_object(PAGE_COURSE_VIEW, $course->id);
     $PAGE->set_url('course/view.php', array('id' => $course->id));
     $PAGE->set_pagetype('course-view-' . $course->format);
     $PAGE->set_other_editing_capability('moodle/course:manageactivities');
 
     $CFG->blocksdrag = $useajax;   // this will add a new class to the header so we can style differently
 
+    // The "Editing On" button will be appearing only in the "main" course screen
+    // (i.e., no breadcrumbs other than the default one added inside this function)
+    $buttons = switchroles_form($course->id);
+    if ($PAGE->user_allowed_editing()) {
+        $buttons .= update_course_icon($course->id );
+    }
+
+    $title = get_string('course') . ': ' . $course->fullname;
+    $navigation = build_navigation(array());
+    print_header($title, $course->fullname, $navigation, '', '', true,
+                 $buttons, user_login_string($course, $USER), false, $bodytags);
 
-    $PAGE->print_header(get_string('course').': %fullname%', NULL, '', $bodytags);
     $completion=new completion_info($course);
     if($completion->is_enabled() && ajaxenabled()) {
         require_js(array('yui_yahoo','yui_event','yui_connection','yui_dom'));
index 4e75d52be83920b61e18aa8b3e198295b0bbc528..878726fbe5405d9fdff502827676aed866df7190 100644 (file)
@@ -1018,46 +1018,6 @@ class page_base extends moodle_page {
  * @package pages
  */
 class page_course extends page_base {
-    // HTML OUTPUT SECTION
-
-    // This function prints out the common part of the page's header.
-    // You should NEVER print the header "by hand" in other code.
-    function print_header($title, $morenavlinks=NULL, $meta='', $bodytags='', $extrabuttons='') {
-        global $USER, $CFG;
-
-        $this->init_full();
-        $replacements = array(
-            '%fullname%' => $this->course->fullname
-        );
-        foreach($replacements as $search => $replace) {
-            $title = str_replace($search, $replace, $title);
-        }
-
-        $navlinks = array();
-
-        if(!empty($morenavlinks)) {
-            $navlinks = array_merge($navlinks, $morenavlinks);
-        }
-
-        $navigation = build_navigation($navlinks);
-
-        // The "Editing On" button will be appearing only in the "main" course screen
-        // (i.e., no breadcrumbs other than the default one added inside this function)
-        $buttons = switchroles_form($this->course->id);
-        if ($this->user_allowed_editing()) {
-            $buttons .= update_course_icon($this->course->id );
-        }
-        $buttons = empty($morenavlinks) ? $buttons : '&nbsp;';
-
-        // Add any extra buttons requested (by the resource module, for example)
-        if ($extrabuttons != '') {
-            $buttons = ($buttons == '&nbsp;') ? $extrabuttons : $buttons.$extrabuttons;
-        }
-
-        print_header($title, $this->course->fullname, $navigation,
-                     '', $meta, true, $buttons, user_login_string($this->course, $USER), false, $bodytags);
-    }
-
     // SELF-REPORTING SECTION
 
     // When we are creating a new page, use the data at your disposal to provide a textual representation of the
index b3e326baca6fb10b57254d684fec6479f1f3ea59..cc08fa943ff32b4637a3f5ed688123996c620248 100644 (file)
@@ -5138,8 +5138,8 @@ function update_categories_search_button($search,$page,$perpage) {
  * @todo Finish documenting this function
  */
 function navmenu($course, $cm=NULL, $targetwindow='self') {
-
     global $CFG, $THEME, $USER, $DB;
+    require_once($CFG->dirroot . '/course/lib.php'); // Required for get_fast_modinfo
 
     if (empty($THEME->navmenuwidth)) {
         $width = 50;
index 9c331f2e4f5f0f53ee9b8901bfd13c036b93f808..5c10e99edd946691134713b710d6dfcbd1c78009 100644 (file)
@@ -1,8 +1,9 @@
 <?php  // $Id$
 
-    require_once("../../config.php");
-    require_once("lib.php");
-    require_once("$CFG->libdir/rsslib.php");
+    require_once(dirname(__FILE__) . '/../../config.php');
+    require_once($CFG->dirroot . '/course/lib.php');
+    require_once($CFG->dirroot . '/mod/forum/lib.php');
+    require_once($CFG->libdir . '/rsslib.php');
 
     $id = optional_param('id', 0, PARAM_INT);                   // Course id
     $subscribe = optional_param('subscribe', null, PARAM_INT);  // Subscribe/Unsubscribe all forums