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:
Michael Große 2017-03-16 13:25:51 +01:00
commit e5d40c9a7e
No known key found for this signature in database
GPG key ID: 7E31028FBFEACC79

View file

@ -9,6 +9,9 @@ $tabs = \dokuwiki\template\sprintdoc\Template::getInstance()->getMetaBoxTabs();
<li class="a11y">&nbsp;</li>
<?php
foreach($tabs as $tab) {
if (empty($tab['tab']) || trim($tab['tab']) === '') {
continue;
}
echo '<li>';
echo '<a href="#' . $tab['id'] . '" aria-expanded="false">';
echo '<span class="prefix">';
@ -27,6 +30,9 @@ $tabs = \dokuwiki\template\sprintdoc\Template::getInstance()->getMetaBoxTabs();
<div class="box-content">
<?php
foreach($tabs as $tab) {
if (empty($tab['tab']) || trim($tab['tab']) === '') {
continue;
}
echo '<div id="' . $tab['id'] . '" class="tab-pane" aria-hidden="true">';
echo $tab['tab'];
echo '</div>';