From 4797f5b0cf52434d5c1e3b440cbabb10a05a4ef9 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 16 Jun 2009 09:15:41 +0800 Subject: 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: --- themes/default/views/page.html.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'themes') 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 @@ - <? 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 ?> " type="image/x-icon" /> -- cgit v1.2.3