Merge branch 'bootstrap' of https://github.com/PrestaShop/PrestaShop into bootstrap
This commit is contained in:
@@ -202,6 +202,22 @@ class AdminGendersControllerCore extends AdminController
|
||||
}
|
||||
return !count($this->errors) ? true : false;
|
||||
}
|
||||
|
||||
protected function afterImageUpload()
|
||||
{
|
||||
parent::afterImageUpload();
|
||||
|
||||
if (($id_gender = (int)Tools::getValue('id_gender')) &&
|
||||
isset($_FILES) && count($_FILES) && file_exists(_PS_GENDERS_DIR_.$id_gender.'.jpg'))
|
||||
{
|
||||
$current_file = _PS_TMP_IMG_DIR_.'gender_mini_'.$id_gender.'_'.$this->context->shop->id.'.jpg';
|
||||
|
||||
if (file_exists($current_file))
|
||||
unlink($current_file);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -530,4 +530,20 @@ class AdminLanguagesControllerCore extends AdminController
|
||||
//update employee lang if current id lang is disabled
|
||||
Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'employee` set `id_lang`='.(int)Configuration::get('PS_LANG_DEFAULT').' WHERE `id_lang`='.(int)$current_id_lang);
|
||||
}
|
||||
|
||||
protected function afterImageUpload()
|
||||
{
|
||||
parent::afterImageUpload();
|
||||
|
||||
if (($id_lang = (int)Tools::getValue('id_lang')) &&
|
||||
isset($_FILES) && count($_FILES) && file_exists(_PS_LANG_IMG_DIR_.$id_lang.'.jpg'))
|
||||
{
|
||||
$current_file = _PS_TMP_IMG_DIR_.'lang_mini_'.$id_lang.'_'.$this->context->shop->id.'.jpg';
|
||||
|
||||
if (file_exists($current_file))
|
||||
unlink($current_file);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -133,9 +133,9 @@ class AdminLocalizationControllerCore extends AdminController
|
||||
|
||||
public function initPageHeaderToolbar()
|
||||
{
|
||||
$this->page_header_toolbar_title = $this->l('Localizations');
|
||||
|
||||
parent::initPageHeaderToolbar();
|
||||
|
||||
$this->page_header_toolbar_title = $this->l('Localization');
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
|
||||
@@ -67,9 +67,9 @@ class AdminLoginControllerCore extends AdminController
|
||||
if ($clientIsMaintenanceOrLocal)
|
||||
$this->errors[] = Tools::displayError('SSL is activated. However, your IP is allowed to enter unsecure mode for maintenance or local IP issues.');
|
||||
else
|
||||
{
|
||||
$warningSslMessage = Tools::displayError('SSL is activated. Please connect using the following link to ');
|
||||
$warningSslMessage .= '<a href="https://'.Tools::safeOutput(Tools::getServerName()).Tools::safeOutput($_SERVER['REQUEST_URI']).'">log into secure mode (https://)</a>';
|
||||
{
|
||||
$url = 'https://'.Tools::safeOutput(Tools::getServerName()).Tools::safeOutput($_SERVER['REQUEST_URI']);
|
||||
$warningSslMessage = sprintf(Tools::displayError('SSL is activated. Please connect using the following link to <a href="%s">log into secure mode (https://)</a>'), $url);
|
||||
$this->context->smarty->assign(array('warningSslMessage' => $warningSslMessage));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -752,6 +752,11 @@ class AdminManufacturersControllerCore extends AdminController
|
||||
(int)$image_type['height']
|
||||
);
|
||||
}
|
||||
|
||||
$current_logo_file = _PS_TMP_IMG_DIR_.'manufacturer_mini_'.$id_manufacturer.'_'.$this->context->shop->id.'.jpg';
|
||||
|
||||
if ($res && file_exists($current_logo_file))
|
||||
unlink($current_logo_file);
|
||||
}
|
||||
|
||||
if (!$res)
|
||||
@@ -759,7 +764,7 @@ class AdminManufacturersControllerCore extends AdminController
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
protected function beforeDelete($object)
|
||||
{
|
||||
return true;
|
||||
|
||||
@@ -560,4 +560,20 @@ class AdminStatusesControllerCore extends AdminController
|
||||
$this->initOrdersReturnsList();
|
||||
return parent::filterToField($key, $filter);
|
||||
}
|
||||
|
||||
protected function afterImageUpload()
|
||||
{
|
||||
parent::afterImageUpload();
|
||||
|
||||
if (($id_order_state = (int)Tools::getValue('id_order_state')) &&
|
||||
isset($_FILES) && count($_FILES) && file_exists(_PS_ORDER_STATE_IMG_DIR_.$id_order_state.'.gif'))
|
||||
{
|
||||
$current_file = _PS_TMP_IMG_DIR_.'order_state_mini_'.$id_order_state.'_'.$this->context->shop->id.'.gif';
|
||||
|
||||
if (file_exists($current_file))
|
||||
unlink($current_file);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -371,6 +371,11 @@ class AdminSuppliersControllerCore extends AdminController
|
||||
if (!ImageManager::resize($file, _PS_SUPP_IMG_DIR_.$id_supplier.'-'.stripslashes($image_type['name']).'.jpg', (int)$image_type['width'], (int)$image_type['height']))
|
||||
$return = false;
|
||||
}
|
||||
|
||||
$current_logo_file = _PS_TMP_IMG_DIR_.'supplier_mini_'.$id_supplier.'_'.$this->context->shop->id.'.jpg';
|
||||
|
||||
if (file_exists($current_logo_file))
|
||||
unlink($current_logo_file);
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user