From: moodler Date: Sun, 21 Dec 2003 04:52:25 +0000 (+0000) Subject: Modification of the course format plugin structures so that it X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=6049fb78f23d0962a8a8925cb78960219af5228f;p=moodle.git Modification of the course format plugin structures so that it fits in with other plugin formats in Moodle. --- diff --git a/course/edit.php b/course/edit.php index 51dc964bc0..59855a0438 100644 --- a/course/edit.php +++ b/course/edit.php @@ -139,12 +139,13 @@ } $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 index 0000000000..52d1568012 --- /dev/null +++ b/course/format/README.txt @@ -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'; + diff --git a/course/format/social.php b/course/format/social/format.php similarity index 100% rename from course/format/social.php rename to course/format/social/format.php diff --git a/course/format/topics.php b/course/format/topics/format.php similarity index 100% rename from course/format/topics.php rename to course/format/topics/format.php diff --git a/course/format/weeks.php b/course/format/weeks/format.php similarity index 100% rename from course/format/weeks.php rename to course/format/weeks/format.php diff --git a/course/view.php b/course/view.php index 23d114f444..8a2b14232b 100644 --- a/course/view.php +++ b/course/view.php @@ -89,11 +89,11 @@ } } - 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();