Merge branch 'develop' of gitlab.antadis.net:dev-antadis/bebeboutik into develop

This commit is contained in:
root 2017-06-28 12:18:45 +02:00
commit d89b2eb3f7
7 changed files with 44 additions and 95 deletions

View File

@ -523,8 +523,6 @@ class HelperFormBootstrap{
.$this->displayFlags($p['languages'], $defaultLanguage, $p['id_langs'], $p['name'],true,false,$p['link_flag_img']).'
<div class="clearfix"></div>
</label>';
//$this->_html .= $this->displayFlags($p['languages'], $defaultLanguage, $p['id_langs'], $p['name'],true,false,$p['link_flag_img'],'table');
//$this->_html .= '
$this->_js .= '
<script>
id_language = '.(int)$defaultLanguage.';
@ -547,10 +545,10 @@ class HelperFormBootstrap{
</span>
</div>';
if(isset($p['url_to_check']) && !empty($p['url_to_check']) && file_exists($p['url_to_check'].$p['name_img'].'_'.$language['id_lang'].'.jpg')) {
$this->_html .='<p><a href="'.$p['url_imgs'].$p['name_img'].'_'.$language['id_lang'].'.jpg" onclick="window.open(this.href); return false;"><span class="anticon anticon-image"></span> Image '.$language['iso_code'].'</a></p>';
$this->_html .='<p><a href="'.$p['url_imgs'].$p['name_img'].'_'.$language['id_lang'].'.jpg" onclick="window.open(this.href); return false;"><span class="anticon anticon-image"></span> Image '.$language['iso_code'].'</a>'.(isset($p['img_delete']) && $p['img_delete']!=''?' - <a href="'.$p['img_delete'].'&id_lang='.$language['id_lang'].'"><span class="anticon anticon-bin"></span></a>':'').'</p>';
}
if(isset($p['url_to_show']) && !empty($p['url_to_show']) && file_exists($p['url_to_show'].$p['name_img'].'_'.$language['id_lang'].'.jpg')) {
$this->_html .='<p><img src="'.$p['url_imgs'].$p['name_img'].'_'.$language['id_lang'].'.jpg" /></p>';
$this->_html .='<p><img src="'.$p['url_imgs'].$p['name_img'].'_'.$language['id_lang'].'.jpg" />'.(isset($p['img_delete']) && $p['img_delete']!=''?' - <a href="'.$p['img_delete'].'&id_lang='.$language['id_lang'].'"><span class="anticon anticon-bin"></span></a>':'').'</p>';
}
$this->_html .='</div>';
$this->_js .= '
@ -629,7 +627,6 @@ class HelperFormBootstrap{
</div>
</div>
</div>';
//<input type="checkbox" name="'.$p['name'].'" class="js-switch" '.(isset($p['checked']) && $p['checked']?'checked="checked"':'').' /> '.$p['title'].'
}
public function inputText($p = array()){

View File

@ -95,7 +95,7 @@ class AdminAntPromobanner extends AdminTab
'name' => 'img_'.$k,
'name_img' => 'img_'.$k,
'id' => $k,
'help' => 'L\'image sera la même sur tous les écrans (évitez de charger un image trop lourde)',
'help' => 'L\'image sera la même sur tous les écrans (évitez de charger un image trop lourde).<br>Privilégiez un ratio 500*178',
'languages' => $languages,
'default_language' => 2,
'input-class' => '',

View File

@ -31,8 +31,8 @@ class AdminPrivateSalesSales extends AdminTab {
foreach(array_keys($this->imagelist) as $img) {
$images[] = 'img_'.$img;
}
$divLangName = 'description¤video¤'.implode('¤', $images).m_extrafields_1_value¤m_extrafields_2_value';
$divLangImgName = 'description¤video¤'.implode('¤', $images).m_extrafields_1_value¤m_extrafields_2_value';
$divLangName = 'description¤video¤'.implode('¤', $images).img_banner_mobile¤m_extrafields_1_value¤m_extrafields_2_value';
$divLangImgName = 'description¤video¤'.implode('¤', $images).img_banner_mobile¤m_extrafields_1_value¤m_extrafields_2_value';
$helperForm = new HelperFormBootstrap();
$helperForm->_select2 = true;
@ -728,6 +728,26 @@ class AdminPrivateSalesSales extends AdminTab {
echo $helperForm->generateInput($input);
echo '<div class="clearfix"></div>';
}
$input = array(
'type' => 'uploadImage',
'lang' => true,
'label' => 'Bannière Promo (Mobile)',
'name' => 'img_banner_mobile',
'name_img' => 'banner_mobile',
'id' => 'banner_mobile',
'help' => $this->l('Size:').' 500*178',
'languages' => $this->_languages,
'default_language' => 2,
'input-class' => '',
'id_langs' => $divLangImgName,
'link_flag_img' => '../img/l/',
'img_delete' => ($this->cursale !== NULL?$currentIndex.'&token='.Tools::getAdminTokenLite('AdminPrivateSalesSales').'&delete_img=banner_mobile&id='.$this->cursale->id:''),
'url_imgs' => ($this->cursale !== NULL?__PS_BASE_URI__.'modules/privatesales/img/'.$this->cursale->id.'/':''),
'url_to_check' => ($this->cursale !== NULL?_PS_ROOT_DIR_.'/modules/privatesales/img/'.$this->cursale->id.'/':''),
);
echo $helperForm->generateInput($input);
echo '<div class="clearfix"></div>';
echo '</div>
<div class="clear"></div>
<div class="ln_solid-small"></div>
@ -751,6 +771,9 @@ class AdminPrivateSalesSales extends AdminTab {
if($this->cursale->id === NULL) {
Tools::redirectAdmin($currentIndex.'&token='.Tools::getAdminTokenLite('AdminPrivateSalesSales'));
}
if(Tools::getValue('delete_img') && $id_lang = Tools::getValue('id_lang')) {
unlink(_PS_ROOT_DIR_.'/modules/privatesales/img/'.$this->cursale->id.'/'.Tools::getValue('delete_img').'_'.$id_lang.'.jpg');
}
}
// // ANTADIS INSERT TYPE
@ -1142,8 +1165,10 @@ class AdminPrivateSalesSales extends AdminTab {
mkdir(_PS_ROOT_DIR_.'/modules/privatesales/img/'.$sale->id, 0775);
}
$images = array_keys($this->imagelist);
$images[] = 'banner_mobile';
foreach(Language::getLanguages(FALSE) as $language) {
foreach(array_keys($this->imagelist) as $img) {
foreach($images as $img) {
if((int)$language['id_lang'] == 3 && ($img == 'liston' || $img == 'listoff' || $img == 'thumb' || $img == 'salebg')
&& (!isset($_FILES['img_'.$img.'_'.$language['id_lang']]) || $_FILES['img_'.$img.'_'.$language['id_lang']]['name'] == '')
&& (isset($_FILES['img_'.$img.'_2']) && $_FILES['img_'.$img.'_2']['name'] != '')
@ -1217,9 +1242,10 @@ class AdminPrivateSalesSales extends AdminTab {
if(!is_dir(_PS_ROOT_DIR_.'/modules/privatesales/img/'.$sale->id)) {
mkdir(_PS_ROOT_DIR_.'/modules/privatesales/img/'.$sale->id, 0775);
}
$images = array_keys($this->imagelist);
$images[] = 'banner_mobile';
foreach(Language::getLanguages(FALSE) as $language) {
foreach(array_keys($this->imagelist) as $img) {
foreach($images as $img) {
if((int)$language['id_lang'] == 3 && ($img == 'liston' || $img == 'listoff' || $img == 'thumb' || $img == 'salebg')
&& (!isset($_FILES['img_'.$img.'_'.$language['id_lang']]) || $_FILES['img_'.$img.'_'.$language['id_lang']]['name'] == '')
&& (isset($_FILES['img_'.$img.'_2']) && $_FILES['img_'.$img.'_2']['name'] != '')

View File

@ -23,6 +23,9 @@ class CategoryController extends CategoryControllerCore {
$s['is_thumb_img'] = true;
}
}
if(file_exists(_PS_ROOT_DIR_.'/modules/privatesales/img/'.$sale->id.'/banner_mobile_'.$cookie->id_lang.'.jpg')) {
$banner_mobile = true;
}
}
if (!in_array($site_version_front, $sale->versions)) {
@ -30,6 +33,7 @@ class CategoryController extends CategoryControllerCore {
}
self::$smarty->assign(array(
'banner_mobile' => (isset($banner_mobile) && $banner_mobile?true:false),
'sale' => $sale,
'category' => $this->category,
'HOOK_PRIVATESALES_CATEGORY' => Module::hookExec('privatesales_category', array('sale' => $sale)),

View File

@ -242,6 +242,7 @@ $(document).ready(function() {
</div>
{/if}
<div>
{if $products}
{*{include file="$tpl_dir./product-compare.tpl"}
{include file="$tpl_dir./product-sort.tpl"}*}

View File

@ -61,10 +61,11 @@ $(document).ready(function() {
{$HOOK_PRIVATESALES_CATEGORY}
</div>
{if $sale->id == 7086}
<div class="sale_promo"></div>
<div class="clearfix"></div>
{/if}
{if $banner_mobile}
<div class="promo_banner_mobile"/>
<img src="{$base_dir_ssl}modules/privatesales/img/{$sale->id}/banner_mobile_{$cookie->id_lang}.jpg" alt="" width="100%">
</div>
{/if}
{/if}

View File

@ -5307,86 +5307,6 @@ h3.gift_title {
display: none;
}
/* Bandeau promotionnel */
.promo_bandeau{
background: url(../img/bandeau_promo.jpg) no-repeat left center;
width: 100%;
min-height: 142px;
margin-bottom: 20px;
-webkit-background-size: auto 100%;
background-size: auto 100%;
}
.promo_bandeau_es{
background: url(../img/bandeau_promo_es.jpg) no-repeat left center;
width: 100%;
min-height: 142px;
margin-bottom: 20px;
-webkit-background-size: auto 100%;
background-size: auto 100%;
}
.sale_promo{
background: url(../img/bandeau_promo_braderie.jpg) no-repeat center center;
width: 100%;
min-height: 142px;
margin-bottom: 20px;
-webkit-background-size: auto 100%;
background-size: auto 100%;
}
@media (min-width:426px) {
.promo_bandeau_es{
background: url(../img/bandeau_promo_es.jpg) no-repeat center center;
width: 100%;
min-height: 160px;
margin-bottom: 20px;
-webkit-background-size: contain;
background-size: contain;
}
.sale_promo{
background: url(../img/bandeau_promo_braderie.jpg) no-repeat center center;
width: 100%;
min-height: 160px;
margin-bottom: 20px;
-webkit-background-size: contain;
background-size: contain;
}
}
@media (min-width:480px) {
.promo_bandeau{
background: url(../img/bandeau_promo_2.jpg) no-repeat left center;
width: 100%;
min-height: 182px;
-webkit-background-size: 100%;
background-size: 100%;
}
.promo_bandeau_es{
background: url(../img/bandeau_promo_es.jpg) no-repeat center center;
width: 100%;
min-height: 182px;
-webkit-background-size: 100%;
background-size: 100%;
}
.sale_promo{
background: url(../img/bandeau_promo_braderie.jpg) no-repeat center center;
width: 100%;
min-height: 182px;
-webkit-background-size: 100%;
background-size: 100%;
}
}
@media (min-width:430px) {
.promo_bandeau{
background: url(../img/bandeau_promo_2.jpg) no-repeat left center;
width: 100%;
min-height: 162px;
-webkit-background-size: 100%;
background-size: 100%;
}
}
/***** Module : Ant_promobanner ****/
.ant_promo_banner_img{
width: 100%;