Do not show a tab if the content is falsy
There may be occasions where plugin does not wish to show any output for the current user/page. In that case the tab should not be shown at all. SPR-895
This commit is contained in:
parent
45129fb497
commit
e5d40c9a7e
1 changed files with 6 additions and 0 deletions
|
@ -9,6 +9,9 @@ $tabs = \dokuwiki\template\sprintdoc\Template::getInstance()->getMetaBoxTabs();
|
||||||
<li class="a11y"> </li>
|
<li class="a11y"> </li>
|
||||||
<?php
|
<?php
|
||||||
foreach($tabs as $tab) {
|
foreach($tabs as $tab) {
|
||||||
|
if (empty($tab['tab']) || trim($tab['tab']) === '') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
echo '<li>';
|
echo '<li>';
|
||||||
echo '<a href="#' . $tab['id'] . '" aria-expanded="false">';
|
echo '<a href="#' . $tab['id'] . '" aria-expanded="false">';
|
||||||
echo '<span class="prefix">';
|
echo '<span class="prefix">';
|
||||||
|
@ -27,6 +30,9 @@ $tabs = \dokuwiki\template\sprintdoc\Template::getInstance()->getMetaBoxTabs();
|
||||||
<div class="box-content">
|
<div class="box-content">
|
||||||
<?php
|
<?php
|
||||||
foreach($tabs as $tab) {
|
foreach($tabs as $tab) {
|
||||||
|
if (empty($tab['tab']) || trim($tab['tab']) === '') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
echo '<div id="' . $tab['id'] . '" class="tab-pane" aria-hidden="true">';
|
echo '<div id="' . $tab['id'] . '" class="tab-pane" aria-hidden="true">';
|
||||||
echo $tab['tab'];
|
echo $tab['tab'];
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue