I'd like to be able to specify CSS for the assign grading table page (but not other assign pages), but the page body CSS only exposes the page path (with "page-mod-assign-view").
The obvious feature that distinguishes the grading table page is "action=grading" on the URL, as that dictates what actions the page performs.
It seemed reasonable that other modules & pages might benefit from CSS indicating which action the page was executing, so I wrote a patch to add it to any page with an action param: MDL-52875.
Marina has suggested that it shouldn't be a global solution, but instead only modify mod assign, with "The action should really be appended to the path-mod-xxx class as it must be specific to the current path only".
AFAICT, this would be done by:
diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php
index 42fbba3..ae95a39 100644
--- a/mod/assign/locallib.php
+++ b/mod/assign/locallib.php
@@ -3470,7 +3470,9 @@ class assign {
* @return string
*/
protected function view_grading_page() {
- global $CFG;
+ global $PAGE, $CFG;
+
+ $PAGE->set_pagetype('mod-assign-grading');
$o = '';
// Need submit permission to submit an assignment.
...but I'm fairly sure that there will need to be some other changes as well.
So - which approach should I pursue, and if it's changing mod/assign, what else do I need to amend?