function m9PrintBreadcrumb() { global $_zp_current_album, $_zp_last_album; $parents = getParentAlbums(); $n = count($parents); if ($n > 0) { foreach ($parents as $parent) { $url = rewrite_path("/" . pathurlencode($parent->name) . "/", "/index.php?album=" . urlencode($parent->name)); echo '<li><a href="' . htmlspecialchars($url) . '">' . html_encode($parent->getTitle()) . '</a></li>'; } } }
function getParentHeaderTitle($before = '', $after = '') { global $_zp_current_album, $_zp_last_album; $tmp = ''; $parents = getParentAlbums(); $n = count($parents); if ($n > 0) { foreach ($parents as $parent) { $tmp .= $before . $parent->getTitle() . $after; } } return $tmp; }
/** * returns the breadcrumb navigation for album, gallery and image view. * * @return array */ function getParentBreadcrumb() { global $_zp_gallery, $_zp_current_search, $_zp_current_album, $_zp_last_album; $output = array(); if (in_context(ZP_SEARCH_LINKED)) { $page = $_zp_current_search->page; $searchwords = $_zp_current_search->getSearchWords(); $searchdate = $_zp_current_search->getSearchDate(); $searchfields = $_zp_current_search->getSearchFields(true); $search_album_list = $_zp_current_search->getAlbumList(); if (!is_array($search_album_list)) { $search_album_list = array(); } $searchpagepath = getSearchURL($searchwords, $searchdate, $searchfields, $page, array('albums' => $search_album_list)); $dynamic_album = $_zp_current_search->getDynamicAlbum(); if (empty($dynamic_album)) { if (empty($searchdate)) { $output[] = array('link' => $searchpagepath, 'title' => gettext("Return to search"), 'text' => gettext("Search")); if (is_null($_zp_current_album)) { return $output; } else { $parents = getParentAlbums(); } } else { return array(array('link' => $searchpagepath, 'title' => gettext("Return to archive"), 'text' => gettext("Archive"))); } } else { $album = $dynamic_album; $parents = getParentAlbums($album); if (in_context(ZP_ALBUM_LINKED)) { array_push($parents, $album); } } // remove parent links that are not in the search path foreach ($parents as $key => $analbum) { $target = $analbum->name; if ($target !== $dynamic_album && !in_array($target, $search_album_list)) { unset($parents[$key]); } } } else { $parents = getParentAlbums(); } $n = count($parents); if ($n > 0) { foreach ($parents as $parent) { $url = $parent->getLink(); //cleanup things in description for use as attribute tag $desc = getBare(preg_replace('|</p\\s*>|i', '</p> ', preg_replace('|<br\\s*/>|i', ' ', $parent->getDesc()))); $output[] = array('link' => html_encode($url), 'title' => $desc, 'text' => $parent->getTitle()); } } return $output; }
function getTitleBreadcrumb($before = ' ( ', $between = ' | ', $after = ' ) ') { global $_zp_gallery, $_zp_current_search, $_zp_current_album, $_zp_last_album; $titlebreadcrumb = ''; if (in_context(ZP_SEARCH_LINKED)) { $dynamic_album = $_zp_current_search->getDynamicAlbum(); if (empty($dynamic_album)) { $titlebreadcrumb .= $before . gettext("Search Result") . $after; if (is_null($_zp_current_album)) { return; } else { $parents = getParentAlbums(); } } else { $album = new Album($_zp_gallery, $dynamic_album); $parents = getParentAlbums($album); if (in_context(ZP_ALBUM_LINKED)) { array_push($parents, $album); } } } else { $parents = getParentAlbums(); } $n = count($parents); if ($n > 0) { $titlebreadcrumb .= $before; $i = 0; foreach ($parents as $parent) { if ($i > 0) { $titlebreadcrumb .= $between; } $titlebreadcrumb .= $parent->getTitle(); $i++; } $titlebreadcrumb .= $after; } return $titlebreadcrumb; }
<div id="gallerytitle"> <h2> <span class="linkit"> <a href="<?php echo getGalleryIndexURL(); ?> "><?php echo getGalleryTitle(); ?> </a></span> <span class="linkit"><a href="<?php echo getCustomPageURL('gallery'); ?> ">Gallery</a></span> <?php if (getParentAlbums() != null) { ?> <span class="linkit"><?php printParentBreadcrumb('', '', ''); ?> </span><?php } ?> <span class="linkit"><a href="<?php echo $_zp_current_image->album->getLink(); ?> "><?php echo $_zp_current_album->getTitle(); ?> </a></span> <span class="albumtitle"><span><?php
/** * Prints the breadcrumb navigation for album, gallery and image view. * * @param string $before Insert here the text to be printed before the links * @param string $between Insert here the text to be printed between the links * @param string $after Insert here the text to be printed after the links * @param mixed $truncate if not empty, the max lenght of the description. * @param string $elipsis the text to append to the truncated description */ function printParentBreadcrumb($before = '', $between = ' | ', $after = ' | ', $truncate = NULL, $elipsis = '...') { global $_zp_gallery, $_zp_current_search, $_zp_current_album, $_zp_last_album; echo $before; if (in_context(ZP_SEARCH_LINKED)) { $page = $_zp_current_search->page; $searchwords = $_zp_current_search->words; $searchdate = $_zp_current_search->dates; $searchfields = $_zp_current_search->getSearchFields(true); $search_album_list = $_zp_current_search->album_list; if (!is_array($search_album_list)) { $search_album_list = array(); } $searchpagepath = html_encode(getSearchURL($searchwords, $searchdate, $searchfields, $page, array('albums' => $search_album_list))); $dynamic_album = $_zp_current_search->dynalbumname; if (empty($dynamic_album)) { echo "<a href=\"" . $searchpagepath . "\" title=\"Return to search\">"; echo "<em>" . gettext("Search") . "</em></a>"; if (is_null($_zp_current_album)) { echo $after; return; } else { $parents = getParentAlbums(); echo $between; } } else { $album = new Album($_zp_gallery, $dynamic_album); $parents = getParentAlbums($album); if (in_context(ZP_ALBUM_LINKED)) { array_push($parents, $album); } } // remove parent links that are not in the search path foreach ($parents as $key => $analbum) { $target = $analbum->name; if ($target !== $dynamic_album && !in_array($target, $search_album_list)) { unset($parents[$key]); } } } else { $parents = getParentAlbums(); } $n = count($parents); if ($n > 0) { $i = 0; foreach ($parents as $parent) { if ($i > 0) { echo $between; } $url = rewrite_path("/" . pathurlencode($parent->name) . "/", "/index.php?album=" . pathurlencode($parent->name)); $desc = $parent->getDesc(); if (!empty($desc) && $truncate) { $desc = truncate_string($string, $length, $elipsis); } printLink($url, $parent->getTitle(), $desc); $i++; } echo $after; } }
/** * Prints the breadcrumb navigation for album, gallery and image view. * * @param string $before Insert here the text to be printed before the links * @param string $between Insert here the text to be printed between the links * @param string $after Insert here the text to be printed after the links */ function printParentBreadcrumb($before = '', $between = ' | ', $after = ' | ') { global $_zp_current_search, $_zp_current_album; echo $before; if (in_context(ZP_SEARCH_LINKED)) { $page = $_zp_current_search->page; $searchwords = $_zp_current_search->words; $searchdate = $_zp_current_search->dates; $searchfields = $_zp_current_search->getFields(); $searchpagepath = htmlspecialchars(getSearchURL($searchwords, $searchdate, $searchfields, $page)); $dynamic_album = $_zp_current_search->dynalbumname; if (empty($dynamic_album)) { echo "<a href=\"" . $searchpagepath . "\" title=\"Return to search\">"; echo "<em>" . gettext("Search") . "</em></a>"; if (is_null($_zp_current_album)) { echo $after; return; } else { $parents = getParentAlbums(); echo $between; } } else { $album = new Album($_zp_gallery, $dynamic_album); $parents = getParentAlbums($album); if (in_context(ZP_ALBUM_LINKED)) { array_push($parents, $album); } } } else { $parents = getParentAlbums(); } $n = count($parents); if ($n > 0) { $i = 0; foreach ($parents as $parent) { if ($i > 0) { echo $between; } $url = rewrite_path("/" . pathurlencode($parent->name) . "/", "/index.php?album=" . urlencode($parent->name)); printLink($url, $parent->getTitle(), $parent->getDesc()); $i++; } echo $after; } }