2014-04-28 13:12:44 +03:00
|
|
|
{**
|
|
|
|
* Выпадающее меню
|
|
|
|
*
|
2014-10-09 19:17:36 +03:00
|
|
|
* @param string text
|
|
|
|
* @param string activeItem
|
|
|
|
* @param array menu
|
2014-04-28 13:12:44 +03:00
|
|
|
*}
|
|
|
|
|
|
|
|
{* Название компонента *}
|
2014-10-09 19:17:36 +03:00
|
|
|
{$component = 'dropdown'}
|
2014-04-28 13:12:44 +03:00
|
|
|
|
2014-10-09 19:17:36 +03:00
|
|
|
{* Уникальный ID для привязки кнопки к меню *}
|
|
|
|
{$uid = "dropdown{rand( 0, 10e10 )}"}
|
2014-04-28 13:12:44 +03:00
|
|
|
|
|
|
|
{* Кнопка *}
|
2014-05-10 18:45:14 +03:00
|
|
|
{include 'components/button/button.tpl'
|
2014-10-10 19:29:24 +03:00
|
|
|
type = 'button'
|
|
|
|
classes = "{$component}-toggle {$smarty.local.classes}"
|
|
|
|
attributes = "data-{$component}-target=\"{$uid}\" {$smarty.local.attributes}"
|
|
|
|
text = $smarty.local.text}
|
2014-04-28 13:12:44 +03:00
|
|
|
|
2014-10-09 19:17:36 +03:00
|
|
|
{* Меню *}
|
2014-04-28 13:12:44 +03:00
|
|
|
{include './dropdown.menu.tpl'
|
2014-10-09 19:17:36 +03:00
|
|
|
id = $uid
|
|
|
|
activeItem = $smarty.local.activeItem
|
|
|
|
items = $smarty.local.menu}
|