summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-21 17:46:35 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-21 17:46:35 +0100
commit4382a204c4a1119e8183129826f21c55cf890c00 (patch)
tree121305f21f38d2b9eeb199aa968f7f18fb7ae960
parent0ce4de7b6d05f675c8945ebb3af846f38272ef8b (diff)
downloadfisheye-4382a204c4a1119e8183129826f21c55cf890c00.tar.gz
fisheye-4382a204c4a1119e8183129826f21c55cf890c00.tar.bz2
fisheye-4382a204c4a1119e8183129826f21c55cf890c00.zip
Fix breadcrumb depth and dedup nav across gallery views
getBreadcrumbLinks now walks the full gallery hierarchy recursively instead of only one level up, so deep paths like Projects > Cadogan Gardens > Source Material appear in full. Inline nav blocks in galleriffic, simple_list and auto_flow replaced with gallery_nav.tpl include (matching fixed_grid). User/Galleries editor link in gallery_nav.tpl now guarded by hasUpdatePermission. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
-rwxr-xr-xgallery_views/auto_flow/fisheye_auto_flow_inc.tpl2
-rwxr-xr-xgallery_views/galleriffic/fisheye_galleriffic_inc_1.tpl15
-rwxr-xr-xgallery_views/galleriffic/fisheye_galleriffic_inc_5.tpl16
-rwxr-xr-xgallery_views/simple_list/fisheye_simple_list_inc.tpl13
-rwxr-xr-xincludes/classes/FisheyeBase.php23
-rwxr-xr-xtemplates/gallery_nav.tpl16
6 files changed, 36 insertions, 49 deletions
diff --git a/gallery_views/auto_flow/fisheye_auto_flow_inc.tpl b/gallery_views/auto_flow/fisheye_auto_flow_inc.tpl
index 59e48c9..366b518 100755
--- a/gallery_views/auto_flow/fisheye_auto_flow_inc.tpl
+++ b/gallery_views/auto_flow/fisheye_auto_flow_inc.tpl
@@ -1,5 +1,5 @@
{strip}
-{* include file="bitpackage:fisheye/gallery_nav.tpl" *}
+{include file="bitpackage:fisheye/gallery_nav.tpl"}
<div class="display fisheye container">
<div class="header col-xs-12">
{include file="bitpackage:fisheye/gallery_icons_inc.tpl"}
diff --git a/gallery_views/galleriffic/fisheye_galleriffic_inc_1.tpl b/gallery_views/galleriffic/fisheye_galleriffic_inc_1.tpl
index a1b4862..5b4c878 100755
--- a/gallery_views/galleriffic/fisheye_galleriffic_inc_1.tpl
+++ b/gallery_views/galleriffic/fisheye_galleriffic_inc_1.tpl
@@ -1,19 +1,10 @@
-{strip}<div class="galleriffic">
+{strip}
+{include file="bitpackage:fisheye/gallery_nav.tpl"}
+<div class="galleriffic">
<div class="header">
{include file="bitpackage:fisheye/gallery_icons_inc.tpl"}
<h1>{$gContent->getTitle()|escape}</h1>
- <nav>
- {assign var=breadCrumbs value=$gContent->getBreadcrumbLinks(1)}
- <ol class="breadcrumb">
- {if $breadCrumbs}
- {foreach from=$breadCrumbs item=breadTitle key=breadId}
- {if $breadId==$gContent->mGalleryId}<li class="active">{$breadTitle}</li>
- {else}<li><a href="{$smarty.const.FISHEYE_PKG_URL}gallery/{$breadId}">{$breadTitle}</a></li>{/if}
- {/foreach}
- {/if}
- </ol>
- </nav>
</div>
diff --git a/gallery_views/galleriffic/fisheye_galleriffic_inc_5.tpl b/gallery_views/galleriffic/fisheye_galleriffic_inc_5.tpl
index b9fc17f..7613940 100755
--- a/gallery_views/galleriffic/fisheye_galleriffic_inc_5.tpl
+++ b/gallery_views/galleriffic/fisheye_galleriffic_inc_5.tpl
@@ -1,20 +1,10 @@
-{strip}<div class="galleriffic">
+{strip}
+{include file="bitpackage:fisheye/gallery_nav.tpl"}
+<div class="galleriffic">
<div class="header">
{include file="bitpackage:fisheye/gallery_icons_inc.tpl"}
<h1>{$gContent->getTitle()|escape}</h1>
- <nav>
- {assign var=breadCrumbs value=$gContent->getBreadcrumbLinks(1)}
- <ol class="breadcrumb">
- <li>{displayname user=$gContent->mInfo.creator_user user_id=$gContent->mInfo.creator_user_id|default:0 real_name=$gContent->mInfo.creator_real_name} :: <a href="{$smarty.const.FISHEYE_PKG_URL}?user_id={$gContent->mInfo.user_id}">{tr}Galleries{/tr}</a></li>
- {if $breadCrumbs}
- {foreach from=$breadCrumbs item=breadTitle key=breadId}
- {if $breadId==$gContent->mGalleryId}<li class="active">{$breadTitle}</li>
- {else}<li><a href="{$smarty.const.FISHEYE_PKG_URL}gallery/{$breadId}">{$breadTitle}</a></li>{/if}
- {/foreach}
- {/if}
- </ol>
- </nav>
</div>
diff --git a/gallery_views/simple_list/fisheye_simple_list_inc.tpl b/gallery_views/simple_list/fisheye_simple_list_inc.tpl
index 9536093..997416f 100755
--- a/gallery_views/simple_list/fisheye_simple_list_inc.tpl
+++ b/gallery_views/simple_list/fisheye_simple_list_inc.tpl
@@ -1,18 +1,7 @@
+{include file="bitpackage:fisheye/gallery_nav.tpl"}
<div class="header">
{include file="bitpackage:fisheye/gallery_icons_inc.tpl"}
<h1>{$gContent->getTitle()|escape}</h1>
- <nav>
- {assign var=breadCrumbs value=$gContent->getBreadcrumbLinks(1)}
- <ol class="breadcrumb">
- <li>{displayname user=$gContent->mInfo.creator_user user_id=$gContent->mInfo.creator_user_id|default:0 real_name=$gContent->mInfo.creator_real_name} :: <a href="{$smarty.const.FISHEYE_PKG_URL}?user_id={$gContent->mInfo.user_id}">{tr}Galleries{/tr}</a></li>
- {if $breadCrumbs}
- {foreach from=$breadCrumbs item=breadTitle key=breadId}
- {if $breadId==$gContent->mGalleryId}<li class="active">{$breadTitle}</li>
- {else}<li><a href="{$smarty.const.FISHEYE_PKG_URL}gallery/{$breadId}">{$breadTitle}</a></li>{/if}
- {/foreach}
- {/if}
- </ol>
- </nav>
</div>
{assign var=thumbsize value='small'}
diff --git a/includes/classes/FisheyeBase.php b/includes/classes/FisheyeBase.php
index f4b267c..7b29b18 100755
--- a/includes/classes/FisheyeBase.php
+++ b/includes/classes/FisheyeBase.php
@@ -158,9 +158,26 @@ not ready for primetime
//$ret['fisheye'] = $gBitSystem->getConfig('site_title');
$ret = [];
if( !$this->getField( 'gallery_path' ) ) {
- if( $this->isValid() && $parents = $this->getParentGalleries() ) {
- $gal = current( $parents );
- $this->setGalleryPath( '/'.$gal['gallery_id'] );
+ if( $this->isValid() ) {
+ $pathIds = [];
+ $currentContentId = $this->mContentId;
+ for( $depth = 0; $depth < 10; $depth++ ) {
+ $parents = $this->getParentGalleries( $currentContentId );
+ if( !$parents ) break;
+ $found = false;
+ foreach( $parents as $galleryId => $galleryData ) {
+ if( is_array( $galleryData ) && isset( $galleryData['content_id'] ) ) {
+ array_unshift( $pathIds, $galleryId );
+ $currentContentId = $galleryData['content_id'];
+ $found = true;
+ break;
+ }
+ }
+ if( !$found ) break;
+ }
+ if( $pathIds ) {
+ $this->setGalleryPath( '/'.implode( '/', $pathIds ) );
+ }
}
}
if( $this->getField( 'gallery_path' ) ) {
diff --git a/templates/gallery_nav.tpl b/templates/gallery_nav.tpl
index e3fe66d..681e3e1 100755
--- a/templates/gallery_nav.tpl
+++ b/templates/gallery_nav.tpl
@@ -3,14 +3,14 @@
<nav>
{assign var=breadCrumbs value=$gContent->getBreadcrumbLinks(1)}
<ol class="breadcrumb">
- <li>
- {if !empty($gGallery->mInfo)}
- {displayname user=$gGallery->mInfo.creator_user user_id=$gGallery->mInfo.creator_user_id|default:0 real_name=$gGallery->mInfo.creator_real_name} :: <a href="{$smarty.const.FISHEYE_PKG_URL}?user_id={$gGallery->mInfo.user_id}">Galleries</a>
- {else}
- {displayname user=$gContent->mInfo.creator_user user_id=$gContent->mInfo.creator_user_id|default:0 real_name=$gContent->mInfo.creator_real_name} :: <a href="{$smarty.const.FISHEYE_PKG_URL}?user_id={$gContent->mInfo.user_id}">Galleries</a>
- {/if}
- </li>
-
+ {if $gContent->hasUpdatePermission()}
+ {if !empty($gGallery->mInfo)}
+ {assign var=creatorInfo value=$gGallery->mInfo}
+ {else}
+ {assign var=creatorInfo value=$gContent->mInfo}
+ {/if}
+ <li>{displayname user=$creatorInfo.creator_user user_id=$creatorInfo.creator_user_id|default:0 real_name=$creatorInfo.creator_real_name} :: <a href="{$smarty.const.FISHEYE_PKG_URL}?user_id={$creatorInfo.user_id}">Galleries</a></li>
+ {/if}
{if $breadCrumbs}
{foreach from=$breadCrumbs item=breadTitle key=breadId}
{if $breadId==$gContent->mGalleryId}<li class="active">{$breadTitle}</li>