Permalink
Browse files

MDL-37404 add class 'format-xxx' to the body for the current course f…

…ormat
  • Loading branch information...
1 parent 9da506c commit 27efa6bfac5c891fbc77edca7345d2724599cecd @marinaglancy marinaglancy committed Jan 8, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/pagelib.php
View
6 lib/pagelib.php
@@ -871,7 +871,11 @@ public function set_course($course) {
// 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');
}
}

0 comments on commit 27efa6b

Please sign in to comment.