]> git.mjollnir.org Git - moodle.git/commitdiff
Somehow I forgot to commit these and the whole page setup wasn't working
authordefacer <defacer>
Thu, 25 Nov 2004 17:23:57 +0000 (17:23 +0000)
committerdefacer <defacer>
Thu, 25 Nov 2004 17:23:57 +0000 (17:23 +0000)
after renaming MoodlePage => page_base.

blocks/pagedemo.php
index.php
lib/pagelib.php

index 0baaf582053c2b30bdf7786a0f6616dacbe130ac..27d837eb71c144d26a84f10ac6737adb11c1b864 100644 (file)
@@ -31,7 +31,7 @@
     define('BLOCK_POS_CENTERDOWN', 'cd');
 
     // The actual Page derived class
-    class MoodlePage_Test extends MoodlePage {
+    class page_test extends page_base {
 
         // Mandatory; should return our identifier.
         function get_type() {
index cd180ea8b995f40d8ce11a6535481e6d08848637..5f566c9109f3df521634eccd6f95f9397a7bfe7f 100644 (file)
--- a/index.php
+++ b/index.php
@@ -55,7 +55,7 @@
         $langmenu = popup_form ($CFG->wwwroot .'/index.php?lang=', $langs, 'chooselang', $currlang, '', '', '', true);
     }
 
-    $PAGE = MoodlePage::create_object(MOODLE_PAGE_COURSE, SITEID);
+    $PAGE = page_base::create_object(MOODLE_PAGE_COURSE, SITEID);
 
     print_header(strip_tags($site->fullname), $site->fullname, 'home', '',
                  '<meta name="description" content="'. s(strip_tags($site->summary)) .'" />',
index c3f000493a0e68b4f7f49044e4189968c7ff99f6..dab25f916bc9ff6bf8ca13f31b99ce2a0057bfa0 100644 (file)
@@ -1,8 +1,8 @@
 <?php //$Id$
 
 /**
- * This file contains the parent class for moodle pages, MoodlePage, 
- * as well as the MoodlePage_Course subclass.
+ * This file contains the parent class for moodle pages, page_base, 
+ * as well as the page_course subclass.
  * A page is defined by its page type (ie. course, blog, activity) and its page id
  * (courseid, blogid, activity id, etc).
  *
@@ -24,10 +24,10 @@ define('MOODLE_PAGE_COURSE',    'course');
  *
  * @author Jon Papaioannou
  * @package pages
- * @todo This parent class is very messy still. Please for the moment ignore it [except maybe create_object()] and move on to the derived class MoodlePage_Course to see the comments there.
+ * @todo This parent class is very messy still. Please for the moment ignore it [except maybe create_object()] and move on to the derived class page_course to see the comments there.
  */
 
-class MoodlePage {
+class page_base {
     /**
      * The string identifier for the type of page being described.
      * @var string $type
@@ -164,15 +164,15 @@ class MoodlePage {
 
     // DO NOT TOUCH! NEVER! SECTION
 
-    // Factory method MoodlePage::create_object(). Called with a pagetype identifier and possibly with
-    // its numeric ID. Returns a fully constructed MoodlePage subclass you can work with.
+    // Factory method page_base::create_object(). Called with a pagetype identifier and possibly with
+    // its numeric ID. Returns a fully constructed page_base subclass you can work with.
     function create_object($type, $id = NULL) {
 
         $data = new stdClass;
         $data->pagetype = $type;
         $data->pageid   = $id;
 
-        $classname = MoodlePage::map_page_type($type);
+        $classname = page_base::map_page_type($type);
 
         $object = &new $classname;
         // TODO: subclassing check here
@@ -190,7 +190,7 @@ class MoodlePage {
     // Use it to associate the textual identifier of your Page with the actual class name that has to be instantiated.
     function map_page_type($type, $classname = NULL) {
         static $mappings = array(
-            MOODLE_PAGE_COURSE => 'MoodlePage_Course'
+            MOODLE_PAGE_COURSE => 'page_course'
         );
 
         if(!empty($type) && !empty($classname)) {
@@ -217,7 +217,7 @@ class MoodlePage {
  * @package pages
  */
 
-class MoodlePage_Course extends MoodlePage {
+class page_course extends page_base {
 
     // Any data we might need to store specifically about ourself should be declared here.
     // After init_full() is called for the first time, ALL of these variables should be