new: [index top bar] added element to act as a text replacement field instead of a button

pull/7374/head
iglocska 2021-04-27 00:38:03 +02:00
parent 5f2263a823
commit 1cda8aa5ac
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,19 @@
<?php
if (!isset($data['requirement']) || $data['requirement']) {
echo sprintf(
'<span class="btn btn-small disabled %s" %s %s %s>%s%s%s %s</span>',
empty($data['class']) ? '' : h($data['class']),
empty($data['title']) ? '' : sprintf('title="%s"', h($data['title'])),
empty($data['style']) ? '' : sprintf('style="%s"', h($data['style'])),
!empty($data['text']) ? '' : (!empty($data['title']) ? sprintf('aria-label="%s"', h($data['title'])) : ''),
empty($data['fa-icon']) ? '' : sprintf(
'<i class="%s fa-%s"></i> ',
empty($data['fa-source']) ? 'fas' : h($data['fa-source']),
$data['fa-icon']
), // this has to be sanitised beforehand!
empty($data['html']) ? '' : $data['html'], // this has to be sanitised beforehand!
empty($data['text']) ? '' : h($data['text']),
empty($data['badge']) ? '' : sprintf('<span class="badge badge-%s">%s</span>', empty($data['badge']['type']) ? 'info' : $data['badge']['type'], h($data['badge']['text']))
);
}
?>