From 12e01c0ce30e793e702b9d172f46bdd73581cc8b Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Thu, 16 Mar 2006 07:51:12 +0000 Subject: [PATCH] can not see links if not logged in --- blocks/blog_menu/block_blog_menu.php | 32 +++++++++++++--------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/blocks/blog_menu/block_blog_menu.php b/blocks/blog_menu/block_blog_menu.php index 32e6d943981..3a3596e08e9 100755 --- a/blocks/blog_menu/block_blog_menu.php +++ b/blocks/blog_menu/block_blog_menu.php @@ -51,7 +51,7 @@ class block_blog_menu extends block_base { $addentrylink = ''; $coursearg = ''; - if(isset($course) && isset($course->id) && $course->id !=0 && $course->id!=SITEID && $CFG->bloglevel >=3 ) { + if(blog_isLoggedIn() && isset($course) && isset($course->id) && $course->id !=0 && $course->id!=SITEID && $CFG->bloglevel >=3 ) { $coursearg = '&courseid='. $course->id; // a course is specified @@ -60,22 +60,20 @@ class block_blog_menu extends block_base { } $blogmodon = false; - if (isset($CFG->blog_enable_moderation) && $CFG->blog_enable_moderation) { - // blog moderation is enabled - $blogmodon = true; - } - if ((isadmin() || !$blogmodon || ($blogmodon && $coursearg != '')) && $CFG->bloglevel >= 1) { - // show Add entry link - user is not admin, moderation is off, or moderation is on and the user is viewing the block within the context of a course - $addentrylink = ''. get_string('addnewentry', 'blog') .'
'; - - // show View my entries link - $addentrylink .= ''; - $addentrylink .= get_string('viewmyentries', 'blog') .'
'; - // show link to manage blog prefs - $addentrylink .= ''. get_string('blogpreferences', 'blog') .'
'; - - $output = $addentrylink; - $output .= $courseviewlink; + + if (blog_isLoggedIn() && (isadmin() || !$blogmodon || ($blogmodon && $coursearg != '')) && $CFG->bloglevel >= 1) { + + // show Add entry link - user is not admin, moderation is off, or moderation is on and the user is viewing the block within the context of a course + $addentrylink = ''. get_string('addnewentry', 'blog') .'
'; + + // show View my entries link + $addentrylink .= ''; + $addentrylink .= get_string('viewmyentries', 'blog') .'
'; + // show link to manage blog prefs + $addentrylink .= ''. get_string('blogpreferences', 'blog') .'
'; + + $output = $addentrylink; + $output .= $courseviewlink; } -- 2.43.0