'.$this->l('From:').'
diff --git a/admin-dev/tabs/AdminWebservice.php b/admin-dev/tabs/AdminWebservice.php
index bfef21577..29fe34ded 100755
--- a/admin-dev/tabs/AdminWebservice.php
+++ b/admin-dev/tabs/AdminWebservice.php
@@ -234,7 +234,6 @@ echo '
public function display()
{
- $context = Context::getContext();
// Include other tab in current tab
if ($this->includeSubTab('display', array('submitAdd2', 'add', 'update', 'view'))){}
@@ -252,7 +251,7 @@ echo '
}
elseif (isset($_GET['update'.$this->table]))
{
- if ($this->tabAccess['edit'] === '1' OR ($this->table == 'employee' AND $context->employee->id == Tools::getValue('id_employee')))
+ if ($this->tabAccess['edit'] === '1' OR ($this->table == 'employee' AND $this->context->employee->id == Tools::getValue('id_employee')))
{
$this->displayForm();
if ($this->tabAccess['view'])
@@ -268,7 +267,7 @@ echo '
{
$this->checkForWarning();
- $this->getList($context->language->id);
+ $this->getList($this->context->language->id);
$this->displayList();
$this->displayRequiredFields();
diff --git a/classes/AdminTab.php b/classes/AdminTab.php
index 99b960d9b..1edfd422e 100644
--- a/classes/AdminTab.php
+++ b/classes/AdminTab.php
@@ -176,7 +176,7 @@ abstract class AdminTabCore
public function __construct()
{
- $context = Context::getContext();
+ $this->context = Context::getContext();
$this->id = Tab::getCurrentTabId();
$this->_conf = array(
@@ -198,7 +198,7 @@ abstract class AdminTabCore
$className = get_class($this);
if ($className == 'AdminCategories' OR $className == 'AdminProducts')
$className = 'AdminCatalog';
- $this->token = Tools::getAdminToken($className.(int)$this->id.(int)$context->employee->id);
+ $this->token = Tools::getAdminToken($className.(int)$this->id.(int)$this->context->employee->id);
if (!Tools::isMultiShopActivated())
$this->shopLinkType = '';
@@ -247,7 +247,6 @@ abstract class AdminTabCore
*/
public function display()
{
- $context = Context::getContext();
// Include other tab in current tab
if ($this->includeSubTab('display', array('submitAdd2', 'add', 'update', 'view'))){}
@@ -265,7 +264,7 @@ abstract class AdminTabCore
}
elseif (isset($_GET['update'.$this->table]))
{
- if ($this->tabAccess['edit'] === '1' OR ($this->table == 'employee' AND $context->employee->id == Tools::getValue('id_employee')))
+ if ($this->tabAccess['edit'] === '1' OR ($this->table == 'employee' AND $this->context->employee->id == Tools::getValue('id_employee')))
{
$this->displayForm();
if ($this->tabAccess['view'])
@@ -279,7 +278,7 @@ abstract class AdminTabCore
else
{
- $this->getList($context->language->id);
+ $this->getList($this->context->language->id);
$this->displayList();
$this->displayOptionsList();
$this->displayRequiredFields();
@@ -543,7 +542,6 @@ abstract class AdminTabCore
// set token
$token = Tools::getValue('token') ? Tools::getValue('token') : $this->token;
- $context = Context::getContext();
// Sub included tab postProcessing
$this->includeSubTab('postProcess', array('status', 'submitAdd1', 'submitDel', 'delete', 'submitFilter', 'submitReset'));
@@ -669,7 +667,7 @@ abstract class AdminTabCore
/* Object update */
if (isset($id) AND !empty($id))
{
- if ($this->tabAccess['edit'] === '1' OR ($this->table == 'employee' AND $context->employee->id == Tools::getValue('id_employee') AND Tools::isSubmit('updateemployee')))
+ if ($this->tabAccess['edit'] === '1' OR ($this->table == 'employee' AND $this->context->employee->id == Tools::getValue('id_employee') AND Tools::isSubmit('updateemployee')))
{
$object = new $this->className($id);
if (Validate::isLoadedObject($object))
@@ -766,7 +764,7 @@ abstract class AdminTabCore
/* Cancel all filters for this tab */
elseif (isset($_POST['submitReset'.$this->table]))
{
- $filters = $context->cookie->getFamily($this->table.'Filter_');
+ $filters = $this->context->cookie->getFamily($this->table.'Filter_');
foreach ($filters AS $cookieKey => $filter)
if (strncmp($cookieKey, $this->table.'Filter_', 7 + Tools::strlen($this->table)) == 0)
{
@@ -775,14 +773,14 @@ abstract class AdminTabCore
$tmpTab = explode('!', $key);
$key = (count($tmpTab) > 1 ? $tmpTab[1] : $tmpTab[0]);
if (array_key_exists($key, $this->fieldsDisplay))
- unset($context->cookie->$cookieKey);
+ unset($this->context->cookie->$cookieKey);
}
- if (isset($context->cookie->{'submitFilter'.$this->table}))
- unset($context->cookie->{'submitFilter'.$this->table});
- if (isset($context->cookie->{$this->table.'Orderby'}))
- unset($context->cookie->{$this->table.'Orderby'});
- if (isset($context->cookie->{$this->table.'Orderway'}))
- unset($context->cookie->{$this->table.'Orderway'});
+ if (isset($this->context->cookie->{'submitFilter'.$this->table}))
+ unset($this->context->cookie->{'submitFilter'.$this->table});
+ if (isset($this->context->cookie->{$this->table.'Orderby'}))
+ unset($this->context->cookie->{$this->table.'Orderby'});
+ if (isset($this->context->cookie->{$this->table.'Orderway'}))
+ unset($this->context->cookie->{$this->table.'Orderway'});
unset($_POST);
}
@@ -793,9 +791,9 @@ abstract class AdminTabCore
}
/* Manage list filtering */
- elseif (Tools::isSubmit('submitFilter'.$this->table) OR $context->cookie->{'submitFilter'.$this->table} !== false)
+ elseif (Tools::isSubmit('submitFilter'.$this->table) OR $this->context->cookie->{'submitFilter'.$this->table} !== false)
{
- $_POST = array_merge($context->cookie->getFamily($this->table.'Filter_'), (isset($_POST) ? $_POST : array()));
+ $_POST = array_merge($this->context->cookie->getFamily($this->table.'Filter_'), (isset($_POST) ? $_POST : array()));
foreach ($_POST AS $key => $value)
{
/* Extracting filters from $_POST on key filter_ */
@@ -1151,22 +1149,21 @@ abstract class AdminTabCore
*/
public function getList($id_lang, $orderBy = NULL, $orderWay = NULL, $start = 0, $limit = NULL, $id_lang_shop = false)
{
- $context = Context::getContext();
/* Manage default params values */
if (empty($limit))
- $limit = ((!isset($context->cookie->{$this->table.'_pagination'})) ? $this->_pagination[1] : $limit = $context->cookie->{$this->table.'_pagination'});
+ $limit = ((!isset($this->context->cookie->{$this->table.'_pagination'})) ? $this->_pagination[1] : $limit = $this->context->cookie->{$this->table.'_pagination'});
if (!Validate::isTableOrIdentifier($this->table))
die (Tools::displayError('Table name is invalid:').' "'.$this->table.'"');
if (empty($orderBy))
- $orderBy = $context->cookie->__get($this->table.'Orderby') ? $context->cookie->__get($this->table.'Orderby') : $this->_defaultOrderBy;
+ $orderBy = $this->context->cookie->__get($this->table.'Orderby') ? $this->context->cookie->__get($this->table.'Orderby') : $this->_defaultOrderBy;
if (empty($orderWay))
- $orderWay = $context->cookie->__get($this->table.'Orderway') ? $context->cookie->__get($this->table.'Orderway') : 'ASC';
+ $orderWay = $this->context->cookie->__get($this->table.'Orderway') ? $this->context->cookie->__get($this->table.'Orderway') : 'ASC';
$limit = (int)(Tools::getValue('pagination', $limit));
- $context->cookie->{$this->table.'_pagination'} = $limit;
+ $this->context->cookie->{$this->table.'_pagination'} = $limit;
/* Check params validity */
if (!Validate::isOrderBy($orderBy) OR !Validate::isOrderWay($orderWay)
@@ -1197,14 +1194,14 @@ abstract class AdminTabCore
$selectShop = ', shop.name as shop_name ';
$joinShop = ' LEFT JOIN '._DB_PREFIX_.$this->shopLinkType.' shop
ON a.id_'.$this->shopLinkType.' = shop.id_'.$this->shopLinkType;
- $whereShop = $context->shop->sqlRestriction($this->shopShareDatas, 'a', $this->shopLinkType);
+ $whereShop = $this->context->shop->sqlRestriction($this->shopShareDatas, 'a', $this->shopLinkType);
}
$assos = Shop::getAssoTables();
if (isset($assos[$this->table]) && $assos[$this->table]['type'] == 'shop')
{
$filterKey = $assos[$this->table]['type'];
- $idenfierShop = $context->shop->getListOfID();
+ $idenfierShop = $this->context->shop->getListOfID();
}
else if (Context::shop() == Shop::CONTEXT_GROUP)
{
@@ -1212,7 +1209,7 @@ abstract class AdminTabCore
if (isset($assos[$this->table]) AND $assos[$this->table]['type'] == 'group_shop')
{
$filterKey = $assos[$this->table]['type'];
- $idenfierShop = array($context->shop->getGroupID());
+ $idenfierShop = array($this->context->shop->getGroupID());
}
}
@@ -1269,7 +1266,6 @@ abstract class AdminTabCore
*/
public function displayListHeader($token = NULL)
{
- $context = Context::getContext();
$isCms = false;
if (preg_match('/cms/Ui', $this->identifier))
$isCms = true;
@@ -1279,7 +1275,7 @@ abstract class AdminTabCore
$token = $this->token;
/* Determine total page number */
- $totalPages = ceil($this->_listTotal / Tools::getValue('pagination', (isset($context->cookie->{$this->table.'_pagination'}) ? $context->cookie->{$this->table.'_pagination'} : $this->_pagination[0])));
+ $totalPages = ceil($this->_listTotal / Tools::getValue('pagination', (isset($this->context->cookie->{$this->table.'_pagination'}) ? $this->context->cookie->{$this->table.'_pagination'} : $this->_pagination[0])));
if (!$totalPages) $totalPages = 1;
echo '
';
@@ -1311,7 +1307,7 @@ abstract class AdminTabCore
echo ' | '.$this->l('Display').'