feat: refactorer les variables de template en expressions inline pour simplifier la logique et supprimer la variable intermédiaire isCalledFromBookmarklet

This commit is contained in:
Bruno Charest 2026-02-18 14:45:46 -05:00
parent 9150877d57
commit 65dde10291
2 changed files with 5 additions and 6 deletions

View File

@ -16,14 +16,14 @@
{$index=""}
{/if}
{$batchModeValue=empty($batch_mode) ? '0' : '1'}
{$readLaterChecked=strpos(' ' . $link.tags . ' ', ' readlater ') != false || strpos(' ' . $link.tags . ' ', ' toread ') != false}
{$noteDefaultChecked=$link_is_new && empty($link.url)}
{$noteChecked=strpos(' ' . $link.tags . ' ', ' note ') != false || $noteDefaultChecked}
{function="($readLaterChecked = strpos(' ' . $link.tags . ' ', ' readlater ') != false || strpos(' ' . $link.tags . ' ', ' toread ') != false) ? '' : ''"}
{function="($noteDefaultChecked = $link_is_new && empty($link.url)) ? '' : ''"}
{function="($noteChecked = strpos(' ' . $link.tags . ' ', ' note ') != false || $noteDefaultChecked) ? '' : ''"}
{$effectiveTags=$link.tags}
{if="$noteDefaultChecked && strpos(' ' . $effectiveTags . ' ', ' note ') == false"}
{$effectiveTags=trim($effectiveTags . ' note')}
{/if}
{$privateChecked=$link.private == true || $link_is_new}
{function="($privateChecked = $link.private == true || $link_is_new) ? '' : ''"}
<div id="editlinkform{$index}" class="editlinkform container page-edit">
<div class="row editlinkform-row">
<div class="col-md-6 col-md-offset-3 editlinkform-col">

View File

@ -1,8 +1,7 @@
<!--
Bookmarklet detection logic
{$isCalledFromBookmarklet=isset($_GET['source']) && $_GET['source'] == 'bookmarklet'}
-->
{if="$isCalledFromBookmarklet"}
{if="isset($_GET['source']) && $_GET['source'] == 'bookmarklet'"}
{ignore} When called as a popup from bookmarklet, do not display menu. {/ignore}
{else}