<?php
// defining tabs constructor
// $image = 0 text only, 1 image only, 2 image and text
$echo_tab = function ($method, $hint, $title, $image, $tab_class = '', $access_key = '', $params = null) use (&$tpl)
{
$tpl->class = $tab_class ?: ('m-' . $method);
if ($this->method === $method)
{
$tpl->active = ' active';
$tpl->enter('in_');
}
else
{
$tpl->enter('out_');
$tpl->method = ($method == 'show' ? $this->href() : $this->href($method));
$tpl->hint = $this->_t($hint);
$tpl->params = $params;
if ($access_key !== '')
{
$tpl->key = $access_key;
}
}
$image == 1 or $tpl->t_title = $this->_t($title);
$image == 0 or $tpl->t_im_title = $this->_t($title);
$tpl->leave();
};
$tpl->enter('tab_');
$echo_tab('show', 'ShowTip', 'ShowText', 1, '', 'v');
// [...] other handlers
// show more tab
$tpl->leave();
$tpl->enter('droptab_tab_');
// print tab
if ($readable)
{
$echo_tab('print', 'PrintVersion', 'PrintText', 2, '', 'v', ' target="_blank" rel="noopener"');
}
// [...] other handlers
$tpl->leave();
<ul class="submenu">
[= tab TabList =
<li class="[ ' class ' ][ ' active ' ]">
[= in _ =
<span>[ '' t TabTitle | trim '' ]</span>
=]
[= out _ =
<a href="[ ' method ' ]" title="[ ' hint ' ]"
[ ' key | e attr | enclose ' accesskey="' '"' ' ][ ' params ' ]>[ '' t TabTitle | trim '' ]</a>
=]
</li>
=]
[= droptab _ =
<li class="dropdown"><a href="#" id="handler-more">[ ' _t: PageHandlerMoreTip ' ]<span class="dropdown-arrow">▼</span></a>
<ul class="dropdown_menu">
['' tab TabList '']
['' // last empty '']
<li></li>
</ul>
</li>
=]
</ul>
3.2. Sidebar
3.2.1. toc
<?php
// side bar toc list
if ($this->db->hide_toc == 0)
{
// display the page toc list, numerated, without labels and markup
$tpl->toc_action = $this->action('toc', ['numerate' => 0, 'nomark' => 0]);
}