dirroot .'/blog/lib.php'); class block_blog_menu extends block_base { function init() { $this->title = get_string('blockmenutitle', 'blog'); $this->content_type = BLOCK_TYPE_TEXT; $this->version = 2007101509; } function get_content() { global $CFG, $USER, $COURSE; if (empty($CFG->bloglevel)) { $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 < BLOG_GLOBAL_LEVEL && !(isloggedin() && !isguest())) { $this->content->text = ''; return $this->content; } if (!isset($userBlog)) { $userBlog ->userid = 0; } if (!empty($USER->id)) { $userBlog->userid = $USER->id; } //what is $userBlog anyway if($this->content !== NULL) { return $this->content; } $output = ''; $this->content = new stdClass; $this->content->footer = ''; if (empty($this->instance) /*|| empty($CFG->blog_version)*/) { // Either we're being asked for content without // an associated instance of the Blog module has never been installed. $this->content->text = $output; return $this->content; } //if ( blog_isLoggedIn() && !isguest() ) { $courseviewlink = ''; $addentrylink = ''; $coursearg = ''; $sitecontext = get_context_instance(CONTEXT_SYSTEM); if ($COURSE->id != SITEID) { $incoursecontext = true; $curcontext = get_context_instance(CONTEXT_COURSE, $COURSE->id); } else { $incoursecontext = false; $curcontext = $sitecontext; } $canviewblogs = has_capability('moodle/blog:view', $curcontext); /// Accessibility: markup as a list. if ( (isloggedin() && !isguest()) && $incoursecontext && $CFG->bloglevel >= BLOG_COURSE_LEVEL && $canviewblogs) { $coursearg = '&courseid='.$COURSE->id; // a course is specified $courseviewlink = '