Set $item and $tag in the Theme_View so that calls like $theme->item()

which fall through to calling &View::__get() have an lvalue to return,
else you can't return them by reference.

Also, don't show sidebar blocks for pages that don't have an item so
that the rss and tag modules don't break the search page.
This commit is contained in:
Bharat Mediratta
2009-03-16 11:17:27 +00:00
parent ccc867f629
commit 6a2e8ec1cc
3 changed files with 12 additions and 0 deletions

View File

@@ -36,6 +36,8 @@ class Theme_View_Core extends View {
if (user::active()->admin) {
$this->theme_name = Input::instance()->get("theme", $this->theme_name);
}
$this->item = null;
$this->tag = null;
$this->set_global("theme", $this);
$this->set_global("user", user::active());
$this->set_global("page_type", $page_type);

View File

@@ -31,6 +31,11 @@ class rss_theme_Core {
}
static function sidebar_blocks($theme) {
// @todo this needs to be data driven
if (!$theme->item()) {
return;
}
$block = new Block();
$block->css_id = "gRss";
$block->title = t("Available RSS Feeds");

View File

@@ -24,6 +24,11 @@ class tag_theme_Core {
}
static function sidebar_blocks($theme) {
// @todo this needs to be data driven
if (!$theme->item()) {
return;
}
$block = new Block();
$block->css_id = "gTag";
$block->title = t("Popular Tags");