summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-06-16 09:15:41 +0800
committer <unostar@danalan.info>2009-06-16 18:27:34 +0800
commit4797f5b0cf52434d5c1e3b440cbabb10a05a4ef9 (patch)
tree91a25030ab5ffaad90d788a3a7bf32595855b22d /modules
parent1081eee201cefa0278e189a2296545097c6f1db4 (diff)
Fix up the titles in the default theme. They've been broken for a
while. This fixes ticket #342. The bug is that we were using $item instead of $theme->item(). But we were also not special casing tags properly, and they are effectively first class citizens (at least for now) so treat them properly. Also, set page_title by default in the theme so that we don't have to do an empty() check on it (makes the theme easier to read) and move the title out of Tags_Controller so that the theme has more control over it. Signed-off-by: <unostar@danalan.info>
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/controllers/albums.php1
-rw-r--r--modules/gallery/libraries/Theme_View.php1
-rw-r--r--modules/tag/controllers/tags.php1
3 files changed, 2 insertions, 1 deletions
diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php
index 34fee917..856709c2 100644
--- a/modules/gallery/controllers/albums.php
+++ b/modules/gallery/controllers/albums.php
@@ -27,6 +27,7 @@ class Albums_Controller extends Items_Controller {
if (!access::can("view", $album)) {
if ($album->id == 1) {
$view = new Theme_View("page.html", "page");
+ $view->page_title = t("Log in to Gallery");
$view->content = user::get_login_form("login/auth_html");
print $view;
return;
diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php
index ebf0792c..484b93b0 100644
--- a/modules/gallery/libraries/Theme_View.php
+++ b/modules/gallery/libraries/Theme_View.php
@@ -47,6 +47,7 @@ class Theme_View_Core extends View {
$this->set_global("theme", $this);
$this->set_global("user", user::active());
$this->set_global("page_type", $page_type);
+ $this->set_global("page_title", null);
if ($page_type == "album") {
$this->set_global("thumb_proportion", $this->thumb_proportion());
}
diff --git a/modules/tag/controllers/tags.php b/modules/tag/controllers/tags.php
index 295a9d3b..eeeb28d7 100644
--- a/modules/tag/controllers/tags.php
+++ b/modules/tag/controllers/tags.php
@@ -33,7 +33,6 @@ class Tags_Controller extends REST_Controller {
$template = new Theme_View("page.html", "tag");
$template->set_global("page_size", $page_size);
- $template->set_global("page_title", t("Browse Tag::%name", array("name" => $tag->name)));
$template->set_global("tag", $tag);
$template->set_global("children", $tag->items($page_size, $offset));
$template->set_global("children_count", $children_count);