public function postProcess()
 {
     global $currentIndex;
     if (isset($_POST['submitLocalization' . $this->table])) {
         if ($this->tabAccess['edit'] === '1') {
             $this->_postConfig($this->_fieldsLocalization);
         } else {
             $this->_errors[] = Tools::displayError('You do not have permission to edit here.');
         }
     } elseif (Tools::isSubmit('submitLocalizationPack')) {
         if (!($pack = @Tools::file_get_contents('http://www.prestashop.com/download/localization/' . Tools::getValue('iso_localization_pack') . '.xml')) and !($pack = @Tools::file_get_contents(dirname(__FILE__) . '/../../localization/' . Tools::getValue('iso_localization_pack') . '.xml'))) {
             $this->_errors[] = Tools::displayError('Cannot load localization pack (from prestashop.com and from your local folder "localization")');
         } elseif (!($selection = Tools::getValue('selection'))) {
             $this->_errors[] = Tools::displayError('Please select at least one content item to import.');
         } else {
             foreach ($selection as $selected) {
                 if (!Validate::isLocalizationPackSelection($selected)) {
                     $this->_errors[] = Tools::displayError('Invalid selection');
                     return;
                 }
             }
             $localizationPack = new LocalizationPack();
             if (!$localizationPack->loadLocalisationPack($pack, $selection)) {
                 $this->_errors = array_merge($this->_errors, $localizationPack->getErrors());
             } else {
                 Tools::redirectAdmin($currentIndex . '&conf=23&token=' . $this->token);
             }
         }
     }
     parent::postProcess();
 }
Ejemplo n.º 2
0
 public function postProcess()
 {
     if (isset($_POST['PS_SHOP_STATE_ID']) && $_POST['PS_SHOP_STATE_ID'] != '0') {
         $isStateOk = Db::getInstance()->getValue('SELECT `active` FROM `' . _DB_PREFIX_ . 'state` WHERE `id_country` = ' . (int) Tools::getValue('PS_SHOP_COUNTRY_ID') . ' AND `id_state` = ' . (int) Tools::getValue('PS_SHOP_STATE_ID'));
         if ($isStateOk != 1) {
             $this->_errors[] = Tools::displayError('This state is not in this country.');
         }
     }
     parent::postProcess();
 }
Ejemplo n.º 3
0
 /** this functions make checks about AdminThemes configuration edition only.
  * 
  * @since 1.4
  */
 public function postProcess()
 {
     // new check compatibility theme feature (1.4) :
     $val = Tools::getValue('PS_THEME');
     Configuration::updateValue('PS_IMG_UPDATE_TIME', time());
     if (!empty($val) and !$this->_isThemeCompatible($val)) {
         // don't submit if errors
         unset($_POST['submitThemes' . $this->table]);
     }
     parent::postProcess();
 }
Ejemplo n.º 4
0
 /**
  * Checks submitted values
  *
  * @since 1.4
  */
 public function postProcess()
 {
     // FPDF does not support PNG images with alpha channel
     if (isset($_FILES['PS_LOGO_INVOICE']) && $_FILES['PS_LOGO_INVOICE']['type'] == 'image/png') {
         $this->_errors[] = Tools::displayError('Invoice logo does not accept PNG images.');
     }
     global $smarty;
     /* PrestaShop demo mode */
     if (_PS_MODE_DEMO_) {
         $this->_errors[] = Tools::displayError('This functionnality has been disabled.');
         return;
     }
     /* PrestaShop demo mode*/
     // new check compatibility theme feature (1.4) :
     $val = Tools::getValue('PS_THEME');
     Configuration::updateValue('PS_IMG_UPDATE_TIME', time());
     if (!empty($val) and !$this->_isThemeCompatible($val)) {
         // don't submit if errors
         unset($_POST['submitThemes' . $this->table]);
     }
     Tools::clearCache($smarty);
     parent::postProcess();
 }
Ejemplo n.º 5
0
 /** this functions make checks about AdminThemes configuration edition only.
  * 
  * @since 1.4
  */
 public function postProcess()
 {
     global $smarty;
     /* PrestaShop demo mode */
     if (_PS_MODE_DEMO_) {
         $this->_errors[] = Tools::displayError('This functionnality has been disabled.');
         return;
     }
     /* PrestaShop demo mode*/
     // new check compatibility theme feature (1.4) :
     $val = Tools::getValue('PS_THEME');
     Configuration::updateValue('PS_IMG_UPDATE_TIME', time());
     if (!empty($val) and !$this->_isThemeCompatible($val)) {
         // don't submit if errors
         unset($_POST['submitThemes' . $this->table]);
     }
     Tools::clearCache($smarty);
     parent::postProcess();
 }