MDL-53077 assign: Set specific pagetype for pages with actions.
authorDavid Balch <david.balch@conted.ox.ac.uk>
Fri, 12 Feb 2016 16:35:04 +0000 (16:35 +0000)
committerDavid Balch <david.balch@conted.ox.ac.uk>
Fri, 12 Feb 2016 16:35:04 +0000 (16:35 +0000)
mod/assign/locallib.php

index 46008dc..91fe95d 100644 (file)
@@ -406,6 +406,7 @@ class assign {
      * @return string - The page output.
      */
     public function view($action='') {
+        global $PAGE;
 
         $o = '';
         $mform = null;
@@ -529,6 +530,10 @@ class assign {
                               'useridlistid' => optional_param('useridlistid', $this->get_useridlist_key_id(), PARAM_ALPHANUM));
         $this->register_return_link($action, $returnparams);
 
+        // Include any page action as part of the body tag CSS id.
+        if (!empty($action)) {
+            $PAGE->set_pagetype('mod-assign-' . $action);
+        }
         // Now show the right view page.
         if ($action == 'redirect') {
             $nextpageurl = new moodle_url('/mod/assign/view.php', $nextpageparams);