Ver código fonte

Update Admin\Parser\BBCode page

Do not generate delete links for BB codes that cannot be deleted.
Visman 3 anos atrás
pai
commit
b99594a9e5

+ 3 - 6
app/Models/Pages/Admin/Parser/BBCode.php

@@ -184,12 +184,9 @@ class BBCode extends Parser
                 'value'     => '❌',
                 'caption'   => 'Delete',
                 'title'     => __('Delete'),
-                'link'      => $this->c->Router->link(
-                    'AdminBBCodeDelete',
-                    [
-                        'id' => $id,
-                    ]
-                ),
+                'link'      => 1 === $tagData['bb_delete']
+                    ? $this->c->Router->link('AdminBBCodeDelete', ['id' => $id])
+                    : null,
                 'disabled'  => 1 !== $tagData['bb_delete'],
             ];
 

+ 1 - 1
app/templates/layouts/form.forkbb.php

@@ -79,7 +79,7 @@
                 @elseif ('password' === $cur['type'])
                 <input @if ($cur['required']) required @endif @if ($cur['disabled']) disabled @endif @if ($cur['autofocus']) autofocus @endif class="f-ctrl" id="id-{{ $key }}" name="{{ $key }}" type="password" @if ($cur['maxlength']) maxlength="{{ $cur['maxlength'] }}" @endif @if ($cur['pattern']) pattern="{{ $cur['pattern'] }}" @endif @isset ($cur['value']) value="{{ $cur['value'] }}" @endisset>
                 @elseif ('btn' === $cur['type'])
-                <a class="f-btn f-ybtn @if ($cur['disabled']) f-disabled @endif" href="{{ $cur['link'] }}" title="{{ $cur['title'] or '' }}" @if ($cur['disabled']) tabindex="-1" @endif>{{ $cur['value'] }}</a>
+                <a class="f-btn f-ybtn @if ($cur['disabled']) f-disabled @endif" href="{{ $cur['link'] or '' }}" title="{{ $cur['title'] or '' }}" @if ($cur['disabled']) tabindex="-1" @endif>{{ $cur['value'] }}</a>
                 @elseif ('str' === $cur['type'])
                 <p class="f-str" id="id-{{ $key }}"> @if ($cur['html']){!! $cur['value'] !!} @else{{ $cur['value'] }} @endif</p>
                 @elseif ('link' === $cur['type'])