MDL-25607 respect visibility of news forum in the Latest news block
authorPetr Skoda <skodak@moodle.org>
Thu, 9 Dec 2010 06:23:18 +0000 (06:23 +0000)
committerPetr Skoda <skodak@moodle.org>
Thu, 9 Dec 2010 06:23:18 +0000 (06:23 +0000)
blocks/news_items/block_news_items.php

index d32781e..49c788c 100644 (file)
@@ -37,6 +37,10 @@ class block_news_items extends block_base {
             }
             $cm = $modinfo->instances['forum'][$forum->id];
 
+            if (!$cm->uservisible) {
+                return '';
+            }
+
             $context = get_context_instance(CONTEXT_MODULE, $cm->id);
 
         /// User must have perms to view discussions in that forum