From a1a32714abbec551cb42ed1b0845381e46afab71 Mon Sep 17 00:00:00 2001 From: rMalie Date: Thu, 28 Jul 2011 14:12:17 +0000 Subject: [PATCH] // Fix #PSFV-30 + context part 24 git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7792 b9a71923-0436-4b27-9f14-aed3839534dd --- admin-dev/ajax.php | 12 ++++++------ admin-dev/tabs/AdminAttachments.php | 6 ++---- admin-dev/tabs/AdminDiscounts.php | 2 +- admin-dev/tabs/AdminGroups.php | 4 ++-- admin-dev/tabs/AdminImages.php | 7 +++---- admin-dev/tabs/AdminProducts.php | 2 +- admin-dev/tabs/AdminReturn.php | 2 +- admin-dev/tabs/AdminThemes.php | 2 +- admin-dev/tabs/AdminUpgrade.php | 4 +--- classes/AdminTab.php | 2 +- modules/gcheckout/gcheckout.php | 4 ++-- modules/hipay/hipay.php | 6 +++--- modules/mailalerts/mailalerts.php | 6 ++---- modules/paypal/paypal.php | 12 ++++++------ modules/secuvad/classes/Secuvad_connection.php | 2 +- modules/secuvad/secuvad.php | 4 ++-- modules/statscheckup/statscheckup.php | 6 +++--- modules/statsforecast/statsforecast.php | 4 ++-- modules/statsproduct/statsproduct.php | 4 ++-- modules/statsstock/statsstock.php | 4 ++-- modules/themeinstallator/themeinstallator.php | 4 ++-- modules/twenga/twenga.php | 3 +-- 22 files changed, 47 insertions(+), 55 deletions(-) diff --git a/admin-dev/ajax.php b/admin-dev/ajax.php index f1817a731..40cb370ab 100644 --- a/admin-dev/ajax.php +++ b/admin-dev/ajax.php @@ -70,7 +70,7 @@ function displayJavascriptAlert($s){echo ' - '.$_cacheLang['Delete'].''; } diff --git a/admin-dev/tabs/AdminDiscounts.php b/admin-dev/tabs/AdminDiscounts.php index 246ae44d6..ff7571783 100644 --- a/admin-dev/tabs/AdminDiscounts.php +++ b/admin-dev/tabs/AdminDiscounts.php @@ -347,7 +347,7 @@ class AdminDiscounts extends AdminTab if ($(\'#filter\').val()) filterValue = $(\'#filter\').val(); - $.getJSON("'.dirname($currentIndex).'/ajax.php",{ajaxDiscountCustomers:1,filter:filterValue}, + $.getJSON("'.dirname(self::$currentIndex).'/ajax.php",{ajaxDiscountCustomers:1,filter:filterValue}, function(obj) { var groups_length = obj.groups.length; if (obj.groups.length == 0) diff --git a/admin-dev/tabs/AdminGroups.php b/admin-dev/tabs/AdminGroups.php index 45efeb00c..8d6469ecd 100644 --- a/admin-dev/tabs/AdminGroups.php +++ b/admin-dev/tabs/AdminGroups.php @@ -168,13 +168,13 @@ class AdminGroups extends AdminTab public function viewgroup() { $context = Context::getContext(); - $currentIndex = 'index.php?tab=AdminGroups'; + self::$currentIndex = 'index.php?tab=AdminGroups'; if (!($obj = $this->loadObject(true))) return; echo '
-
+
'.strval($obj->name[(int)$context->language->id]).'
 
'.$this->l('Discount:').' '.(float)($obj->reduction).$this->l('%').' diff --git a/admin-dev/tabs/AdminImages.php b/admin-dev/tabs/AdminImages.php index 9273a947a..1ba072551 100644 --- a/admin-dev/tabs/AdminImages.php +++ b/admin-dev/tabs/AdminImages.php @@ -71,7 +71,7 @@ class AdminImages extends AdminTab if ($this->tabAccess['edit'] === '1') { if($this->_moveImagesToNewFileSystem()) - Tools::redirectAdmin($currentIndex.'&conf=25'.'&token='.$this->token); + Tools::redirectAdmin(self::$currentIndex.'&conf=25'.'&token='.$this->token); } else $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); @@ -90,7 +90,7 @@ class AdminImages extends AdminTab || !Configuration::updateValue('PS_PNG_QUALITY', Tools::getValue('PS_PNG_QUALITY'))) $this->_errors[] = Tools::displayError('Unknown error.'); else - Tools::redirectAdmin($currentIndex.'&token='.Tools::getValue('token').'&conf=4'); + Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4'); } else $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); @@ -487,9 +487,8 @@ class AdminImages extends AdminTab */ public function displayImagePreferences() { - global $currentIndex; echo '
-
+
'.$this->l('Images').''.'

