// 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
This commit is contained in:
+6
-6
@@ -70,7 +70,7 @@ function displayJavascriptAlert($s){echo '<script type="text/javascript">alert(\
|
||||
|
||||
if (isset($_GET['ajaxProductManufacturers']))
|
||||
{
|
||||
$currentIndex = 'index.php?tab=AdminCatalog';
|
||||
AdminTab::$currentIndex = 'index.php?tab=AdminCatalog';
|
||||
$manufacturers = Manufacturer::getManufacturers();
|
||||
if ($manufacturers)
|
||||
{
|
||||
@@ -87,7 +87,7 @@ if (isset($_GET['ajaxReferrers']))
|
||||
|
||||
if (isset($_GET['ajaxProductSuppliers']))
|
||||
{
|
||||
$currentIndex = 'index.php?tab=AdminCatalog';
|
||||
AdminTab::$currentIndex = 'index.php?tab=AdminCatalog';
|
||||
$suppliers = Supplier::getSuppliers();
|
||||
if ($suppliers)
|
||||
{
|
||||
@@ -100,7 +100,7 @@ if (isset($_GET['ajaxProductSuppliers']))
|
||||
|
||||
if (isset($_GET['ajaxProductAccessories']))
|
||||
{
|
||||
$currentIndex = 'index.php?tab=AdminCatalog';
|
||||
AdminTab::$currentIndex = 'index.php?tab=AdminCatalog';
|
||||
$jsonArray = array();
|
||||
|
||||
$products = Db::getInstance()->ExecuteS('
|
||||
@@ -122,7 +122,7 @@ if (isset($_GET['ajaxProductAccessories']))
|
||||
|
||||
if (isset($_GET['ajaxDiscountCustomers']))
|
||||
{
|
||||
$currentIndex = 'index.php?tab=AdminDiscounts';
|
||||
AdminTab::$currentIndex = 'index.php?tab=AdminDiscounts';
|
||||
$jsonArray = array();
|
||||
$filter = Tools::getValue('filter');
|
||||
|
||||
@@ -180,14 +180,14 @@ if ($step = (int)(Tools::getValue('ajaxProductTab')))
|
||||
die (Tools::displayError('Product cannot be loaded'));
|
||||
|
||||
$switchArray = array(3 => 'displayFormPrices', 4 => 'displayFormAttributes', 5 => 'displayFormFeatures', 6 => 'displayFormCustomization', 7 => 'displayFormAttachments');
|
||||
$currentIndex = 'index.php?tab=AdminCatalog';
|
||||
AdminTab::$currentIndex = 'index.php?tab=AdminCatalog';
|
||||
if (key_exists($step, $switchArray))
|
||||
$admin->{$switchArray[$step]}($product, $languages, $defaultLanguage);
|
||||
}
|
||||
|
||||
if (isset($_GET['getAvailableFields']) and isset($_GET['entity']))
|
||||
{
|
||||
$currentIndex = 'index.php?tab=AdminImport';
|
||||
AdminTab::$currentIndex = 'index.php?tab=AdminImport';
|
||||
$jsonArray = array();
|
||||
require_once(dirname(__FILE__).'/tabs/AdminImport.php');
|
||||
$import = new AdminImport();
|
||||
|
||||
@@ -137,12 +137,10 @@ class AdminAttachments extends AdminTab
|
||||
parent::getList((int)$id_lang, $orderBy, $orderWay, $start, $limit);
|
||||
if(sizeof($this->_list))
|
||||
$this->_productAttachements = Attachment::getProductAttached((int)$id_lang, $this->_list);
|
||||
}
|
||||
}
|
||||
|
||||
protected function _displayDeleteLink($token = NULL, $id)
|
||||
{
|
||||
global $currentIndex;
|
||||
|
||||
$_cacheLang['Delete'] = $this->l('Delete');
|
||||
$_cacheLang['DeleteItem'] = $this->l('Delete item #', __CLASS__, TRUE, FALSE);
|
||||
|
||||
@@ -161,7 +159,7 @@ class AdminAttachments extends AdminTab
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
<a href="'.$currentIndex.'&'.$this->identifier.'='.$id.'&delete'.$this->table.'&token='.($token!=NULL ? $token : $this->token).'"
|
||||
<a href="'.self::$currentIndex.'&'.$this->identifier.'='.$id.'&delete'.$this->table.'&token='.($token!=NULL ? $token : $this->token).'"
|
||||
onclick="'.(isset($this->_productAttachements[$id]) ? 'return confirmProductAttached(\''.$productList.'\')' : 'return confirm(\''.$_cacheLang['DeleteItem'].$id.' ?'.(!is_null($this->specificConfirmDelete) ? '\r'.rtrim($this->specificConfirmDelete, ', ') : '').'\')' ).'">
|
||||
<img src="../img/admin/delete.gif" alt="'.$_cacheLang['Delete'].'" title="'.$_cacheLang['Delete'].'" /></a>';
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 '
|
||||
<fieldset style="width: 400px">
|
||||
<div style="float: right"><a href="'.$currentIndex.'&updategroup&id_group='.$obj->id.'&token='.$this->token.'"><img src="../img/admin/edit.gif" /></a></div>
|
||||
<div style="float: right"><a href="'.self::$currentIndex.'&updategroup&id_group='.$obj->id.'&token='.$this->token.'"><img src="../img/admin/edit.gif" /></a></div>
|
||||
<span style="font-weight: bold; font-size: 14px;">'.strval($obj->name[(int)$context->language->id]).'</span>
|
||||
<div class="clear"> </div>
|
||||
'.$this->l('Discount:').' '.(float)($obj->reduction).$this->l('%').'
|
||||
|
||||
@@ -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 '<br />
|
||||
<form action="'.$currentIndex.'&token='.$this->token.'" method="post">
|
||||
<form action="'.self::$currentIndex.'&token='.$this->token.'" method="post">
|
||||
<fieldset class="width4">
|
||||
<legend><img src="../img/admin/picture.gif" /> '.$this->l('Images').'</legend>'.'
|
||||
<p>'.$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.').'
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -127,7 +127,7 @@ class AdminThemes extends AdminPreferences
|
||||
echo '<br /><br />';
|
||||
if (@ini_get('allow_url_fopen') AND @fsockopen('addons.prestashop.com', 80, $errno, $errst, 3))
|
||||
echo '<script type="text/javascript">
|
||||
$.post("'.dirname($currentIndex).'/ajax.php",{page:"themes"},function(a){getE("prestastore-content").innerHTML="<legend><img src=\"../img/admin/prestastore.gif\" class=\"middle\" /> '.$this->l('Live from PrestaShop Addons!').'</legend>"+a;});
|
||||
$.post("'.dirname(self::$currentIndex).'/ajax.php",{page:"themes"},function(a){getE("prestastore-content").innerHTML="<legend><img src=\"../img/admin/prestastore.gif\" class=\"middle\" /> '.$this->l('Live from PrestaShop Addons!').'</legend>"+a;});
|
||||
</script>
|
||||
<fieldset id="prestastore-content" class="width3"></fieldset>';
|
||||
else
|
||||
|
||||
@@ -1347,7 +1347,6 @@ echo '</script>';
|
||||
{
|
||||
$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 '</script>';
|
||||
|
||||
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.'",
|
||||
|
||||
Reference in New Issue
Block a user