1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-16 23:00:51 +03:00

Возможность задавать кастомные шаблоны для рендеринга дополнительных полей

This commit is contained in:
Mzhelskiy Maxim 2014-04-02 13:28:15 +07:00
parent 4003e1e487
commit 90450b7f5b
5 changed files with 37 additions and 0 deletions

View file

@ -197,6 +197,7 @@ class ModuleProperty_EntityValueTypeFile extends ModuleProperty_EntityValueType
}
}
}
$aParams['access_only_auth']=isset($aParamsRaw['access_only_auth']) ? true : false;
return $aParams;
}

View file

@ -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>

View file

@ -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>

View 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}

View file

@ -0,0 +1,7 @@
{if $aPropertyItems}
<div class="property-list">
{foreach $aPropertyItems as $oPropertyItem}
{include 'property/render.item.tpl'}
{/foreach}
</div>
{/if}