'.$this->l('JPEG images have a small file size and standard quality. PNG images have a bigger file size, a higher quality and support transparency. Note that in all cases the image files will have the .jpg extension.').' diff --git a/admin-dev/tabs/AdminProducts.php b/admin-dev/tabs/AdminProducts.php index 090525ae3..eb2949732 100644 --- a/admin-dev/tabs/AdminProducts.php +++ b/admin-dev/tabs/AdminProducts.php @@ -1188,7 +1188,7 @@ class AdminProducts extends AdminTab $this->_errors[] = Tools::displayError('An error occurred while adding tags.'); elseif ($id_image = $this->addProductImage($object, Tools::getValue('resizer'))) { - $currentIndex .= '&image_updated='.(int)Tools::getValue('id_image'); + self::$currentIndex .= '&image_updated='.(int)Tools::getValue('id_image'); Hook::updateProduct($object); Search::indexation(false, $object->id); if (Tools::getValue('resizer') == 'man' && isset($id_image) AND is_int($id_image) AND $id_image) diff --git a/admin-dev/tabs/AdminReturn.php b/admin-dev/tabs/AdminReturn.php index eb3cd689f..bfbd7368c 100644 --- a/admin-dev/tabs/AdminReturn.php +++ b/admin-dev/tabs/AdminReturn.php @@ -105,7 +105,7 @@ class AdminReturn extends AdminTab Mail::Send((int)$order->id_lang, 'order_return_state', Mail::l('Your order return state has changed', $order->id_lang), $vars, $customer->email, $customer->firstname.' '.$customer->lastname, NULL, NULL, NULL, NULL, _PS_MAIL_DIR_, true); - Tools::redirectAdmin($currentIndex.'&conf=4&token='.$this->token); + Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token); } } else diff --git a/admin-dev/tabs/AdminThemes.php b/admin-dev/tabs/AdminThemes.php index 8582daf97..b736c6137 100644 --- a/admin-dev/tabs/AdminThemes.php +++ b/admin-dev/tabs/AdminThemes.php @@ -127,7 +127,7 @@ class AdminThemes extends AdminPreferences echo '

'; if (@ini_get('allow_url_fopen') AND @fsockopen('addons.prestashop.com', 80, $errno, $errst, 3)) echo '

'; else diff --git a/admin-dev/tabs/AdminUpgrade.php b/admin-dev/tabs/AdminUpgrade.php index d429103f3..b739f3f6f 100755 --- a/admin-dev/tabs/AdminUpgrade.php +++ b/admin-dev/tabs/AdminUpgrade.php @@ -1347,7 +1347,6 @@ echo ''; { $this->displayWarning('This function is experimental. It\'s currently recommended to make a backup of your files and database.'); - global $currentIndex; if ($this->apacheModExists('mod_evasive')) sleep(1); // update['name'] = version name @@ -1370,7 +1369,6 @@ echo ''; private function _getJsInit() { - global $currentIndex; $js = ''; $js .= ' function ucFirst(str) { @@ -1509,7 +1507,7 @@ function afterBackupFiles() function doAjaxRequest(action, nextParams){ req = $.ajax({ type:"POST", - url : "'.str_replace('index','ajax-tab',$currentIndex).'", + url : "'.str_replace('index', 'ajax-tab', self::$currentIndex).'", async: true, data : { dir:"'.$this->adminDir.'", diff --git a/classes/AdminTab.php b/classes/AdminTab.php index 3f864f195..99b960d9b 100644 --- a/classes/AdminTab.php +++ b/classes/AdminTab.php @@ -1355,7 +1355,7 @@ abstract class AdminTabCore { // Cleaning links if (Tools::getValue($this->table.'Orderby') && Tools::getValue($this->table.'Orderway')) - self::$currentIndex = preg_replace('/&'.$this->table.'Orderby=([a-z _]*)&'.$this->table.'Orderway=([a-z]*)/i', '', $currentIndex); + self::$currentIndex = preg_replace('/&'.$this->table.'Orderby=([a-z _]*)&'.$this->table.'Orderway=([a-z]*)/i', '', self::$currentIndex); echo '
'; diff --git a/modules/gcheckout/gcheckout.php b/modules/gcheckout/gcheckout.php index 3b993d2be..80aaec926 100644 --- a/modules/gcheckout/gcheckout.php +++ b/modules/gcheckout/gcheckout.php @@ -74,7 +74,7 @@ class GCheckout extends PaymentModule public function getContent() { - global $currentIndex, $cookie; + global $cookie; if (Tools::isSubmit('submitGoogleCheckout')) { @@ -100,7 +100,7 @@ class GCheckout extends PaymentModule Configuration::updateValue('GCHECKOUT_NO_SHIPPING', 0); if (!sizeof($errors)) - Tools::redirectAdmin($currentIndex.'&configure=gcheckout&token='.Tools::getValue('token').'&conf=4'); + Tools::redirectAdmin(AdminTab::$currentIndex.'&configure=gcheckout&token='.Tools::getValue('token').'&conf=4'); foreach ($errors as $error) echo $error; } diff --git a/modules/hipay/hipay.php b/modules/hipay/hipay.php index 0ac074435..3fe2ac85d 100644 --- a/modules/hipay/hipay.php +++ b/modules/hipay/hipay.php @@ -320,7 +320,7 @@ class Hipay extends PaymentModule public function getContent() { - global $currentIndex, $cookie; + global $cookie; $currencies = DB::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT c.iso_code, c.name, c.sign FROM '._DB_PREFIX_.'currency c'); @@ -421,7 +421,7 @@ class Hipay extends PaymentModule '; } - $link = $currentIndex.'&configure='.$this->name.'&token='.Tools::getValue('token'); + $link = AdminTab::$currentIndex.'&configure='.$this->name.'&token='.Tools::getValue('token'); $form = ' - + '; foreach ($arrayConf as $conf => $translations) @@ -161,7 +161,7 @@ class StatsCheckUp extends Module
 
