Merged MDL-8566 from 1.9

This commit is contained in:
moodler
2008-04-22 05:56:21 +00:00
parent a814fc6651
commit dde73b9e69
2 changed files with 23 additions and 10 deletions
+13 -8
View File
@@ -188,19 +188,27 @@ $navlinks = array();
$navlinks[] = array('name' => "$tagstring: $taginstance->name", 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("$course->shortname: $blogstring", $course->fullname, $navigation,'','',true,$PAGE->get_extra_header_string());
} else {
$navlinks[] = array('name' => $blogstring, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("$course->shortname: $blogstring", $course->fullname, $navigation,'','',true,$PAGE->get_extra_header_string());
}
print_header("$course->shortname: $blogstring", $course->fullname, $navigation,'','',true,$PAGE->get_extra_header_string());
} else {
//in top view
if ($tagid || !empty($tag)) {
if ($postid) {
$navlinks[] = array('name' => fullname($user),
'link' => "$CFG->wwwroot/user/view.php?id=$filterselect",
'type' => 'misc');
$navlinks[] = array('name' => $blogstring,
'link' => "index.php?filtertype=user&filterselect=$filterselect",
'type' => 'misc');
$navlinks[] = array('name' => format_string($postobject->subject), 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
} else if ($tagid || !empty($tag)) {
$navlinks[] = array('name' => fullname($user),
'link' => "$CFG->wwwroot/user/view.php?id=$filterselect",
'type' => 'misc');
@@ -210,17 +218,14 @@ $navlinks = array();
$navlinks[] = array('name' => "$tagstring: $taginstance->name", 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("$SITE->shortname: $blogstring", $SITE->fullname, $navigation,'','',true,$PAGE->get_extra_header_string());
} else {
$navlinks[] = array('name' => fullname($user),
'link' => "$CFG->wwwroot/user/view.php?id=$filterselect",
'type' => 'misc');
$navlinks[] = array('name' => $blogstring, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header("$SITE->shortname: $blogstring", $SITE->fullname, $navigation,'','',true,$PAGE->get_extra_header_string());
}
print_header("$SITE->shortname: $blogstring", $SITE->fullname, $navigation,'','',true,$PAGE->get_extra_header_string());
}
break;
+10 -2
View File
@@ -40,8 +40,16 @@ if (empty($filtertype)) {
$filtertype = 'user';
$filterselect = $userid;
} else if (has_capability('moodle/blog:view', $sitecontext) and $CFG->bloglevel > BLOG_USER_LEVEL) {
$filtertype = 'site';
$filterselect = '';
if ($postid) {
$filtertype = 'user';
if (!$postobject = get_record('post', 'module', 'blog', 'id', $postid)) {
error('No such blog entry');
}
$filterselect = $postobject->userid;
} else {
$filtertype = 'site';
$filterselect = '';
}
} else {
// user might have capability to write blogs, but not read blogs at site level
// users might enter this url manually without parameters