2014-03-04 10:34:05 +02:00
|
|
|
{**
|
|
|
|
* Блок сортировки
|
|
|
|
*
|
2014-11-25 10:13:17 +02:00
|
|
|
* @param array $items
|
|
|
|
* @param string $label
|
|
|
|
* @param boolean $showLabel
|
2014-03-04 10:34:05 +02:00
|
|
|
*}
|
|
|
|
|
2015-05-20 19:26:11 +03:00
|
|
|
{$component = 'ls-sort'}
|
2014-11-25 10:13:17 +02:00
|
|
|
|
2015-01-27 15:48:47 +02:00
|
|
|
{$items = $smarty.local.items}
|
2015-05-20 19:26:11 +03:00
|
|
|
{$classes = "{$smarty.local.classes} {$component}"}
|
2014-11-25 10:13:17 +02:00
|
|
|
|
2015-01-27 15:48:47 +02:00
|
|
|
{foreach $items as $item}
|
|
|
|
{$items[ $item@key ][ 'attributes' ] = array_merge( $items[ $item@key ][ 'attributes' ]|default:[], [
|
|
|
|
'data-name' => 'sort_by',
|
|
|
|
'data-value' => $item[ 'name' ],
|
|
|
|
'data-order' => $item[ 'order' ]|default:'desc'
|
|
|
|
])}
|
|
|
|
{/foreach}
|
2014-03-04 10:34:05 +02:00
|
|
|
|
2015-01-27 15:48:47 +02:00
|
|
|
{component 'button' template='group' classes=$classes params=$smarty.local.params buttons=[
|
|
|
|
[ 'text' => $smarty.local.label|default:$aLang.sort.label, 'isDisabled' => true ],
|
|
|
|
{component 'dropdown'
|
|
|
|
text = $smarty.local.text|default:'...'
|
|
|
|
classes = 'js-dropdown-default'
|
|
|
|
attributes = [ 'data-lsdropdown-selectable' => 'true' ]
|
|
|
|
menu = $items}
|
|
|
|
]}
|