}
$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");
--- /dev/null
+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';
+
}
}
- 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();