From cbf1ebe391424da3ee9f9c5dd9e7051267d9d973 Mon Sep 17 00:00:00 2001 From: Mzhelskiy Maxim Date: Fri, 27 Jan 2017 12:53:22 +0700 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=BA=D0=BE=D0=BD=D0=BA=D0=B0=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D1=82=D0=B8=D0=BF=D0=BE=D0=B2=20=D1=82=D0=BE?= =?UTF-8?q?=D0=BF=D0=B8=D0=BA=D0=BE=D0=B2=20#816?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../classes/modules/topic/entity/TopicType.entity.class.php | 6 ++++-- .../frontend/skin/synio/components/syn-create/create.tpl | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/application/classes/modules/topic/entity/TopicType.entity.class.php b/application/classes/modules/topic/entity/TopicType.entity.class.php index eb224f24..bb802dc7 100644 --- a/application/classes/modules/topic/entity/TopicType.entity.class.php +++ b/application/classes/modules/topic/entity/TopicType.entity.class.php @@ -47,6 +47,7 @@ class ModuleTopic_EntityTopicType extends Entity $aParamsResult['allow_preview'] = (isset($aParams['allow_preview']) and $aParams['allow_preview']) ? true : false; $aParamsResult['allow_text'] = (isset($aParams['allow_text']) and $aParams['allow_text']) ? true : false; $aParamsResult['allow_tags'] = (isset($aParams['allow_tags']) and $aParams['allow_tags']) ? true : false; + $aParamsResult['css_icon'] = (isset($aParams['css_icon']) and is_string($aParams['css_icon']) and $aParams['css_icon']) ? htmlspecialchars($aParams['css_icon']) : null; $this->setParams($aParamsResult); return true; @@ -102,13 +103,14 @@ class ModuleTopic_EntityTopicType extends Entity * Возвращает конкретный параметр типа * * @param string $sName + * @param mixed $mDefault * * @return null */ - public function getParam($sName) + public function getParam($sName, $mDefault = null) { $aParams = $this->getParamsArray(); - return isset($aParams[$sName]) ? $aParams[$sName] : null; + return isset($aParams[$sName]) ? $aParams[$sName] : $mDefault; } public function getStateText() diff --git a/application/frontend/skin/synio/components/syn-create/create.tpl b/application/frontend/skin/synio/components/syn-create/create.tpl index d828e52e..1dc8a24f 100644 --- a/application/frontend/skin/synio/components/syn-create/create.tpl +++ b/application/frontend/skin/synio/components/syn-create/create.tpl @@ -1,6 +1,6 @@ {function syn_create item=null} -
+
{$item.text}
{/function} @@ -17,7 +17,7 @@ {/if} {foreach $LS->Topic_GetTopicTypes() as $type} - {syn_create item=[ 'name' => $type->getCode(), 'text' => $type->getName(), 'url' => $type->getUrlForAdd() ]} + {syn_create item=[ 'name' => $type->getCode(), 'css_icon' => $type->getParam('css_icon', 'fa fa-file-text-o'), 'text' => $type->getName(), 'url' => $type->getUrlForAdd() ]} {/foreach} {foreach $_menu as $item}