mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-07-05 07:54:24 +03:00
26 lines
720 B
Smarty
26 lines
720 B
Smarty
{**
|
|
* Выпадающее меню
|
|
*
|
|
* @param string text
|
|
* @param string activeItem
|
|
* @param array menu
|
|
*}
|
|
|
|
{* Название компонента *}
|
|
{$component = 'dropdown'}
|
|
|
|
{* Уникальный ID для привязки кнопки к меню *}
|
|
{$uid = "dropdown{rand( 0, 10e10 )}"}
|
|
|
|
{* Кнопка *}
|
|
{include 'components/button/button.tpl'
|
|
type = 'button'
|
|
classes = "{$component}-toggle {$smarty.local.classes}"
|
|
attributes = "data-{$component}-target=\"{$uid}\" {$smarty.local.attributes}"
|
|
text = $smarty.local.text}
|
|
|
|
{* Меню *}
|
|
{include './dropdown.menu.tpl'
|
|
id = $uid
|
|
activeItem = $smarty.local.activeItem
|
|
items = $smarty.local.menu} |