From c345209c19b12c8f6dba4a94e5333c75eaed5f27 Mon Sep 17 00:00:00 2001
From: toyomoyo <toyomoyo>
Date: Thu, 19 Oct 2006 06:41:49 +0000
Subject: [PATCH] merged fix for MDL-6549, fix for wrong publish to menu

---
 blog/lib.php | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/blog/lib.php b/blog/lib.php
index 96888c0ab81..7f979fb3f94 100755
--- a/blog/lib.php
+++ b/blog/lib.php
@@ -259,9 +259,17 @@
         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;
     }