// Context part 9

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7637 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2011-07-18 10:08:07 +00:00
parent 311e8ab964
commit 0dbcebf01e
39 changed files with 290 additions and 445 deletions
+5 -6
View File
@@ -44,15 +44,14 @@ class AdminContact extends AdminPreferences
private function _getDefaultFieldsContent()
{
global $cookie;
$context = Context::getContext();
$countryList = array();
$countryList[] = array('id' => '0', 'name' => $this->l('Choose your country'));
foreach (Country::getCountries(intval($cookie->id_lang)) AS $country)
foreach (Country::getCountries($context->language->id) AS $country)
$countryList[] = array('id' => $country['id_country'], 'name' => $country['name']);
$stateList = array();
$stateList[] = array('id' => '0', 'name' => $this->l('Choose your state (if applicable)'));
foreach (State::getStates(intval($cookie->id_lang)) AS $state)
foreach (State::getStates($context->language->id) AS $state)
$stateList[] = array('id' => $state['id_state'], 'name' => $state['name']);
$formFields = array(
@@ -109,10 +108,10 @@ class AdminContact extends AdminPreferences
protected function _postConfig($fields)
{
global $cookie;
$context = Context::getContext();
if (!$this->_errors && isset($_POST['PS_SHOP_COUNTRY_ID']))
{
$country = new Country((int)($_POST['PS_SHOP_COUNTRY_ID']), intval($cookie->id_lang));
$country = new Country($_POST['PS_SHOP_COUNTRY_ID'], $context->language->id);
Configuration::updateValue('PS_SHOP_COUNTRY', pSQL($country->name));
}
if (!$this->_errors && isset($_POST['PS_SHOP_STATE_ID']))