1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-26 03:30:48 +03:00

Доработка локальных переменных в компонентах

This commit is contained in:
Denis Shakhov 2016-01-19 01:19:18 +07:00
parent 4897bfdef3
commit 70006480b3
5 changed files with 5 additions and 23 deletions

View file

@ -36,7 +36,7 @@
<div class="{$component} {cmods name=$component mods=$mods} {if $isActive}active{/if} {$smarty.local.classes}"
data-param-i-target-id="{$target->getId()}"
title="{$aLang.$component[ ($isActive) ? 'remove' : 'add' ]}"
title="{$aLang.favourite[ ($isActive) ? 'remove' : 'add' ]}"
{cattr list=$smarty.local.attributes}>
{* Кнопка добавления/удаления из избранного *}

View file

@ -9,10 +9,7 @@
*}
{$component = 'ls-poll-form-answer-item'}
{foreach [ 'item', 'index', 'allowRemove', 'showRemove', 'isTemplate' ] as $param}
{assign var="$param" value=$smarty.local.$param}
{/foreach}
{component_define_params params=[ 'item', 'index', 'allowRemove', 'showRemove', 'isTemplate' ]}
{$allowUpdate = $allowUpdate|default:true}
{$allowRemove = $allowRemove|default:true}

View file

@ -3,12 +3,7 @@
*}
{$component = 'ls-talk-message-root'}
{* Генерируем копии локальных переменных, *}
{* чтобы их можно было изменять в дочерних шаблонах *}
{foreach [ 'talk', 'mods', 'classes', 'attributes' ] as $param}
{assign var="$param" value=$smarty.local.$param}
{/foreach}
{component_define_params params=[ 'talk', 'mods', 'classes', 'attributes' ]}
<div class="{$component} {cmods name=$component mods=$mods} {$classes}" {cattr list=$attributes}>

View file

@ -8,12 +8,7 @@
*}
{$component = 'ls-topic'}
{* Генерируем копии локальных переменных, *}
{* чтобы их можно было изменять в дочерних шаблонах *}
{foreach [ 'topic', 'isPreview', 'isList', 'mods', 'classes', 'attributes' ] as $param}
{assign var="$param" value=$smarty.local.$param}
{/foreach}
{component_define_params params=[ 'topic', 'isPreview', 'isList', 'mods', 'classes', 'attributes' ]}
{$user = $topic->getUser()}
{$type = ($topic->getType()) ? $topic->getType() : $smarty.local.type}

View file

@ -5,12 +5,7 @@
*}
{$component = 'user-field-choose'}
{* Генерируем копии локальных переменных, *}
{* чтобы их можно было изменять в дочерних шаблонах *}
{foreach [ 'name', 'label', 'lang_choose', 'mods', 'classes', 'attributes' ] as $param}
{assign var="$param" value=$smarty.local.$param}
{/foreach}
{component_define_params params=[ 'name', 'label', 'lang_choose', 'mods', 'classes', 'attributes' ]}
{$label = $label|default:{lang 'user.choose.label'}}
{$lang_choose = $lang_choose|default:{lang 'user.choose.choose'}}