From b61dddb5aba46811056dedade397fb074e58c432 Mon Sep 17 00:00:00 2001 From: Lester Caine Date: Sun, 24 May 2026 17:22:09 +0100 Subject: Add per-gallery show_description preference to all active gallery views Galleries can now suppress their description text via a checkbox in the edit form (defaults to shown). All active view templates (galleriffic, fixed_grid, auto_flow, position_number, simple_list) respect the preference. Co-Authored-By: Claude Sonnet 4.6 --- edit.php | 1 + gallery_views/auto_flow/fisheye_auto_flow_inc.tpl | 6 ++++++ gallery_views/fixed_grid/fisheye_fixed_grid_inc.tpl | 7 +++++++ gallery_views/fixed_grid/fisheye_fixed_grid_inc2.tpl | 2 +- gallery_views/fixed_grid/fisheye_fixed_grid_inc3.tpl | 2 +- gallery_views/galleriffic/fisheye_galleriffic_inc_1.tpl | 5 +++++ gallery_views/galleriffic/fisheye_galleriffic_inc_5.tpl | 5 +++++ gallery_views/position_number/fisheye_position_number_inc.tpl | 6 ++++++ gallery_views/simple_list/fisheye_simple_list_inc.tpl | 6 ++++++ templates/edit_gallery.tpl | 7 +++++++ 10 files changed, 45 insertions(+), 2 deletions(-) diff --git a/edit.php b/edit.php index 92a861b..9cb90f6 100755 --- a/edit.php +++ b/edit.php @@ -47,6 +47,7 @@ if( !empty( $_REQUEST['savegallery'] ) ) { $gContent->storePreference( 'link_original_images', !empty( $_REQUEST['link_original_images'] ) ? $_REQUEST['link_original_images'] : null ); $gContent->storePreference( 'total_per_page', !empty( $_REQUEST['total_per_page'] ) ? (int)$_REQUEST['total_per_page'] : null ); $gContent->storePreference( 'galleriffic_num_thumbs', !empty( $_REQUEST['galleriffic_num_thumbs'] ) ? (int)$_REQUEST['galleriffic_num_thumbs'] : null ); + $gContent->storePreference( 'show_description', !empty( $_REQUEST['show_description'] ) ? 'y' : 'n' ); // make sure var is fully stuffed with current data $gContent->load(); // set the mappings, or if nothing checked, nuke them all diff --git a/gallery_views/auto_flow/fisheye_auto_flow_inc.tpl b/gallery_views/auto_flow/fisheye_auto_flow_inc.tpl index 366b518..b8a1be0 100755 --- a/gallery_views/auto_flow/fisheye_auto_flow_inc.tpl +++ b/gallery_views/auto_flow/fisheye_auto_flow_inc.tpl @@ -6,6 +6,12 @@

{$gContent->getTitle()|escape}

+ {if $gContent->mInfo.data && $gContent->getPreference('show_description') ne 'n'} +
+

{$gContent->mInfo.data|escape}

+
+ {/if} +
{formfeedback success=$fisheyeSuccess error=$fisheyeErrors warning=$fisheyeWarnings} diff --git a/gallery_views/fixed_grid/fisheye_fixed_grid_inc.tpl b/gallery_views/fixed_grid/fisheye_fixed_grid_inc.tpl index 925ce95..8c4e032 100755 --- a/gallery_views/fixed_grid/fisheye_fixed_grid_inc.tpl +++ b/gallery_views/fixed_grid/fisheye_fixed_grid_inc.tpl @@ -5,6 +5,13 @@ {include file="bitpackage:fisheye/gallery_icons_inc.tpl"}

{$gContent->getTitle()|escape}

+ + {if $gContent->mInfo.data && $gContent->getPreference('show_description') ne 'n'} +
+

{$gContent->mInfo.data|escape}

+
+ {/if} +
{if $gContent->mGalleryId != 0} diff --git a/gallery_views/fixed_grid/fisheye_fixed_grid_inc2.tpl b/gallery_views/fixed_grid/fisheye_fixed_grid_inc2.tpl index da2daa7..48ac28c 100755 --- a/gallery_views/fixed_grid/fisheye_fixed_grid_inc2.tpl +++ b/gallery_views/fixed_grid/fisheye_fixed_grid_inc2.tpl @@ -14,7 +14,7 @@ {/if} {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='body' serviceHash=$gContent->mInfo} - {if $gContent->mInfo.data} + {if $gContent->mInfo.data && $gContent->getPreference('show_description') ne 'n'}

{$gContent->mInfo.data|escape}

{/if} diff --git a/gallery_views/fixed_grid/fisheye_fixed_grid_inc3.tpl b/gallery_views/fixed_grid/fisheye_fixed_grid_inc3.tpl index b55a966..6df08a5 100755 --- a/gallery_views/fixed_grid/fisheye_fixed_grid_inc3.tpl +++ b/gallery_views/fixed_grid/fisheye_fixed_grid_inc3.tpl @@ -10,7 +10,7 @@ {formfeedback success=$fisheyeSuccess error=$fisheyeErrors warning=$fisheyeWarnings} {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='body' serviceHash=$gContent->mInfo} - {if $gContent->mInfo.data} + {if $gContent->mInfo.data && $gContent->getPreference('show_description') ne 'n'}

{$gContent->mInfo.data|escape}

{/if} diff --git a/gallery_views/galleriffic/fisheye_galleriffic_inc_1.tpl b/gallery_views/galleriffic/fisheye_galleriffic_inc_1.tpl index 5b4c878..d4fcf85 100755 --- a/gallery_views/galleriffic/fisheye_galleriffic_inc_1.tpl +++ b/gallery_views/galleriffic/fisheye_galleriffic_inc_1.tpl @@ -7,6 +7,11 @@

{$gContent->getTitle()|escape}

+{if $gContent->mInfo.data && $gContent->getPreference('show_description') ne 'n'} +
+

{$gContent->mInfo.data|escape}

+
+{/if} +{if $gContent->mInfo.data && $gContent->getPreference('show_description') ne 'n'} +
+

{$gContent->mInfo.data|escape}

+
+{/if} + {if $gContent->mInfo.data && $gContent->getPreference('show_description') ne 'n'} +
+

{$gContent->mInfo.data|escape}

+
+ {/if} +
{formfeedback success=$fisheyeSuccess error=$fisheyeErrors warning=$fisheyeWarnings} diff --git a/gallery_views/simple_list/fisheye_simple_list_inc.tpl b/gallery_views/simple_list/fisheye_simple_list_inc.tpl index 997416f..3b6c68c 100755 --- a/gallery_views/simple_list/fisheye_simple_list_inc.tpl +++ b/gallery_views/simple_list/fisheye_simple_list_inc.tpl @@ -4,6 +4,12 @@

{$gContent->getTitle()|escape}

+{if $gContent->mInfo.data && $gContent->getPreference('show_description') ne 'n'} +
+

{$gContent->mInfo.data|escape}

+
+{/if} + {assign var=thumbsize value='small'}
diff --git a/templates/edit_gallery.tpl b/templates/edit_gallery.tpl index 309a9fe..06bfacd 100755 --- a/templates/edit_gallery.tpl +++ b/templates/edit_gallery.tpl @@ -51,6 +51,13 @@ document.addEventListener('DOMContentLoaded', updateGalleryPagination); {/forminput} +
+ {forminput label="checkbox"} + getPreference('show_description') ne 'n'}checked="checked"{/if} />{tr}Show Description{/tr} + {formhelp note="Display the gallery description text below the gallery header."} + {/forminput} +
+ {if $gBitUser->hasPermission('p_fisheye_create_public_gal')}
{forminput label="checkbox"} -- cgit v1.3
{tr}List of files{/tr} [ {$galInfo.total_records|default:0} ]