mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-04-29 17:49:15 -04:00
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:
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user