chevereto-free/app/themes/Peafowl/snippets/tabs.php

28 lines
932 B
PHP
Raw Normal View History

2016-08-18 20:39:31 +00:00
<?php if(!defined('access') or !access) die('This file cannot be directly accessed.'); ?>
<?php
$tabs = (array) (G\get_global('tabs') ? G\get_global('tabs') : (function_exists('get_tabs') ? get_tabs() : NULL));
$current;
foreach($tabs as $tab) {
if($tab["current"]) {
$current = $tab;
break;
}
}
?>
<div class="phone-show hidden tab-menu current" data-action="tab-menu"><span data-content="current-tab-label"><?php echo $current["label"]; ?></span><span class="icon icon-menu4 margin-left-5"></span></div>
<ul class="content-tabs phone-hide">
<?php
foreach($tabs as $tab) {
$echo = [
'<li class="' . (isset($tab['class']) ? $tab['class'] : '') . ' ' .($tab["current"] ? 'current' : '') . '">',
'<a ',
$tab['id'] ? ('id="' . $tab['id'] . '-link" data-tab="' . $tab["id"] . '"' ) : '',
'href="' . $tab['url'] . '">',
$tab["label"],
'</a></li>'."\n"
];
echo implode('', $echo);
}
?>
</ul>