From be108c7ab0ec144df4bc393817dc87080563f1b5 Mon Sep 17 00:00:00 2001 From: sam marshall Date: Thu, 1 Aug 2013 14:11:57 +0100 Subject: [PATCH] MDL-40320 Course page: Text greyed when conditional activity available --- course/renderer.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/course/renderer.php b/course/renderer.php index 884b14af182..627d015e7c9 100644 --- a/course/renderer.php +++ b/course/renderer.php @@ -751,11 +751,20 @@ class core_course_renderer extends plugin_renderer_base { return $output; } $content = $mod->get_formatted_content(array('overflowdiv' => true, 'noclean' => true)); - $conditionalhidden = $this->is_cm_conditionally_hidden($mod); - $accessiblebutdim = !$mod->visible || $conditionalhidden; + if ($this->page->user_is_editing()) { + // In editing mode, when an item is conditionally hidden from some users + // we show it as greyed out. + $conditionalhidden = $this->is_cm_conditionally_hidden($mod); + $dim = !$mod->visible || $conditionalhidden; + } else { + // When not in editing mode, we only show item as hidden if it is + // actually not available to the user + $conditionalhidden = false; + $dim = !$mod->uservisible; + } $textclasses = ''; $accesstext = ''; - if ($accessiblebutdim) { + if ($dim) { $textclasses .= ' dimmed_text'; if ($conditionalhidden) { $textclasses .= ' conditionalhidden';