MDL-46523 navigation: add body class when logged in as other role
authorJetha Chan <jetha@moodle.com>
Fri, 25 Jul 2014 02:57:42 +0000 (10:57 +0800)
committerJetha Chan <jetha@moodle.com>
Mon, 28 Jul 2014 07:47:46 +0000 (15:47 +0800)
lib/outputrenderers.php

index 82938bc..bbc616f 100644 (file)
@@ -827,6 +827,10 @@ class core_renderer extends renderer_base {
             $this->page->add_body_class('userloggedinas');
         }
 
+        if (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);