diff --git a/controllers/admin/AdminGeolocationController.php b/controllers/admin/AdminGeolocationController.php index 6d5cf8c8a..fb0e86aa5 100755 --- a/controllers/admin/AdminGeolocationController.php +++ b/controllers/admin/AdminGeolocationController.php @@ -35,7 +35,6 @@ class AdminGeolocationControllerCore extends AdminController 'geolocationConfiguration' => array( 'title' => $this->l('Geolocation by IP:'), 'icon' => 'world', - 'class' => 'width3', 'fields' => array( 'PS_GEOLOCATION_ENABLED' => array( 'title' => $this->l('Geolocation by IP:'), @@ -45,12 +44,10 @@ class AdminGeolocationControllerCore extends AdminController 'type' => 'bool' ), ), - 'submit' => array(), ), 'geolocationCountries' => array( 'title' => $this->l('Options'), 'icon' => 'world', - 'class' => 'width4', 'description' => $this->l('The following features are only available if you enable the Geolocation by IP feature.'), 'fields' => array( 'PS_GEOLOCATION_BEHAVIOR' => array( @@ -75,12 +72,10 @@ class AdminGeolocationControllerCore extends AdminController 'list' => Country::getCountries($this->context->language->id) ), ), - 'submit' => array(), ), 'geolocationWhitelist' => array( 'title' => $this->l('Whitelist of IP addresses'), 'icon' => 'world', - 'class' => 'width3', 'description' => $this->l('You can add many IP addresses, these addresses will always be allowed to access your shop (e.g. Google bots IP).'), 'fields' => array( 'PS_GEOLOCATION_WHITELIST' => array('title' => $this->l('Allowed IP addresses:'), 'type' => 'textarea_newlines', 'cols' => 80, 'rows' => 30), @@ -92,19 +87,17 @@ class AdminGeolocationControllerCore extends AdminController public function postProcess() { - if (Tools::isSubmit('submitGeolocationConfiguration')) + if (Tools::isSubmit('submitGeolocationWhitelist')) { + $redirectAdmin = false; if ($this->isGeoLiteCityAvailable()) { Configuration::updateValue('PS_GEOLOCATION_ENABLED', intval(Tools::getValue('PS_GEOLOCATION_ENABLED'))); - Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4'); + $redirectAdmin = true; } else $this->_errors[] = Tools::displayError('Geolocation database is unavailable.'); - } - if (Tools::isSubmit('submitGeolocationCountries')) - { if (!is_array(Tools::getValue('countries')) || !count(Tools::getValue('countries'))) $this->_errors[] = Tools::displayError('Country selection is invalid'); else @@ -115,12 +108,9 @@ class AdminGeolocationControllerCore extends AdminController ); Configuration::updateValue('PS_GEOLOCATION_NA_BEHAVIOR', (int)Tools::getValue('PS_GEOLOCATION_NA_BEHAVIOR')); Configuration::updateValue('PS_ALLOWED_COUNTRIES', implode(';', Tools::getValue('countries'))); - Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4'); + $redirectAdmin = true; } - } - if (Tools::isSubmit('submitGeolocationWhitelist')) - { if (!Validate::isCleanHtml(Tools::getValue('PS_GEOLOCATION_WHITELIST'))) $this->_errors[] = Tools::displayError('Invalid whitelist'); else @@ -129,8 +119,11 @@ class AdminGeolocationControllerCore extends AdminController 'PS_GEOLOCATION_WHITELIST', str_replace("\n", ';', str_replace("\r", '', Tools::getValue('PS_GEOLOCATION_WHITELIST'))) ); - Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4'); + $redirectAdmin = true; } + + if ($redirectAdmin) + Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4'); } return parent::postProcess(); @@ -145,6 +138,7 @@ class AdminGeolocationControllerCore extends AdminController public function initContent() { + $this->display = 'options'; if (!$this->isGeoLiteCityAvailable()) $this->displayWarning($this->l('In order to use Geolocation, please download').' '.$this->l('this file').' '. diff --git a/css/admin.css b/css/admin.css index cb596552b..69967b001 100644 --- a/css/admin.css +++ b/css/admin.css @@ -1695,6 +1695,8 @@ fieldset .optionsDescription{ margin-bottom: 15px; padding: 5px 5px 5px 40px; border-radius:3px; + min-height:32px; + line-height:32px; } p.preference_description{