mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-06-16 23:00:51 +03:00
Возможность задавать кастомные шаблоны для рендеринга дополнительных полей
This commit is contained in:
parent
4003e1e487
commit
90450b7f5b
|
@ -197,6 +197,7 @@ class ModuleProperty_EntityValueTypeFile extends ModuleProperty_EntityValueType
|
|||
}
|
||||
}
|
||||
}
|
||||
$aParams['access_only_auth']=isset($aParamsRaw['access_only_auth']) ? true : false;
|
||||
|
||||
return $aParams;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
<div class="property-list-item">
|
||||
<div class="property-list-item-label">{$oPropertyItem->getTitle()}</div>
|
||||
<strong class="property-list-item-content">{$oPropertyItem->getValue()->getValueForDisplay()}</strong>
|
||||
</div>
|
|
@ -0,0 +1,9 @@
|
|||
{$oValue=$oPropertyItem->getValue()}
|
||||
<div class="property-list-item">
|
||||
<div class="property-list-item-label">{$oPropertyItem->getTitle()}</div>
|
||||
{if $oUserCurrent or !$oPropertyItem->getParam('access_only_auth')}
|
||||
<a href="{router page="property/download"}{$oValue->getId()}/">{$oValue->getValueForDisplay()}</a>
|
||||
{else}
|
||||
Для доступа к файлу <a href="#" class="js-modal-toggle-login">необходимо авторизоваться</a>
|
||||
{/if}
|
||||
</div>
|
16
application/frontend/skin/developer/property/render.item.tpl
Normal file
16
application/frontend/skin/developer/property/render.item.tpl
Normal file
|
@ -0,0 +1,16 @@
|
|||
{if $oPropertyItem}
|
||||
{* Проверяем наличие катомного шаблона item.[type].[target_type].tpl *}
|
||||
{$sTemplateType="property/item.{$oPropertyItem->getType()}.{$oPropertyItem->getTargetType()}.tpl"}
|
||||
{if $LS->Viewer_TemplateExists($sTemplateType)}
|
||||
{include $sTemplateType}
|
||||
{else}
|
||||
{* Проверяем наличие катомного шаблона item.[type].tpl *}
|
||||
{$sTemplateType="property/item.{$oPropertyItem->getType()}.tpl"}
|
||||
{if $LS->Viewer_TemplateExists($sTemplateType)}
|
||||
{include $sTemplateType}
|
||||
{else}
|
||||
{* Показываем стандартный шаблон *}
|
||||
{include 'property/item.base.tpl'}
|
||||
{/if}
|
||||
{/if}
|
||||
{/if}
|
|
@ -0,0 +1,7 @@
|
|||
{if $aPropertyItems}
|
||||
<div class="property-list">
|
||||
{foreach $aPropertyItems as $oPropertyItem}
|
||||
{include 'property/render.item.tpl'}
|
||||
{/foreach}
|
||||
</div>
|
||||
{/if}
|
Loading…
Reference in a new issue