mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-06-16 14:50:48 +03:00
Иконка для типов топиков #816
This commit is contained in:
parent
8a8d8f1dbf
commit
cbf1ebe391
|
@ -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()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{function syn_create item=null}
|
||||
<a href="{$item.url}" class="syn-create-item syn-create-item--{$item.name}">
|
||||
<div class="syn-create-item-image"></div>
|
||||
<div class="syn-create-item-image {$item.css_icon}"></div>
|
||||
<div class="syn-create-item-text">{$item.text}</div>
|
||||
</a>
|
||||
{/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}
|
||||
|
|
Loading…
Reference in a new issue