From 974f9f778891bbefeb083b2d97b3dae206c96452 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 26 Nov 2008 21:50:45 +0000 Subject: Add a new "tag" page type. Create the concept of "page types" which let us specify the kind of page that we're rendering in high level terms. Currently there are three page types: album, photo and tag. The tag page type uses slightly different variables. It has a $tag but no $item. Adjust all sidebar_block() functions to avoid printing stuff that's dependent on the item if there is no item. Simplify the tag code to stop trying to fake an item. Update the theme slightly to use $item and $tag where appropriate (notably, for making the element). --- themes/default/views/header.html.php | 2 ++ themes/default/views/page.html.php | 12 +++++++++--- themes/default/views/tag.html.php | 31 +++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 themes/default/views/tag.html.php (limited to 'themes') diff --git a/themes/default/views/header.html.php b/themes/default/views/header.html.php index 1ca2a952..c34486be 100644 --- a/themes/default/views/header.html.php +++ b/themes/default/views/header.html.php @@ -14,9 +14,11 @@ <?= $theme->header_bottom() ?> +<? if ($page_type != "tag"): ?> <ul id="gBreadcrumbs" class="gClearFix"> <? foreach ($parents as $parent): ?> <li><a href="<?= url::site("albums/{$parent->id}") ?>"><?= $parent->title_edit ?></a></li> <? endforeach ?> <li class="active"><?= $item->title_edit ?></li> </ul> +<? endif ?> diff --git a/themes/default/views/page.html.php b/themes/default/views/page.html.php index de0eff93..702595a6 100644 --- a/themes/default/views/page.html.php +++ b/themes/default/views/page.html.php @@ -4,7 +4,13 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> - <title><?= _("Browse Photos") ?> :: <?= $item->title ?> + + <? if ($page_type == "tag"): ?> + <?= _("Browse Tags") ?> :: <?= $tag->name ?> + <? else: ?> + <?= _("Browse Photos") ?> :: <?= $item->title ?> + <? endif ?> + " media="screen,print,projection" /> " @@ -24,8 +30,8 @@ - page_top() ?> -
+ page_top() ?> +
display("header.html") ?> diff --git a/themes/default/views/tag.html.php b/themes/default/views/tag.html.php new file mode 100644 index 00000000..a4254e06 --- /dev/null +++ b/themes/default/views/tag.html.php @@ -0,0 +1,31 @@ + +
+

name ?>

+ tag_top() ?> +
+ +
    + $child): ?> + + is_album()): ?> + + +
  • + thumbnail_top($child) ?> + type}s/{$child->id}") ?>"> + photo + +

    title_edit ?>

    + thumbnail_bottom($child) ?> + +
  • + +
+tag_bottom() ?> + +pager() ?> -- cgit v1.2.3