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:
Mzhelskiy Maxim 2015-02-06 17:20:25 +07:00
parent 557aa54258
commit 33074894f0
4 changed files with 20 additions and 8 deletions

View file

@ -1133,6 +1133,16 @@ class ModuleMedia extends ModuleORM
* Проверяем права на редактирование топика
*/
if ($this->ACL_IsAllowEditTopic($oTopic, $oUser)) {
/**
* Дополнительно возможность исползования превью (настраивается отдельно для каждого типа топика)
*/
if ($sAllowType == self::TYPE_CHECK_ALLOW_PREVIEW) {
if ($oTopicType = $this->Topic_GetTopicType($oTopic->getType())) {
if (!$oTopicType->getParam('allow_preview')) {
return false;
}
}
}
return true;
}
}

View file

@ -44,6 +44,7 @@ class ModuleTopic_EntityTopicType extends Entity
$aParams = $this->getParamsArray();
$aParamsResult['allow_poll'] = (isset($aParams['allow_poll']) and $aParams['allow_poll']) ? 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_tags'] = (isset($aParams['allow_tags']) and $aParams['allow_tags']) ? true : false;

View file

@ -101,13 +101,14 @@
{* Выбор превью *}
{component 'field' template='image-ajax'
label = 'Превью'
modalTitle = 'Выбор превью для топика'
targetType = 'topic'
targetId = ( $topic ) ? $topic->getId() : ''
classes = 'js-topic-add-field-image-preview'}
{if $type->getParam('allow_preview')}
{component 'field' template='image-ajax'
label = 'Превью'
modalTitle = 'Выбор превью для топика'
targetType = 'topic'
targetId = ( $topic ) ? $topic->getId() : ''
classes = 'js-topic-add-field-image-preview'}
{/if}
{* Вставка опросов *}
{if $type->getParam('allow_poll')}

@ -1 +1 @@
Subproject commit 2bf4cab7d3ee0c6a0e603069e97df9c555bd3b42
Subproject commit 87bd24631477cdb95952b5d57426b5b86b8b7445