Commit f88309ad authored by kiz_0987's avatar kiz_0987
Browse files

Add clean urls on breadcrumb (except the main gallery one unfortunately).

Fixed breadcrumb generation for hybrid theme
parent eebfd4f9
......@@ -215,13 +215,20 @@ function gallery_page() {
if (isset($result['themeData'])) {
$urlGenerator =& $GLOBALS['gallery']->getUrlGenerator();
$breadcrumb = array(l(t('Home'), ''));
// Some themes (eg hybrid) do not set $result['themeData']['parents']
if ($result['themeData']['parents']) {
foreach ($result['themeData']['parents'] as $parent) {
$parent_title = $parent['title'];
// Simple strip of bbcode (italics)
$parent_title = str_replace("[i]", "<i>", $parent_title);
$parent_title = str_replace("[/i]", "</i>", $parent_title);
$breadcrumb[] = '<a href="'.$urlGenerator->generateUrl(
array('itemId' => $parent['id'])) .'">'.$parent_title."</a>";
// Still does not generate a clean url for /gallery (uses index.php?q=gallery)
$link = $urlGenerator->generateUrl(
array('view' => 'core.ShowItem',
'itemId' => $parent['id']),
array('forceFullUrl' => 1));
$breadcrumb[] = l($parent_title, $link);
}
}
drupal_set_breadcrumb($breadcrumb);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment