summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
-rw-r--r--themes/default/views/page.html.php21
4 files changed, 17 insertions, 7 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);
diff --git a/themes/default/views/page.html.php b/themes/default/views/page.html.php
index 3283bf1d..62d7ff85 100644
--- a/themes/default/views/page.html.php
+++ b/themes/default/views/page.html.php
@@ -5,13 +5,22 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>
- <? if (empty($page_title)): ?>
- <?= t("Browse Photos") ?>
- <? if (!empty($item)): ?>
- :: <?= p::clean($item->title) ?>
- <? endif ?>
- <? else: ?>
+ <? if ($page_title): ?>
<?= $page_title ?>
+ <? else: ?>
+ <? if ($theme->item()): ?>
+ <? if ($theme->item()->is_album()): ?>
+ <?= t("Browse Album :: %album_title", array("album_title" => p::clean($theme->item()->title))) ?>
+ <? elseif ($theme->item()->is_photo()): ?>
+ <?= t("Photo :: %photo_title", array("photo_title" => p::clean($theme->item()->title))) ?>
+ <? else: ?>
+ <?= t("Movie :: %movie_title", array("movie_title" => p::clean($theme->item()->title))) ?>
+ <? endif ?>
+ <? elseif ($theme->tag()): ?>
+ <?= t("Browse Tag :: %tag_title", array("tag_title" => p::clean($theme->tag()->title))) ?>
+ <? else: /* Not an item, not a tag, no page_title specified. Help! */ ?>
+ <?= t("Gallery") ?>
+ <? endif ?>
<? endif ?>
</title>
<link rel="shortcut icon" href="<?= $theme->url("images/favicon.ico") ?>" type="image/x-icon" />