summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2011-08-07 13:27:27 -0700
committerTim Almdal <tnalmdal@shaw.ca>2011-08-07 13:41:47 -0700
commitdd0b622ae9e269e828699928fa8bddcd17d66225 (patch)
tree4de47a1cf57fa0dd029a9ebfcf83c67bcb57cafe /themes
parentc986b45931c8c168de478c48db0a8024ce99b7b8 (diff)
Initial commit of a patch for Ticket #1764. as discussed here: https://github.com/gallery/gallery3/pull/58/files#r72949.
Create a Breadcrumb library which has two static methods for_item (which takes a an item and builds the entire breadcrumb for the item) or build (which takes a variable number of Breadcrumb elements and creates a breadcrumb based on the specified elements). Used tag->url() to build the tag album url. Escaped the query string for the search. Tightened up the breadcrumb code in page.html.php. When adding the show query parameter, we can't blindly concatenate using the ? separator. We have to check that we use a & if a query parameter already exists.
Diffstat (limited to 'themes')
-rw-r--r--themes/wind/views/page.html.php27
1 files changed, 7 insertions, 20 deletions
diff --git a/themes/wind/views/page.html.php b/themes/wind/views/page.html.php
index 045e3c45..534b7de4 100644
--- a/themes/wind/views/page.html.php
+++ b/themes/wind/views/page.html.php
@@ -107,28 +107,15 @@
<?= $theme->header_bottom() ?>
</div>
- <? if ($theme->item() && !empty($parents)): ?>
+ <? if (!empty($breadcrumbs)): ?>
<ul class="g-breadcrumbs">
- <? $i = 0 ?>
- <? foreach ($parents as $parent): ?>
- <li<? if ($i == 0) print " class=\"g-first\"" ?>>
- <? // Adding ?show=<id> causes Gallery3 to display the page
- // containing that photo. For now, we just do it for
- // the immediate parent so that when you go back up a
- // level you're on the right page. ?>
- <a href="<?= $parent->url($parent->id == $theme->item()->parent_id ?
- "show={$theme->item()->id}" : null) ?>">
- <? // limit the title length to something reasonable (defaults to 15) ?>
- <?= html::purify(text::limit_chars($parent->title,
- module::get_var("gallery", "visible_title_length"))) ?>
- </a>
- </li>
- <? $i++ ?>
+ <? foreach ($breadcrumbs as $breadcrumb): ?>
+ <li class="<?= $breadcrumb->last ? "g-active" : "" ?>
+ <?= $breadcrumb->first ? "g-first" : "" ?>">
+ <? if (!$breadcrumb->last): ?> <a href="<?= $breadcrumb->url ?>"><? endif ?>
+ <?= html::purify(text::limit_chars($breadcrumb->title, module::get_var("gallery", "visible_title_length"))) ?>
+ <? if (!$breadcrumb->last): ?></a><? endif ?>
<? endforeach ?>
- <li class="g-active<? if ($i == 0) print " g-first" ?>">
- <?= html::purify(text::limit_chars($theme->item()->title,
- module::get_var("gallery", "visible_title_length"))) ?>
- </li>
</ul>
<? endif ?>
</div>