From 27efa6bfac5c891fbc77edca7345d2724599cecd Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Tue, 8 Jan 2013 11:49:38 +1100 Subject: [PATCH] MDL-37404 add class 'format-xxx' to the body for the current course format --- lib/pagelib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/pagelib.php b/lib/pagelib.php index 05d9901267a..dee4a7c52fd 100644 --- a/lib/pagelib.php +++ b/lib/pagelib.php @@ -871,7 +871,11 @@ class moodle_page { // notify course format that this page is set for the course if ($this->_course->id != $SITE->id) { require_once($CFG->dirroot.'/course/lib.php'); - course_get_format($this->_course)->page_set_course($this); + $courseformat = course_get_format($this->_course); + $this->add_body_class('format-'. $courseformat->get_format()); + $courseformat->page_set_course($this); + } else { + $this->add_body_class('format-site'); } }