summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-03-12 16:06:13 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-03-12 16:06:13 +0000
commit85f2c6b6665360b60164330f88f89ad4d2a14f7f (patch)
tree4be7e05415b077d636581608d6df1c4ee3fe433e
parentb82b60c91a4ece468dad8981b7ccd46a8cf19662 (diff)
Move the setting of the page title into the controller that is
creating the page. Provide for a default page title if none is set. This allows less changes to page.html.php as different modules want to change the page title.
-rw-r--r--modules/tag/controllers/tags.php1
-rw-r--r--themes/default/views/page.html.php9
2 files changed, 7 insertions, 3 deletions
diff --git a/modules/tag/controllers/tags.php b/modules/tag/controllers/tags.php
index bba1a751..515ddd59 100644
--- a/modules/tag/controllers/tags.php
+++ b/modules/tag/controllers/tags.php
@@ -33,6 +33,7 @@ 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 d463af1b..6bbce475 100644
--- a/themes/default/views/page.html.php
+++ b/themes/default/views/page.html.php
@@ -5,10 +5,13 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>
- <? if ($page_type == "tag"): ?>
- <?= t("Browse Tags") ?> :: <?= $tag->name ?>
+ <? if (empty($page_title)): ?>
+ <?= t("Browse Photos") ?>
+ <? if (!empty($item)): ?>
+ :: <?= $item->title ?>
+ <? endif ?>
<? else: ?>
- <?= t("Browse Photos") ?> :: <?= $item->title ?>
+ <?= $page_title ?>
<? endif ?>
</title>
<link rel="shortcut icon" href="<?= $theme->url("images/favicon.ico") ?>" type="image/x-icon" />