first commit
This commit is contained in:
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
/**
|
||||
* SOTESHOP/stTrustPlugin
|
||||
*
|
||||
*
|
||||
* @package stTrustPlugin
|
||||
* @author Bartosz Alejski <bartosz.alejski@sote.pl>
|
||||
*/
|
||||
class stTrustFrontendComponents extends sfComponents {
|
||||
|
||||
public function executeShow()
|
||||
{
|
||||
$smarty = new stSmarty('stTrustFrontend');
|
||||
|
||||
$config = stConfig::getInstance($this->getContext(), 'stTrustBackend');
|
||||
$config->setCulture($this->getUser()->getCulture());
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add(TrustPeer::PRODUCT_ID, $this->product->getID());
|
||||
$trust = TrustPeer::doSelectWithI18n($c);
|
||||
|
||||
if($trust){
|
||||
$trust = $trust[0];
|
||||
|
||||
if($config->get('field_on')==1 || $trust->getFieldOn()==1){
|
||||
|
||||
if($trust->getFieldOn()==1){
|
||||
$smarty->assign("field_description", $trust->getFieldDescription());
|
||||
$smarty->assign("field_on", $trust->getFieldOn());
|
||||
}else{
|
||||
$smarty->assign("field_description", $config->get('field_description', null, true));
|
||||
$smarty->assign("field_on", $config->get('field_on'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($config->get('field_1_on')==1 || $trust->getFieldFOn()==1){
|
||||
|
||||
if($trust->getFieldFOn()==1){
|
||||
$smarty->assign("field_1_on", $trust->getFieldFOn());
|
||||
$smarty->assign("field_label_1", $trust->getFieldLabelF());
|
||||
$smarty->assign("field_sub_label_1", $trust->getFieldSubLabelF());
|
||||
$smarty->assign("field_description_1", $trust->getFieldDescriptionF());
|
||||
|
||||
if($trust->getIconF()!=""){
|
||||
$smarty->assign("icon_1", $trust->getIconF());
|
||||
}else{
|
||||
$smarty->assign("icon_1", $config->get('icon_1', null, true));
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
$smarty->assign("field_1_on", $config->get('field_1_on'));
|
||||
$smarty->assign("field_label_1", $config->get('field_label_1', null, true));
|
||||
$smarty->assign("field_sub_label_1", $config->get('field_sub_label_1', null, true));
|
||||
$smarty->assign("field_description_1", $config->get('field_description_1', null, true));
|
||||
$smarty->assign("icon_1", $config->get('icon_1', null, true));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($config->get('field_2_on')==1 || $trust->getFieldSOn()==1){
|
||||
|
||||
if($trust->getFieldSOn()==1){
|
||||
$smarty->assign("field_2_on", $trust->getFieldSOn());
|
||||
$smarty->assign("field_label_2", $trust->getFieldLabelS());
|
||||
$smarty->assign("field_sub_label_2", $trust->getFieldSubLabelS());
|
||||
$smarty->assign("field_description_2", $trust->getFieldDescriptionS());
|
||||
|
||||
if($trust->getIconS()!=""){
|
||||
$smarty->assign("icon_2", $trust->getIconS());
|
||||
}else{
|
||||
$smarty->assign("icon_2", $config->get('icon_2', null, true));
|
||||
}
|
||||
|
||||
}else{
|
||||
$smarty->assign("field_2_on", $config->get('field_2_on'));
|
||||
$smarty->assign("field_label_2", $config->get('field_label_2', null, true));
|
||||
$smarty->assign("field_sub_label_2", $config->get('field_sub_label_2', null, true));
|
||||
$smarty->assign("field_description_2", $config->get('field_description_2', null, true));
|
||||
$smarty->assign("icon_2", $config->get('icon_2', null, true));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($config->get('field_3_on')==1 || $trust->getFieldTOn()==1){
|
||||
|
||||
if($trust->getFieldTOn()==1){
|
||||
$smarty->assign("field_3_on", $trust->getFieldTOn());
|
||||
$smarty->assign("field_label_3", $trust->getFieldLabelT());
|
||||
$smarty->assign("field_sub_label_3", $trust->getFieldSubLabelT());
|
||||
$smarty->assign("field_description_3", $trust->getFieldDescriptionT());
|
||||
|
||||
if($trust->getIconT()!=""){
|
||||
$smarty->assign("icon_3", $trust->getIconT());
|
||||
}else{
|
||||
$smarty->assign("icon_3", $config->get('icon_3', null, true));
|
||||
}
|
||||
|
||||
}else{
|
||||
$smarty->assign("field_3_on", $config->get('field_3_on'));
|
||||
$smarty->assign("field_label_3", $config->get('field_label_3', null, true));
|
||||
$smarty->assign("field_sub_label_3", $config->get('field_sub_label_3', null, true));
|
||||
$smarty->assign("field_description_3", $config->get('field_description_3', null, true));
|
||||
$smarty->assign("icon_3", $config->get('icon_3', null, true));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}else{
|
||||
$smarty->assign("field_description", $config->get('field_description', null, true));
|
||||
$smarty->assign("field_on", $config->get('field_on'));
|
||||
|
||||
$smarty->assign("field_1_on", $config->get('field_1_on'));
|
||||
$smarty->assign("field_label_1", $config->get('field_label_1', null, true));
|
||||
$smarty->assign("field_sub_label_1", $config->get('field_sub_label_1', null, true));
|
||||
$smarty->assign("field_description_1", $config->get('field_description_1', null, true));
|
||||
$smarty->assign("icon_1", $config->get('icon_1', null, true));
|
||||
|
||||
$smarty->assign("field_2_on", $config->get('field_2_on'));
|
||||
$smarty->assign("field_label_2", $config->get('field_label_2', null, true));
|
||||
$smarty->assign("field_sub_label_2", $config->get('field_sub_label_2', null, true));
|
||||
$smarty->assign("field_description_2", $config->get('field_description_2', null, true));
|
||||
$smarty->assign("icon_2", $config->get('icon_2', null, true));
|
||||
|
||||
$smarty->assign("field_3_on", $config->get('field_3_on'));
|
||||
$smarty->assign("field_label_3", $config->get('field_label_3', null, true));
|
||||
$smarty->assign("field_sub_label_3", $config->get('field_sub_label_3', null, true));
|
||||
$smarty->assign("field_description_3", $config->get('field_description_3', null, true));
|
||||
$smarty->assign("icon_3", $config->get('icon_3', null, true));
|
||||
|
||||
}
|
||||
|
||||
return $smarty;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
{if $field_on == 1}
|
||||
<div id="card-info-p" class="tinymce_html text-center">
|
||||
{$field_description}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div id="card-info-box">
|
||||
|
||||
<ul class="flex clearfix">
|
||||
{if $field_1_on == 1}
|
||||
<li>
|
||||
<button class="btn btn-default text-center collapsed" type="button" data-parent="#card-info-box" data-toggle="collapse" data-target="#card-info-box_content1" aria-expanded="false" aria-controls="card-info-box_content1">
|
||||
<span class="hidden-xs hidden-md"><img src="/uploads/{$icon_1}" alt="" /></span>
|
||||
<span class="hidden-sm">
|
||||
{$field_label_1}
|
||||
<small class="text-muted">
|
||||
{$field_sub_label_1}
|
||||
</small>
|
||||
</span>
|
||||
</button>
|
||||
</li>
|
||||
{/if}
|
||||
|
||||
{if $field_2_on == 1}
|
||||
<li>
|
||||
<button class="btn btn-default text-center collapsed" type="button" data-parent="#card-info-box" data-toggle="collapse" data-target="#card-info-box_content2" aria-expanded="false" aria-controls="card-info-box_content2">
|
||||
<span class="hidden-xs hidden-md"><img src="/uploads/{$icon_2}" alt="" /></span>
|
||||
<span class="hidden-sm">
|
||||
{$field_label_2}
|
||||
<small class="text-muted">{$field_sub_label_2}</small>
|
||||
</span>
|
||||
</button>
|
||||
</li>
|
||||
{/if}
|
||||
|
||||
{if $field_3_on == 1}
|
||||
<li>
|
||||
<button class="btn btn-default text-center collapsed" type="button" data-parent="#card-info-box" data-toggle="collapse" data-target="#card-info-box_content3" aria-expanded="false" aria-controls="card-info-box_content3">
|
||||
<span class="hidden-xs hidden-md"><img src="/uploads/{$icon_3}" alt="" /></span>
|
||||
<span class="hidden-sm">
|
||||
{$field_label_3}
|
||||
<small class="text-muted">{$field_sub_label_3}</small>
|
||||
</span>
|
||||
</button>
|
||||
</li>
|
||||
{/if}
|
||||
|
||||
</ul>
|
||||
|
||||
{if $field_1_on == 1}
|
||||
<div id="card-info-box_content1" class="panel-collapse collapse" role="tabpanel" aria-labelledby="card-info-box_head1">
|
||||
<div class="tinymce_html">
|
||||
{$field_description_1}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if $field_2_on == 1}
|
||||
<div id="card-info-box_content2" class="panel-collapse collapse" role="tabpanel" aria-labelledby="card-info-box_head2">
|
||||
<div class="tinymce_html">
|
||||
{$field_description_2}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if $field_3_on == 1}
|
||||
<div id="card-info-box_content3" class="panel-collapse collapse" role="tabpanel" aria-labelledby="card-info-box_head3">
|
||||
<div class="tinymce_html">
|
||||
{$field_description_3}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user