From 1eb8f4812d6cb252eaef77b6ad852f297f1cb659 Mon Sep 17 00:00:00 2001 From: Denis Shakhov Date: Thu, 7 Apr 2016 14:10:49 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B5=D0=BB=D0=BA=D0=B8=D0=B5=20=D0=B8?= =?UTF-8?q?=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/frontend/components/talk/add.tpl | 8 +++---- .../components/topic/topic-add-type.tpl | 22 +++++++------------ .../frontend/components/topic/topic-type.tpl | 17 +++++++------- framework | 2 +- 4 files changed, 21 insertions(+), 28 deletions(-) diff --git a/application/frontend/components/talk/add.tpl b/application/frontend/components/talk/add.tpl index eca332e0..4777cb94 100644 --- a/application/frontend/components/talk/add.tpl +++ b/application/frontend/components/talk/add.tpl @@ -11,11 +11,11 @@ {* Получатели *} {component 'user' template='choose' - items = ($recepient) ? [[ 'text' => $recepient->getLogin(), 'value' => $recepient->getId() ]] : null - selectedValue = ($recepient) ? $recepient->getId() : null - form = ($_aRequest['talk_recepient_id']) ? null : $_aRequest + items = ($recepient) ? [[ 'text' => $recepient->getLogin(), 'value' => $recepient->getId() ]] : false + selectedValue = ($recepient) ? $recepient->getId() : false + form = ($_aRequest['talk_recepient_id']) ? false : $_aRequest name = 'talk_users[]' - rules = [ 'required' => true, 'rangetags' => '[1,99]' ] + rules = [ 'required' => true ] classes = 'js-talk-add-user-choose' label = {lang 'talk.add.fields.users.label'} lang_choose = {lang 'talk.add.choose_friends'}} diff --git a/application/frontend/components/topic/topic-add-type.tpl b/application/frontend/components/topic/topic-add-type.tpl index 65cf7f82..deaea373 100644 --- a/application/frontend/components/topic/topic-add-type.tpl +++ b/application/frontend/components/topic/topic-add-type.tpl @@ -5,22 +5,16 @@ * @param boolean $isPreview *} -{$type = $smarty.local.type} +{component_define_params params=[ 'topic', 'type', 'blogs', 'blogId', 'skipBlogs', 'mods', 'classes', 'attributes' ]} + {$typeCode = $type->getCode()} -{if $LS->Topic_IsAllowTopicType( $typeCode )} - {$template = $LS->Component_GetTemplatePath('topic', "topic-add-type-{$typeCode}" )} +{if $LS->Topic_IsAllowTopicType($typeCode)} + {$template = $LS->Component_GetTemplatePath('topic', "topic-add-type-{$typeCode}")} - {* Если для указанного типа существует шаблон, то подключаем его *} - {* Иначе подключаем дефолтный шаблон топика *} - {if ! $template} - {$template = $LS->Component_GetTemplatePath('topic', 'add')} + {if $template} + {component "topic.topic-add-type-$typeCode" params=$params} + {else} + {component 'topic.add' params=$params} {/if} - - {include "$template" - topic=$smarty.local.topic - type=$smarty.local.type - blogs=$smarty.local.blogs - blogId=$smarty.local.blogId - skipBlogs=$smarty.local.skipBlogs } {/if} \ No newline at end of file diff --git a/application/frontend/components/topic/topic-type.tpl b/application/frontend/components/topic/topic-type.tpl index f6e0f0f5..99c51fcb 100644 --- a/application/frontend/components/topic/topic-type.tpl +++ b/application/frontend/components/topic/topic-type.tpl @@ -5,17 +5,16 @@ * @param boolean $isPreview *} -{$topic = $smarty.local.topic} +{component_define_params params=[ 'topic', 'isPreview', 'isList', 'mods', 'classes', 'attributes' ]} + {$type = $topic->getType()} -{if $LS->Topic_IsAllowTopicType( $type )} - {$template = $LS->Component_GetTemplatePath('topic', "topic-type-{$type}" )} +{if $LS->Topic_IsAllowTopicType($type)} + {$template = $LS->Component_GetTemplatePath('topic', "topic-type-{$type}")} - {* Если для указанного типа существует шаблон, то подключаем его *} - {* Иначе подключаем дефолтный шаблон топика *} - {if ! $template} - {$template = $LS->Component_GetTemplatePath('topic', 'topic')} + {if $template} + {component "topic.topic-type-$type" params=$params} + {else} + {component 'topic' params=$params} {/if} - - {include "$template" topic=$topic isList=$smarty.local.isList isPreview=$smarty.local.isPreview} {/if} \ No newline at end of file diff --git a/framework b/framework index 90265e4b..8410a744 160000 --- a/framework +++ b/framework @@ -1 +1 @@ -Subproject commit 90265e4bcb27ef33eea7b2192cd978750f6fb00d +Subproject commit 8410a744b062f67347e67b1fff81e29b0a4bbff3