Update Admin\Parser\BBCode page

Do not generate delete links for BB codes that cannot be deleted.
This commit is contained in:
Visman 2021-11-22 20:18:29 +07:00
parent 655d1a8a80
commit b99594a9e5
2 changed files with 4 additions and 7 deletions

View file

@ -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'],
];

View file

@ -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'])