- + '.$this->l('Order by').' '; foreach ($this->getProducts($cookie->id_lang) AS $product) - $this->_html .= ''; + $this->_html .= ''; $this->_html .= '
'.$arrayColors[0].' '.$this->l('Not enough').''.$arrayColors[2].' '.$this->l('Alright').'
'.$product['reference'].''.$product['name'].''.$product['quantity'].'
'.$product['reference'].''.$product['name'].''.$product['quantity'].'


'.$this->l('CSV Export').'
'; } diff --git a/modules/statsstock/statsstock.php b/modules/statsstock/statsstock.php index cc468495d..b503addfc 100644 --- a/modules/statsstock/statsstock.php +++ b/modules/statsstock/statsstock.php @@ -51,12 +51,12 @@ class StatsStock extends Module function hookAdminStatsModules() { - global $cookie, $currentIndex; + global $cookie; if (Tools::isSubmit('submitCategory')) $cookie->statsstock_id_category = Tools::getValue('statsstock_id_category'); - $ru = $currentIndex.'&module='.$this->name.'&token='.Tools::getValue('token'); + $ru = AdminTab::$currentIndex.'&module='.$this->name.'&token='.Tools::getValue('token'); $currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); $filter = ((int)$cookie->statsstock_id_category ? ' AND p.id_product IN (SELECT cp.id_product FROM '._DB_PREFIX_.'category_product cp WHERE cp.id_category = '.(int)$cookie->statsstock_id_category.')' : ''); diff --git a/modules/themeinstallator/themeinstallator.php b/modules/themeinstallator/themeinstallator.php index d44ddebe4..4a1328789 100644 --- a/modules/themeinstallator/themeinstallator.php +++ b/modules/themeinstallator/themeinstallator.php @@ -162,7 +162,7 @@ class ThemeInstallator extends Module private function init_defines() { - global $currentIndex, $cookie; + global $cookie; define('_EXPORT_FOLDER_', dirname(__FILE__).'/export/'); define('_IMPORT_FOLDER_', dirname(__FILE__).'/import/'); @@ -174,7 +174,7 @@ class ThemeInstallator extends Module if (!Tools::isSubmit('cancelExport') AND (Tools::isSubmit('exportTheme') OR Tools::isSubmit('submitExport'))) $this->page = 'exportPage'; - $this->_html = ''; + $this->_html = ''; if (Tools::isSubmit('modulesToExport') OR Tools::isSubmit('submitModules')) $this->to_export = Tools::getValue('modulesToExport'); diff --git a/modules/twenga/twenga.php b/modules/twenga/twenga.php index d830ed8ab..10acd2b83 100644 --- a/modules/twenga/twenga.php +++ b/modules/twenga/twenga.php @@ -117,8 +117,7 @@ class Twenga extends PaymentModule public function __construct() { // Basic vars - global $currentIndex; - $this->current_index = $currentIndex; + $this->current_index = AdminTab::$currentIndex; $this->token = Tools::getValue('token'); $this->name = 'twenga'; $this->tab = 'smart_shopping';