1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-16 21:34:25 +03:00
ifhub.club/application/frontend/skin/developer/components/actionbar/actionbar-item.select.tpl
2014-11-05 22:45:27 +07:00

36 lines
1.3 KiB
Smarty

{**
* Экшнбар / Контрол выбора объектов
*
* @param string $target
* @param string $items
*
* @extends {actionbar}/actionbar-item
*}
{extends './actionbar-item.tpl'}
{block 'actionbar_item'}
{$target = $smarty.local.target}
{* Дефолтные пункты меню *}
{$menu = [
[ 'name' => 'all', 'text' => {lang 'actionbar.select.menu.all'}, 'data' => [ 'select-item' => $target ] ],
[ 'name' => 'deselect', 'text' => {lang 'actionbar.select.menu.deselect'}, 'data' => [ 'select-item' => $target, 'select-filter' => ':not(*)' ] ],
[ 'name' => 'invert', 'text' => {lang 'actionbar.select.menu.invert'}, 'data' => [ 'select-item' => $target, 'select-filter' => ':not(.selected)' ] ],
[ 'name' => '-', 'is_enabled' => !! $smarty.local.items ]
]}
{* Добавляем кастомные пункты меню *}
{foreach $smarty.local.items as $item}
{$menu[] = [
'text' => $item['text'],
'data' => [ 'select-item' => $target, 'select-filter' => $item['filter'] ]
]}
{/foreach}
{* Выпадающее меню *}
{include 'components/dropdown/dropdown.tpl'
classes = "actionbar-item-link {$smarty.local.classes}"
text = {lang 'actionbar.select.title'}
menu = $menu}
{/block}