move mobile imgage upload to adminprivatesalesale

This commit is contained in:
Marion Muszynski 2017-09-28 15:38:03 +02:00
parent 4b4a6d9f17
commit ad291c9f99
3 changed files with 28 additions and 27 deletions

View File

@ -761,24 +761,24 @@ class AdminCategories extends AdminTab
</div>'; </div>';
// @Override Antadis // @Override Antadis
echo '<label>'.$this->l('Image app mobile:').'</label> // echo '<label>'.$this->l('Image app mobile:').'</label>
<div class="margin-form translatable">'; // <div class="margin-form translatable">';
foreach($this->_languages as $language) { // foreach($this->_languages as $language) {
echo ' // echo '
<div class="lang_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').'; float: left;">'; // <div class="lang_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').'; float: left;">';
if(file_exists(_PS_ROOT_DIR_.'/img/c/'.$obj->id.'_mobile_vp_'.$language['id_lang'].'.jpg')) { // if(file_exists(_PS_ROOT_DIR_.'/img/c/'.$obj->id.'_mobile_vp_'.$language['id_lang'].'.jpg')) {
echo '<div id="image"> // echo '<div id="image">
<img src="'.__PS_BASE_URI__.'img/c/'.$obj->id.'_mobile_vp_'.$language['id_lang'].'.jpg" alt="" class="imgm"> // <img src="'.__PS_BASE_URI__.'img/c/'.$obj->id.'_mobile_vp_'.$language['id_lang'].'.jpg" alt="" class="imgm">
<p></p> // <p></p>
<a href="'.$currentIndex.'&id_category='.$obj->id.'&token='.Tools::getAdminTokenLite('AdminCatalog').'&deleteImageMobile=1&id_lang='.$language['id_lang'].'"> // <a href="'.$currentIndex.'&id_category='.$obj->id.'&token='.Tools::getAdminTokenLite('AdminCatalog').'&deleteImageMobile=1&id_lang='.$language['id_lang'].'">
<img src="../img/admin/delete.gif" alt="Supprimer"> Supprimer</a> // <img src="../img/admin/delete.gif" alt="Supprimer"> Supprimer</a>
</div>'; // </div>';
} // }
echo '<input id="image_thumb_'.$language['id_lang'].'" type="file" name="image_mobile_'.$language['id_lang'].'" /> // echo '<input id="image_thumb_'.$language['id_lang'].'" type="file" name="image_mobile_'.$language['id_lang'].'" />
</div>'; // </div>';
} // }
echo '<p class="clear"></p> // echo '<p class="clear"></p>
</div>'; // </div>';
// echo ' <label>'.$this->l('Image logo:').' </label> // echo ' <label>'.$this->l('Image logo:').' </label>
// <div class="margin-form">'; // <div class="margin-form">';

View File

@ -224,14 +224,14 @@ class AdminAntCreationcategories extends AdminTab
'name' => 'image_category', 'name' => 'image_category',
'id' => 'preview_category', 'id' => 'preview_category',
), ),
array( // array(
'type' => 'uploadImage', // 'type' => 'uploadImage',
'label' => $this->l('Image Application : '), // 'label' => $this->l('Image Application : '),
'label-class' => 'col-md-2', // 'label-class' => 'col-md-2',
'input-class' => 'col-md-6', // 'input-class' => 'col-md-6',
'name' => 'image_mobile', // 'name' => 'image_mobile',
'id' => 'preview_mobile', // 'id' => 'preview_mobile',
), // ),
array( array(
'type' => 'tag', 'type' => 'tag',
'label' => $this->l('Sous Catégorie : '), 'label' => $this->l('Sous Catégorie : '),

View File

@ -15,6 +15,7 @@ class AdminPrivateSalesSales extends AdminTab {
'liston' => array($this->l('Listing image (on)'), '380x178'), 'liston' => array($this->l('Listing image (on)'), '380x178'),
'listoff' => array($this->l('Listing image (off)'), '380x178'), 'listoff' => array($this->l('Listing image (off)'), '380x178'),
'salebg' => array($this->l('Sale background'), '*x*'), 'salebg' => array($this->l('Sale background'), '*x*'),
'mobile' => array($this->l('Listing App'), '900*450px'),
//'thumb' => array($this->l('Thumbnail'), '260x108'), //'thumb' => array($this->l('Thumbnail'), '260x108'),
//'fb' => array($this->l('Facebook image'), '100x100'), //'fb' => array($this->l('Facebook image'), '100x100'),
//'trailerbg' => array($this->l('Trailer background'), '*x*'), //'trailerbg' => array($this->l('Trailer background'), '*x*'),
@ -1209,7 +1210,7 @@ class AdminPrivateSalesSales extends AdminTab {
$images[] = 'banner_mobile'; $images[] = 'banner_mobile';
foreach(Language::getLanguages(FALSE) as $language) { foreach(Language::getLanguages(FALSE) as $language) {
foreach($images as $img) { foreach($images as $img) {
if((int)$language['id_lang'] == 3 && ($img == 'liston' || $img == 'listoff' || $img == 'thumb' || $img == 'salebg') if((int)$language['id_lang'] == 3 && ($img == 'liston' || $img == 'listoff' || $img == 'thumb' || $img == 'salebg' || $img == 'mobile')
&& (!isset($_FILES['img_'.$img.'_'.$language['id_lang']]) || $_FILES['img_'.$img.'_'.$language['id_lang']]['name'] == '') && (!isset($_FILES['img_'.$img.'_'.$language['id_lang']]) || $_FILES['img_'.$img.'_'.$language['id_lang']]['name'] == '')
&& (isset($_FILES['img_'.$img.'_2']) && $_FILES['img_'.$img.'_2']['name'] != '') && (isset($_FILES['img_'.$img.'_2']) && $_FILES['img_'.$img.'_2']['name'] != '')
) { ) {