]> git.mjollnir.org Git - moodle.git/commitdiff
merged fix for MDL-6549, fix for wrong publish to menu
authortoyomoyo <toyomoyo>
Thu, 19 Oct 2006 06:41:49 +0000 (06:41 +0000)
committertoyomoyo <toyomoyo>
Thu, 19 Oct 2006 06:41:49 +0000 (06:41 +0000)
blog/lib.php

index 96888c0ab81f5ec389fb00c2e3449b3e166a69f5..7f979fb3f945ea60d2af6de67bab96c8af13b839 100755 (executable)
         global $CFG;
 
         // everyone gets draft access
-        $options = array ( 'draft' => get_string('publishtonoone', 'blog') );
-        $options['site'] = get_string('publishtosite', 'blog');
-        $options['public'] = get_string('publishtoworld', 'blog');
+        if ($CFG->bloglevel >= BLOG_USER_LEVEL) {
+            $options = array ( 'draft' => get_string('publishtonoone', 'blog') );
+        }
+        
+        if ($CFG->bloglevel > BLOG_USER_LEVEL) {
+            $options['site'] = get_string('publishtosite', 'blog');
+        }
+        
+        if ($CFG->bloglevel >= BLOG_GLOBAL_LEVEL) {
+            $options['public'] = get_string('publishtoworld', 'blog');
+        }
 
         return $options;
     }