// Context part 11

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7644 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2011-07-18 15:50:58 +00:00
parent 0452f08f64
commit 2c493137c3
60 changed files with 378 additions and 520 deletions
+5 -6
View File
@@ -34,8 +34,7 @@ class AdminStores extends AdminTab
public function __construct()
{
global $cookie;
$context = Context::getContext();
$this->table = 'store';
$this->className = 'Store';
$this->lang = false;
@@ -46,10 +45,10 @@ class AdminStores extends AdminTab
$this->_select = 'cl.`name` country, st.`name` state';
$this->_join = '
LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (cl.`id_country` = a.`id_country` AND cl.`id_lang` = '.(int)($cookie->id_lang).')
LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (cl.`id_country` = a.`id_country` AND cl.`id_lang` = '.(int)$context->language->id.')
LEFT JOIN `'._DB_PREFIX_.'state` st ON (st.`id_state` = a.`id_state`)';
$countries = Country::getCountries((int)($cookie->id_lang));
$countries = Country::getCountries($context->language->id);
foreach ($countries AS $country)
$this->countriesArray[$country['id_country']] = $country['name'];
@@ -146,7 +145,7 @@ class AdminStores extends AdminTab
public function displayForm($isMainTab = true)
{
global $currentIndex, $cookie;
$context = Context::getContext();
parent::displayForm();
if (!($obj = $this->loadObject(true)))
@@ -260,7 +259,7 @@ class AdminStores extends AdminTab
<input type="file" name="image" />
<p class="clear">'.$this->l('Store window picture').'</p>';
echo $this->displayImage($obj->id, _PS_STORE_IMG_DIR_.'/'.$obj->id.'.jpg', 350, NULL, Tools::getAdminToken('AdminStores'.(int)(Tab::getIdFromClassName('AdminStores')).(int)($cookie->id_employee)), true);
echo $this->displayImage($obj->id, _PS_STORE_IMG_DIR_.'/'.$obj->id.'.jpg', 350, NULL, Tools::getAdminToken('AdminStores'.(int)(Tab::getIdFromClassName('AdminStores')).(int)$context->employee->id), true);
echo '</div>
<table cellpadding="2" cellspacing="2" style="padding: 10px; margin-top: 15px; border: 1px solid #BBB;">