]> git.mjollnir.org Git - moodle.git/commitdiff
Modification of the course format plugin structures so that it
authormoodler <moodler>
Sun, 21 Dec 2003 04:52:25 +0000 (04:52 +0000)
committermoodler <moodler>
Sun, 21 Dec 2003 04:52:25 +0000 (04:52 +0000)
fits in with other plugin formats in Moodle.

course/edit.php
course/format/README.txt [new file with mode: 0644]
course/format/social/format.php [moved from course/format/social.php with 100% similarity]
course/format/topics/format.php [moved from course/format/topics.php with 100% similarity]
course/format/weeks/format.php [moved from course/format/weeks.php with 100% similarity]
course/view.php

index 51dc964bc0527f6e78219e53bb4c7e9d52686e43..59855a043856c1e07923c35e59e7a5fc45efb75b 100644 (file)
     }
 
     $form->categories = get_records_select_menu("course_categories", "", "name", "id,name");
-    
-    $form->courseformats = array (
-             "weeks"  => get_string("formatweeks"),
-             "social" => get_string("formatsocial"),
-             "topics" => get_string("formattopics")
-    );
+
+    $courseformats = get_list_of_plugins("course/format");
+    $form->courseformats = array();
+
+    foreach ($courseformats as $courseformat) {
+        $form->courseformats["$courseformat"] = get_string("format$courseformat");
+    }
 
     $streditcoursesettings = get_string("editcoursesettings");
     $straddnewcourse = get_string("addnewcourse");
diff --git a/course/format/README.txt b/course/format/README.txt
new file mode 100644 (file)
index 0000000..52d1568
--- /dev/null
@@ -0,0 +1,9 @@
+Course formats
+--------------
+
+To add a new course format, just duplicate one of the 
+existing folders in here with a new name (eg coollayout).
+Then edit lang/en/moodle and add a new string like:
+
+$string['formatcoollayout'] = 'Cool Layout';
+
index 23d114f444e92190ef06424761e992f6074f3dab..8a2b14232b1c8fa5d9109c276f70a629ab56d1b1 100644 (file)
         }
     }
 
-    if (!file_exists("$CFG->dirroot/course/format/$course->format.php")) {   // Default format is weeks
+    if (!file_exists("$CFG->dirroot/course/format/$course->format/format.php")) {   // Default format is weeks
         $course->format = "weeks";
     }
 
-    require("$CFG->dirroot/course/format/$course->format.php");  // Include the actual course format
+    require("$CFG->dirroot/course/format/$course->format/format.php");  // Include the actual course format
 
     print_footer();