fixed a bug where using tag to search blogs, nav menu is not working

This commit is contained in:
toyomoyo
2006-03-16 02:01:55 +00:00
parent 09eb1e9e28
commit 40b6323cd0
+11 -6
View File
@@ -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&amp;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.'&amp;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&amp;filterselect='.$filterselect.'">'. "$blogstring</a> -> $tagstring: $taginstance->text",'','',true,$PAGE->get_extra_header_string());