Merged MDL-8566 from 1.9
[moodle.git] / blog / header.php
index 7835ede..aee8625 100755 (executable)
@@ -188,29 +188,35 @@ $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' => "$tagstring: $taginstance->name", 'link' => null, 'type' => 'misc');
+                    $navlinks[] = array('name' => format_string($postobject->subject), 'link' => null, 'type' => 'misc');
                     $navigation = build_navigation($navlinks);
 
-                    print_header("$SITE->shortname: $blogstring", $SITE->fullname, $navigation,'','',true,$PAGE->get_extra_header_string());
+                } else if ($tagid || !empty($tag)) {
+                    $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' => "$tagstring: $taginstance->name", 'link' => null, 'type' => 'misc');
+                    $navigation = build_navigation($navlinks);
 
                 } else {
                     $navlinks[] = array('name' => fullname($user),
@@ -218,9 +224,8 @@ $navlinks = array();
                                         '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;