]> git.mjollnir.org Git - moodle.git/commitdiff
fixed add new blog entry and tag edit in blog block; merged from MOODLE_17_STABLE
authorskodak <skodak>
Wed, 25 Oct 2006 08:17:44 +0000 (08:17 +0000)
committerskodak <skodak>
Wed, 25 Oct 2006 08:17:44 +0000 (08:17 +0000)
blocks/blog_menu/block_blog_menu.php

index 340d2b08223ec3117eda98c56896008ead994869..e7752730d3ede78b91c1a89a66552f6bede05d60 100755 (executable)
@@ -88,8 +88,8 @@ class block_blog_menu extends block_base {
                         && (!$blogmodon || ($blogmodon && $coursearg != ''))
                         && $CFG->bloglevel >= BLOG_USER_LEVEL ) {
 
-                // show Add entry link - moderation is off, or moderation is on and the user is viewing the block within the context of a course
-                if (has_capability('moodle/blog:create', $curcontext)) {
+                // show Add entry link
+                if (has_capability('moodle/blog:create', $sitecontext)) {
                     $addentrylink = '<li><a href="'. $CFG->wwwroot. '/blog/edit.php?action=add'
                                    .$coursearg.'">'.get_string('addnewentry', 'blog') ."</a></li>\n";
                 }
@@ -113,9 +113,9 @@ class block_blog_menu extends block_base {
                 $output .= get_string('viewsiteentries', 'blog')."</a></li>\n";
             }
 
-            if (isloggedin() && !isguest()
-                    && (has_capability('moodle/blog:manageofficialtags', $sitecontext)
-                    || has_capability('moodle/blog:managepersonaltags', $curcontext))) {
+            if (has_capability('moodle/blog:manageofficialtags', $sitecontext)
+              or has_capability('moodle/blog:managepersonaltags', $sitecontext)
+              or has_capability('moodle/blog:create', $sitecontext)) {
 
                 $output .= '<li>'. link_to_popup_window("/blog/tags.php",'popup',get_string('tagmanagement'), 400, 500, 'Popup window', 'none', true) ."</li>\n";
             }