From e8d9516a8ab0044fd692451f707d19d18d1d5550 Mon Sep 17 00:00:00 2001 From: PrestaEdit Date: Tue, 15 Jan 2013 17:48:28 +0100 Subject: [PATCH 1/3] [-] Small Fix: change documentation URL --- classes/webservice/WebserviceRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/webservice/WebserviceRequest.php b/classes/webservice/WebserviceRequest.php index 75c94b6be..c82483700 100644 --- a/classes/webservice/WebserviceRequest.php +++ b/classes/webservice/WebserviceRequest.php @@ -55,7 +55,7 @@ class WebserviceRequestCore * PrestaShop Webservice Documentation URL * @var string */ - protected $_docUrl = 'http://doc.prestashop.com/display/PS14/Using+the+REST+webservice'; + protected $_docUrl = 'http://doc.prestashop.com/display/PS15/Using+the+PrestaShop+Web+Service'; /** * Set if the authentication key was checked From 6fefecbcc44f69947831bd3186e18af32cdf9d6c Mon Sep 17 00:00:00 2001 From: PrestaEdit Date: Tue, 15 Jan 2013 17:52:04 +0100 Subject: [PATCH 2/3] // Welcome 2013 --- classes/webservice/WebserviceRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/webservice/WebserviceRequest.php b/classes/webservice/WebserviceRequest.php index 75c94b6be..734aed8e7 100644 --- a/classes/webservice/WebserviceRequest.php +++ b/classes/webservice/WebserviceRequest.php @@ -1,6 +1,6 @@ Date: Tue, 22 Jan 2013 15:07:25 +0100 Subject: [PATCH 3/3] [-] BO: Allow override for emails translations on the default theme without MODE_DEV --- .../admin/AdminTranslationsController.php | 46 ++++++++++--------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/controllers/admin/AdminTranslationsController.php b/controllers/admin/AdminTranslationsController.php index 2170c4da3..4b10fe9f1 100644 --- a/controllers/admin/AdminTranslationsController.php +++ b/controllers/admin/AdminTranslationsController.php @@ -1302,7 +1302,7 @@ class AdminTranslationsControllerCore extends AdminController if ($this->tabAccess['edit'] === '1') { // Get a good path for module directory - if ($this->theme_selected == self::DEFAULT_THEME_NAME) + if ($this->theme_selected == self::DEFAULT_THEME_NAME && _PS_MODE_DEV_) $i18n_dir = $this->translations_informations[$this->type_selected]['dir']; else $i18n_dir = $this->translations_informations[$this->type_selected]['override']['dir']; @@ -1379,10 +1379,10 @@ class AdminTranslationsControllerCore extends AdminController $arr_mail_content['core_mail'] = Tools::getValue('core_mail'); // Get path of directory for find a good path of translation file - if ($this->theme_selected != self::DEFAULT_THEME_NAME) - $arr_mail_path['core_mail'] = $this->translations_informations[$this->type_selected]['override']['dir']; - else + if ($this->theme_selected == self::DEFAULT_THEME_NAME && _PS_MODE_DEV_) $arr_mail_path['core_mail'] = $this->translations_informations[$this->type_selected]['dir']; + else + $arr_mail_path['core_mail'] = $this->translations_informations[$this->type_selected]['override']['dir']; } if (Tools::getValue('module_mail')) @@ -1390,10 +1390,10 @@ class AdminTranslationsControllerCore extends AdminController $arr_mail_content['module_mail'] = Tools::getValue('module_mail'); // Get path of directory for find a good path of translation file - if ($this->theme_selected != self::DEFAULT_THEME_NAME) - $arr_mail_path['module_mail'] = $this->translations_informations['modules']['override']['dir'].'{module}/mails/'.$this->lang_selected->iso_code.'/'; - else + if ($this->theme_selected == self::DEFAULT_THEME_NAME && _PS_MODE_DEV_) $arr_mail_path['module_mail'] = $this->translations_informations['modules']['dir'].'{module}/mails/'.$this->lang_selected->iso_code.'/'; + else + $arr_mail_path['module_mail'] = $this->translations_informations['modules']['override']['dir'].'{module}/mails/'.$this->lang_selected->iso_code.'/'; } // Save each mail content @@ -2266,20 +2266,24 @@ class AdminTranslationsControllerCore extends AdminController */ public function getModulesHasMails($with_module_name = false) { - if ($this->theme_selected != self::DEFAULT_THEME_NAME) - $i18n_dir = $this->translations_informations['modules']['override']['dir']; - else - $i18n_dir = $this->translations_informations['modules']['dir']; - $arr_modules = array(); - foreach (scandir($i18n_dir) as $module_dir) + foreach (scandir($this->translations_informations['modules']['dir']) as $module_dir) { - $dir = $i18n_dir.$module_dir.'/'; - if (!in_array($module_dir, self::$ignore_folder) && Tools::file_exists_cache($dir.'mails/')) - if ($with_module_name) - $arr_modules[$module_dir] = $dir; - else - $arr_modules[$dir] = scandir($dir); + if (!in_array($module_dir, self::$ignore_folder)) + { + $dir = false; + if (($this->theme_selected != self::DEFAULT_THEME_NAME || !_PS_MODE_DEV_) && Tools::file_exists_cache($this->translations_informations['modules']['override']['dir'].$module_dir.'/mails/')) + $dir = $this->translations_informations['modules']['override']['dir'].$module_dir.'/'; + elseif (Tools::file_exists_cache($this->translations_informations['modules']['dir'].$module_dir.'/mails/')) + $dir = $this->translations_informations['modules']['dir'].$module_dir.'/'; + if ($dir !== false) + { + if ($with_module_name) + $arr_modules[$module_dir] = $dir; + else + $arr_modules[$dir] = scandir($dir); + } + } } return $arr_modules; } @@ -2327,7 +2331,7 @@ class AdminTranslationsControllerCore extends AdminController $subject_mail = $this->getSubjectMail($dir, $file, $subject_mail); // Get path of directory for find a good path of translation file - if ($this->theme_selected != self::DEFAULT_THEME_NAME && @filemtime($this->translations_informations[$this->type_selected]['override']['dir'])) + if (($this->theme_selected != self::DEFAULT_THEME_NAME || !_PS_MODE_DEV_) && @filemtime($this->translations_informations[$this->type_selected]['override']['dir'])) $i18n_dir = $this->translations_informations[$this->type_selected]['override']['dir']; else $i18n_dir = $this->translations_informations[$this->type_selected]['dir']; @@ -2519,7 +2523,7 @@ class AdminTranslationsControllerCore extends AdminController public function initFormModules() { // Get path of directory for find a good path of translation file - if ($this->theme_selected != self::DEFAULT_THEME_NAME) + if ($this->theme_selected != self::DEFAULT_THEME_NAME || !_PS_MODE_DEV_) $i18n_dir = $this->translations_informations[$this->type_selected]['override']['dir']; else $i18n_dir = $this->translations_informations[$this->type_selected]['dir'];