mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-06-26 03:30: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_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_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['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);
|
$this->setParams($aParamsResult);
|
||||||
return true;
|
return true;
|
||||||
|
@ -102,13 +103,14 @@ class ModuleTopic_EntityTopicType extends Entity
|
||||||
* Возвращает конкретный параметр типа
|
* Возвращает конкретный параметр типа
|
||||||
*
|
*
|
||||||
* @param string $sName
|
* @param string $sName
|
||||||
|
* @param mixed $mDefault
|
||||||
*
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function getParam($sName)
|
public function getParam($sName, $mDefault = null)
|
||||||
{
|
{
|
||||||
$aParams = $this->getParamsArray();
|
$aParams = $this->getParamsArray();
|
||||||
return isset($aParams[$sName]) ? $aParams[$sName] : null;
|
return isset($aParams[$sName]) ? $aParams[$sName] : $mDefault;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getStateText()
|
public function getStateText()
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{function syn_create item=null}
|
{function syn_create item=null}
|
||||||
<a href="{$item.url}" class="syn-create-item syn-create-item--{$item.name}">
|
<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>
|
<div class="syn-create-item-text">{$item.text}</div>
|
||||||
</a>
|
</a>
|
||||||
{/function}
|
{/function}
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{foreach $LS->Topic_GetTopicTypes() as $type}
|
{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}
|
||||||
|
|
||||||
{foreach $_menu as $item}
|
{foreach $_menu as $item}
|
||||||
|
|
Loading…
Reference in a new issue