$this->page->add_body_class('userloggedinas');
}
+ // If the user is logged in, and we're not in initial install,
+ // check to see if the user is role-switched and add the appropriate
+ // CSS class to the body element.
+ if (!during_initial_install() && isloggedin() && is_role_switched($this->page->course->id)) {
+ $this->page->add_body_class('userswitchedrole');
+ }
+
// Give themes a chance to init/alter the page object.
$this->page->theme->init_page($this->page);