diff --git a/config.php b/config.php index 71ed403..e93f2a3 100644 --- a/config.php +++ b/config.php @@ -42,6 +42,12 @@ $THEME->parents = array( 'leatherbound', ); +///////////////////////////////////////////////////// +// theme renderers +///////////////////////////////////////////////////// + +$THEME->rendererfactory = 'theme_overridden_renderer_factory'; + ///////////////////////////////////////////////////// // Which existing theme(s) in the /theme/ directory // do you want this theme to extend. A theme can @@ -88,7 +94,7 @@ $THEME->layouts = array( 'defaultregion' => 'side-pre', ), 'course' => array( - 'file' => 'general.php', + 'file' => 'course.php', 'regions' => array('side-pre', 'side-post'), 'defaultregion' => 'side-pre' ), diff --git a/layout/course.php b/layout/course.php new file mode 100644 index 0000000..c50b262 --- /dev/null +++ b/layout/course.php @@ -0,0 +1,165 @@ +heading); +$hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar()); +$hasfooter = (empty($PAGE->layout_options['nofooter'])); +$hassidepre = $PAGE->blocks->region_has_content('side-pre', $OUTPUT); +$hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT); +$custommenu = $OUTPUT->custom_menu(); +$hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu)); + +$courseheader = $coursecontentheader = $coursecontentfooter = $coursefooter = ''; +if (empty($PAGE->layout_options['nocourseheaderfooter'])) { + $courseheader = $OUTPUT->course_header(); + $coursecontentheader = $OUTPUT->course_content_header(); + if (empty($PAGE->layout_options['nocoursefooter'])) { + $coursecontentfooter = $OUTPUT->course_content_footer(); + $coursefooter = $OUTPUT->course_footer(); + } +} + +$bodyclasses = array(); +if ($hassidepre && !$hassidepost) { + $bodyclasses[] = 'side-pre-only'; +} else if ($hassidepost && !$hassidepre) { + $bodyclasses[] = 'side-post-only'; +} else if (!$hassidepost && !$hassidepre) { + $bodyclasses[] = 'content-only'; +} +if ($hascustommenu) { + $bodyclasses[] = 'has_custom_menu'; +} + +echo $OUTPUT->doctype() ?> +htmlattributes() ?>> +
+