[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Show Files button for anonymous users on wiki pages

Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68dd3ef38f362_2cdeddc41169@gitlab-sidekiq-low-urgency-cpu-bound-v2-775f66d5d7-vx5pm.mail>

Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
5e0ccbf0 by Yves Ngalamulume at 2025-10-01T14:38:34+00:00
[FIX] Show Files button for anonymous users on wiki pages
---
* [FIX] Show Files button for anonymous users on wiki pages

See merge request tikiwiki/tiki!8656

- - - - -


1 changed file:

- templates/tiki-page_bar.tpl


Changes:

=====================================
templates/tiki-page_bar.tpl
=====================================
@@ -151,30 +151,19 @@
 
             {if isset($show_page) and $show_page eq 'y'}
                 {* don't show attachments button if feature disabled or no corresponding rights or no attached files and r/o*}
-
                 {if $prefs.feature_wiki_attachments == 'y'
                     && (
-                        $tiki_p_wiki_view_attachments == 'y'
-                        && (isset($atts_count) && $atts_count gt 0)
+                        ($tiki_p_wiki_view_attachments == 'y' && $atts_count|default:0 > 0)
                         || $tiki_p_wiki_attach_files == 'y'
                         || $tiki_p_wiki_admin_attachments == 'y')}
-
                     {capture assign=thistext}
                         {strip}
-                            {if (!isset($atts_count) or $atts_count == 0) || $tiki_p_wiki_attach_files == 'y'
-                                && $tiki_p_wiki_view_attachments == 'n' && $tiki_p_wiki_admin_attachments == 'n'}
-                                {tr}Files{/tr}
-                            {else}
-                                {tr}Files{/tr}
-                                &nbsp;<span class="atts_count badge bg-info">{$atts_count}</span>
-                            {/if}
+                            {tr}Files{/tr}
+                            <span class="atts_count badge bg-info">{$atts_count|default:0}</span>
                         {/strip}
                     {/capture}
-
-                    {if (isset($atts_count) and $atts_count gt 0) || $editable}
-                        {button href="#attachments" _flip_id="attzone{if isset($pagemd5)}{$pagemd5}{/if}" _type="secondary mb-2" _text=$thistext _flip_default_open=$prefs.w_displayed_default _flip_hide_text="n"}
-                    {/if}
-                {/if}{* attachments *}
+                    {button href="#attachments" _flip_id="attzone{if isset($pagemd5)}{$pagemd5}{/if}" _type="secondary mb-2" _text=$thistext _flip_default_open=$prefs.w_displayed_default _flip_hide_text="n"}
+                {/if} {* attachments *}
 
             {/if}
             {if $more_section|trim neq ''}



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/5e0ccbf069a4a3934b87b3a2e6d2db1cb3a2b796

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/5e0ccbf069a4a3934b87b3a2e6d2db1cb3a2b796
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.