From 114f81ce09a2fb33f7de0eded47e6f54bb593125 Mon Sep 17 00:00:00 2001 From: toyomoyo Date: Mon, 15 May 2006 02:57:48 +0000 Subject: [PATCH] merged, tidying up constants --- blocks/blog_menu/block_blog_menu.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/blocks/blog_menu/block_blog_menu.php b/blocks/blog_menu/block_blog_menu.php index 80709f42187..c689fb01859 100755 --- a/blocks/blog_menu/block_blog_menu.php +++ b/blocks/blog_menu/block_blog_menu.php @@ -1,5 +1,7 @@ dirroot .'/blog/lib.php'); + class block_blog_menu extends block_base { function init() { @@ -15,13 +17,13 @@ class block_blog_menu extends block_base { $course = SITEID; } - if ($CFG->bloglevel < 1) { + if ($CFG->bloglevel < BLOG_USER_LEVEL) { $this->content->text = ''; return $this->content; } // don't display menu block if block is set at site level, and user is not logged in - if ($CFG->bloglevel < 5 && !(isloggedin() && !isguest())) { + if ($CFG->bloglevel < BLOG_GLOBAL_LEVEL && !(isloggedin() && !isguest())) { $this->content->text = ''; return $this->content; } @@ -48,15 +50,13 @@ class block_blog_menu extends block_base { $this->content->text = $output; return $this->content; } - - require_once($CFG->dirroot .'/blog/lib.php'); //if ( blog_isLoggedIn() && !isguest() ) { $courseviewlink = ''; $addentrylink = ''; $coursearg = ''; - if((isloggedin() && !isguest()) && isset($course) && isset($course->id) && $course->id !=0 && $course->id!=SITEID && $CFG->bloglevel >=3 ) { + if((isloggedin() && !isguest()) && isset($course) && isset($course->id) && $course->id !=0 && $course->id!=SITEID && $CFG->bloglevel >= BLOG_COURSE_LEVEL) { $coursearg = '&courseid='. $course->id; // a course is specified @@ -66,10 +66,10 @@ class block_blog_menu extends block_base { $blogmodon = false; - if ((isloggedin() && !isguest()) && (isadmin() || !$blogmodon || ($blogmodon && $coursearg != '')) && $CFG->bloglevel >= 1) { + if ((isloggedin() && !isguest()) && (isadmin() || !$blogmodon || ($blogmodon && $coursearg != '')) && $CFG->bloglevel >= BLOG_USER_LEVEL) { // 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') .'
'; + $addentrylink = ''. get_string('addnewentry', 'blog') .'
'; // show View my entries link $addentrylink .= ''; @@ -83,7 +83,7 @@ class block_blog_menu extends block_base { } // show View site entries link - if ($CFG->bloglevel >= 4) { + if ($CFG->bloglevel >= BLOG_SITE_LEVEL) { $output .= ''; $output .= get_string('viewsiteentries', 'blog') .'
'; }