diff --git a/classes/Mail.php b/classes/Mail.php
index d6b8eff7e..e9f49e624 100644
--- a/classes/Mail.php
+++ b/classes/Mail.php
@@ -187,8 +187,8 @@ class MailCore
/* Create mail and attach differents parts */
$message = new Swift_Message('['.Configuration::get('PS_SHOP_NAME').'] '.$subject);
- $templateVars['{shop_logo}'] = (file_exists(_PS_IMG_DIR_.'logo_mail.jpg')) ? $message->attach(new Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.'logo_mail.jpg'))) :
- ((file_exists(_PS_IMG_DIR_.'logo.jpg')) ? $message->attach(new Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.'logo.jpg'))) : '');
+ $templateVars['{shop_logo}'] = (file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL'))) ? $message->attach(new Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL')))) :
+ ((file_exists(_PS_IMG_DIR_.'logo.jpg')) ? $message->attach(new Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.Configuration::get('PS_LOGO')) : '');
$templateVars['{shop_name}'] = Tools::safeOutput(Configuration::get('PS_SHOP_NAME'));
$templateVars['{shop_url}'] = Tools::getShopDomain(true, true).__PS_BASE_URI__;
$swift->attachPlugin(new Swift_Plugin_Decorator(array($to_plugin => $templateVars)), 'decorator');
diff --git a/classes/controller/FrontController.php b/classes/controller/FrontController.php
index dee206611..d52045e07 100755
--- a/classes/controller/FrontController.php
+++ b/classes/controller/FrontController.php
@@ -670,7 +670,8 @@ class FrontControllerCore extends Controller
'logo_image_width' => Configuration::get('SHOP_LOGO_WIDTH'),
'logo_image_height' => Configuration::get('SHOP_LOGO_HEIGHT'),
'priceDisplayPrecision' => _PS_PRICE_DISPLAY_PRECISION_,
- 'content_only' => (int)Tools::getValue('content_only')
+ 'content_only' => (int)Tools::getValue('content_only'),
+ 'logo_url' => _PS_IMG_.Configuration::get('PS_LOGO').'?'.Configuration::get('PS_IMG_UPDATE_TIME')
));
}
diff --git a/classes/pdf/HTMLTemplate.php b/classes/pdf/HTMLTemplate.php
index f496a14dd..75e3b2269 100755
--- a/classes/pdf/HTMLTemplate.php
+++ b/classes/pdf/HTMLTemplate.php
@@ -104,10 +104,10 @@ abstract class HTMLTemplateCore
{
$logo = '';
- if (file_exists(_PS_IMG_DIR_.'logo_invoice.jpg'))
- $logo = _PS_IMG_.'logo_invoice.jpg';
- else if (file_exists(_PS_IMG_DIR_.'logo.jpg'))
- $logo = _PS_IMG_.'logo.jpg';
+ if (file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_INVOICE')))
+ $logo = _PS_IMG_.Configuration::get('PS_LOGO_INVOICE');
+ else if (file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO')))
+ $logo = _PS_IMG_.Configuration::get('PS_LOGO');
return $logo;
}
diff --git a/classes/webservice/WebserviceSpecificManagementImages.php b/classes/webservice/WebserviceSpecificManagementImages.php
index 28f03e042..07626f392 100755
--- a/classes/webservice/WebserviceSpecificManagementImages.php
+++ b/classes/webservice/WebserviceSpecificManagementImages.php
@@ -333,8 +333,8 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
case 'mail':
if (in_array($this->wsObject->method, array('GET','HEAD','PUT')))
{
- $path = _PS_IMG_DIR_.'logo_mail.jpg';
- $alternative_path = _PS_IMG_DIR_.'logo.jpg';
+ $path = _PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL');
+ $alternative_path = _PS_IMG_DIR_.Configuration::get('PS_LOGO');
}
else
throw new WebserviceException('This method is not allowed with general image resources.', array(50, 405));
@@ -344,8 +344,8 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
case 'invoice':
if (in_array($this->wsObject->method, array('GET','HEAD','PUT')))
{
- $path = _PS_IMG_DIR_.'logo_invoice.jpg';
- $alternative_path = _PS_IMG_DIR_.'logo.jpg';
+ $path = _PS_IMG_DIR_.Configuration::get('PS_LOGO_INVOICE');
+ $alternative_path = _PS_IMG_DIR_.Configuration::get('PS_LOGO');
}
else
throw new WebserviceException('This method is not allowed with general image resources.', array(51, 405));
diff --git a/controllers/admin/AdminThemesController.php b/controllers/admin/AdminThemesController.php
index 138201af4..c2660182d 100644
--- a/controllers/admin/AdminThemesController.php
+++ b/controllers/admin/AdminThemesController.php
@@ -88,13 +88,13 @@ class AdminThemesControllerCore extends AdminController
'tab' => 'AdminStores',
)
);
+
+ public $className = 'Theme';
+ public $table = 'theme';
- public function __construct()
+ public function init()
{
- $this->className = 'Theme';
- $this->table = 'theme';
-
- parent::__construct();
+ parent::init();
// Thumbnails filenames depend on multishop activation
if (Shop::isFeatureActive())
@@ -107,16 +107,16 @@ class AdminThemesControllerCore extends AdminController
'title' => $this->l('Appearance'),
'icon' => 'email',
'fields' => array(
- 'PS_LOGO' => array('title' => $this->l('Header logo:'), 'desc' => $this->l('Will appear on main page'), 'type' => 'file', 'thumb' => _PS_IMG_.'logo'.$shop_suffix.'.jpg?date='.time()),
- 'PS_LOGO_MAIL' => array('title' => $this->l('Mail logo:'), 'desc' => $this->l('Will appear on e-mail headers, if undefined the Header logo will be used'), 'type' => 'file', 'thumb' => (file_exists(_PS_IMG_DIR_.'logo_mail'.$shop_suffix.'.jpg')) ? _PS_IMG_.'logo_mail'.$shop_suffix.'.jpg?date='.time() : _PS_IMG_.'logo'.$shop_suffix.'.jpg?date='.time()),
- 'PS_LOGO_INVOICE' => array('title' => $this->l('Invoice logo:'), 'desc' => $this->l('Will appear on invoices headers, if undefined the Header logo will be used'), 'type' => 'file', 'thumb' => file_exists(_PS_IMG_DIR_.'logo_invoice'.$shop_suffix.'.jpg') ? _PS_IMG_.'logo_invoice'.$shop_suffix.'.jpg?date='.time() : _PS_IMG_.'logo'.$shop_suffix.'.jpg?date='.time()),
+ 'PS_LOGO' => array('title' => $this->l('Header logo:'), 'desc' => $this->l('Will appear on main page'), 'type' => 'file', 'thumb' => _PS_IMG_.Configuration::get('PS_LOGO').'?date='.time()),
+ 'PS_LOGO_MAIL' => array('title' => $this->l('Mail logo:'), 'desc' => $this->l('Will appear on e-mail headers, if undefined the Header logo will be used'), 'type' => 'file', 'thumb' => (file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL'))) ? _PS_IMG_.Configuration::get('PS_LOGO_MAIL').'?date='.time() : _PS_IMG_.Configuration::get('PS_LOGO').'?date='.time()),
+ 'PS_LOGO_INVOICE' => array('title' => $this->l('Invoice logo:'), 'desc' => $this->l('Will appear on invoices headers, if undefined the Header logo will be used'), 'type' => 'file', 'thumb' => file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_INVOICE')) ? _PS_IMG_.Configuration::get('PS_LOGO_INVOICE').'?date='.time() : _PS_IMG_.Configuration::get('PS_LOGO').'?date='.time()),
'PS_FAVICON' => array('title' => $this->l('Favicon:'), 'desc' => $this->l('Will appear in the address bar of your web browser'), 'type' => 'file', 'thumb' => _PS_IMG_.'favicon'.$shop_suffix.'.ico?date='.time()),
'PS_STORES_ICON' => array('title' => $this->l('Store icon:'), 'desc' => $this->l('Will appear on the store locator (inside Google Maps)').'
'.$this->l('Suggested size: 30x30, Transparent GIF'), 'type' => 'file', 'thumb' => _PS_IMG_.'logo_stores'.$shop_suffix.'.gif?date='.time()),
'PS_NAVIGATION_PIPE' => array('title' => $this->l('Navigation pipe:'), 'desc' => $this->l('Used for navigation path inside categories/product'), 'cast' => 'strval', 'type' => 'text', 'size' => 20),
),
'submit' => array('title' => $this->l(' Save '), 'class' => 'button')
- ),
- );
+ ),
+ );
$this->fieldsDisplay = array(
'id_theme' => array(
@@ -291,23 +291,14 @@ class AdminThemesControllerCore extends AdminController
$content = '';
if (file_exists(_PS_IMG_DIR_.'logo.jpg'))
{
- list($width, $height, $type, $attr) = getimagesize(_PS_IMG_DIR_.'logo.jpg');
+ list($width, $height, $type, $attr) = getimagesize(_PS_IMG_DIR_.Configuration::get('PS_LOGO'));
Configuration::updateValue('SHOP_LOGO_WIDTH', (int)round($width));
Configuration::updateValue('SHOP_LOGO_HEIGHT', (int)round($height));
}
// No cache for auto-refresh uploaded logo
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
- // $this->displayOptionsList();
-/* if (@ini_get('allow_url_fopen') AND @fsockopen('addons.prestashop.com', 80, $errno, $errst, 3))
- $content .= '
-
+