fixed a bug where using tag to search blogs, nav menu is not working
This commit is contained in:
+11
-6
@@ -61,10 +61,15 @@ else {
|
||||
$PAGE->courseid = $courseid;
|
||||
$PAGE->init_full(); //init the BlogInfo object and the courserecord object
|
||||
|
||||
if (isset($tagid)) {
|
||||
if (isset($tagid) && $tagid) {
|
||||
$taginstance = get_record('tags', 'id', $tagid);
|
||||
} else {
|
||||
$tagid = '';
|
||||
if (isset($tag) && $tag) {
|
||||
$tagrec = get_record('tags', 'text', $tag);
|
||||
$tagid = $tagrec->id;
|
||||
$taginstance = get_record('tags', 'id', $tagid);
|
||||
}
|
||||
}
|
||||
if (!isset($filtertype)) {
|
||||
$filtertype = 'user';
|
||||
@@ -81,7 +86,7 @@ $tagstring = get_string('tag');
|
||||
|
||||
switch ($filtertype) {
|
||||
case 'site':
|
||||
if ($tagid) {
|
||||
if ($tagid || (isset($tag) && $tag)) {
|
||||
print_header("$site->shortname: $blogstring", "$site->fullname",
|
||||
'<a href="index.php?filtertype=site">'. "$blogstring</a> -> $tagstring: $taginstance->text",'','',true,$PAGE->get_extra_header_string());
|
||||
} else {
|
||||
@@ -91,7 +96,7 @@ switch ($filtertype) {
|
||||
break;
|
||||
|
||||
case 'course':
|
||||
if ($tagid) {
|
||||
if ($tagid || (isset($tag) && $tag)) {
|
||||
print_header("$course->shortname: $blogstring", "$course->fullname",
|
||||
'<a href="'.$CFG->wwwroot.'/course/view.php?id='.$filterselect.'">'.$course->shortname.'</a> ->
|
||||
<a href="index.php?filtertype=course&filterselect='.$filterselect.'">'. "$blogstring</a> -> $tagstring: $taginstance->text",'','',true,$PAGE->get_extra_header_string());
|
||||
@@ -106,7 +111,7 @@ switch ($filtertype) {
|
||||
|
||||
$thisgroup = get_record('groups', 'id', $filterselect);
|
||||
|
||||
if ($tagid) {
|
||||
if ($tagid || (isset($tag) && $tag)) {
|
||||
print_header("$course->shortname: $blogstring", "$course->fullname",
|
||||
'<a href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'.$course->shortname.'</a> ->
|
||||
<a href="'.$CFG->wwwroot.'/user/index.php?id='.$course->id.'&group='.$filterselect.'">'.$thisgroup->name.'</a> ->
|
||||
@@ -126,7 +131,7 @@ switch ($filtertype) {
|
||||
$participants = get_string('participants');
|
||||
|
||||
if (isset($course->id) && $course->id && $course->id != SITEID) {
|
||||
if ($tagid) {
|
||||
if ($tagid || (isset($tag) && $tag)) {
|
||||
print_header("$course->shortname: $blogstring", "$course->fullname",
|
||||
'<a href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'.$course->shortname.'</a> ->
|
||||
<a href="'.$CFG->wwwroot.'/user/index.php?id='.$course->id.'">'.$participants.'</a> ->
|
||||
@@ -146,7 +151,7 @@ switch ($filtertype) {
|
||||
//in top view
|
||||
else {
|
||||
|
||||
if ($tagid) {
|
||||
if ($tagid || (isset($tag) && $tag)) {
|
||||
print_header("$site->shortname: $blogstring", "$site->fullname",
|
||||
'<a href="'.$CFG->wwwroot.'/user/view.php?id='.$filterselect.'">'.fullname($user).'</a> ->
|
||||
<a href="index.php?filtertype=user&filterselect='.$filterselect.'">'. "$blogstring</a> -> $tagstring: $taginstance->text",'','',true,$PAGE->get_extra_header_string());
|
||||
|
||||
Reference in New Issue
Block a user