当前位置: 首页>>代码示例>>PHP>>正文


PHP AdminController::postProcess方法代码示例

本文整理汇总了PHP中AdminController::postProcess方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminController::postProcess方法的具体用法?PHP AdminController::postProcess怎么用?PHP AdminController::postProcess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AdminController的用法示例。


在下文中一共展示了AdminController::postProcess方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: postProcess

 public function postProcess()
 {
     if (!$this->can_add_customer && $this->display == 'add') {
         $this->redirect_after = $this->context->link->getAdminLink('AdminCustomers');
     }
     parent::postProcess();
 }
开发者ID:rrameshsat,项目名称:Prestashop,代码行数:7,代码来源:AdminCustomersController.php

示例2: postProcess

 public function postProcess()
 {
     if (Tools::isSubmit('submitLocalizationPack')) {
         $version = str_replace('.', '', _PS_VERSION_);
         $version = substr($version, 0, 2);
         if (Validate::isFileName(Tools::getValue('iso_localization_pack'))) {
             $pack = @Tools::file_get_contents('http://api.prestashop.com/localization/' . $version . '/' . Tools::getValue('iso_localization_pack') . '.xml');
             if (!$pack && !($pack = @Tools::file_get_contents(dirname(__FILE__) . '/../../localization/' . Tools::getValue('iso_localization_pack') . '.xml'))) {
                 $this->errors[] = Tools::displayError('Cannot load the localization pack.');
             }
             if (!($selection = Tools::getValue('selection'))) {
                 $this->errors[] = Tools::displayError('Please select at least one item to import.');
             } else {
                 foreach ($selection as $selected) {
                     if (!Validate::isLocalizationPackSelection($selected)) {
                         $this->errors[] = Tools::displayError('Invalid selection');
                         return;
                     }
                 }
                 $localization_pack = new LocalizationPack();
                 if (!$localization_pack->loadLocalisationPack($pack, $selection)) {
                     $this->errors = array_merge($this->errors, $localization_pack->getErrors());
                 } else {
                     Tools::redirectAdmin(self::$currentIndex . '&conf=23&token=' . $this->token);
                 }
             }
         }
     }
     // Remove the module list cache if the default country changed
     if (Tools::isSubmit('submitOptionsconfiguration') && file_exists(Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST)) {
         @unlink(Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST);
     }
     parent::postProcess();
 }
开发者ID:FAVHYAN,项目名称:a3workout,代码行数:34,代码来源:AdminLocalizationController.php

示例3: postProcess

 public function postProcess()
 {
     if (Tools::isSubmit('submitLocalizationPack')) {
         $version = str_replace('.', '', _PS_VERSION_);
         $version = substr($version, 0, 2);
         if (Validate::isFileName(Tools::getValue('iso_localization_pack'))) {
             $pack = @Tools::file_get_contents('http://api.prestashop.com/localization/' . $version . '/' . Tools::getValue('iso_localization_pack') . '.xml');
             if (!$pack && !($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")');
             }
             if (!($selection = Tools::getValue('selection'))) {
                 $this->errors[] = Tools::displayError('Please select at least one item to import.');
             } else {
                 foreach ($selection as $selected) {
                     if (!Validate::isLocalizationPackSelection($selected)) {
                         $this->errors[] = Tools::displayError('Invalid selection');
                         return;
                     }
                 }
                 $localization_pack = new LocalizationPack();
                 if (!$localization_pack->loadLocalisationPack($pack, $selection)) {
                     $this->errors = array_merge($this->errors, $localization_pack->getErrors());
                 } else {
                     Tools::redirectAdmin(self::$currentIndex . '&conf=23&token=' . $this->token);
                 }
             }
         }
     }
     parent::postProcess();
 }
开发者ID:jicheng17,项目名称:vipinsg,代码行数:30,代码来源:AdminLocalizationController.php

示例4: postProcess

 public function postProcess()
 {
     /* PrestaShop demo mode */
     if (_PS_MODE_DEMO_) {
         $this->errors[] = Tools::displayError('This functionality has been disabled.');
         return;
     }
     return parent::postProcess();
 }
开发者ID:jpodracky,项目名称:dogs,代码行数:9,代码来源:AdminRequestSqlController.php

示例5: postProcess

 public function postProcess()
 {
     if ($this->tabAccess['edit'] === '1' && Tools::getValue('submitAdd' . $this->table)) {
         if (($id = (int) Tools::getValue($this->identifier)) && ($obj = new $this->className($id)) && Validate::isLoadedObject($obj)) {
             $obj->setProducts($_POST['products']);
         }
     }
     return parent::postProcess();
 }
开发者ID:jicheng17,项目名称:pengwine,代码行数:9,代码来源:AdminTagsController.php

示例6: postProcess

 public function postProcess()
 {
     /* PrestaShop demo mode */
     if (_PS_MODE_DEMO_) {
         $this->errors[] = Tools::displayError('This functionality has been disabled.');
         return;
     }
     /* PrestaShop demo mode*/
     if (isset($_GET['delete' . $this->table]) && $_GET[$this->identifier] == (int) _PS_ADMIN_PROFILE_) {
         $this->errors[] = $this->l('For security reasons, you cannot delete the Administrator\'s profile.');
     } else {
         parent::postProcess();
     }
 }
开发者ID:dev-lav,项目名称:htdocs,代码行数:14,代码来源:AdminProfilesController.php

示例7: postProcess

 public function postProcess()
 {
     if (_PS_MODE_DEMO_) {
         $this->errors[] = $this->trans('This functionality has been disabled.', array(), 'Admin.Notifications.Error');
         return;
     }
     if (!extension_loaded('openssl')) {
         $this->displayWarning($this->l('Importing a new language may fail without the OpenSSL module. Please enable "openssl.so" on your server configuration.'));
     }
     if (Tools::isSubmit('submitLocalizationPack')) {
         $version = str_replace('.', '', _PS_VERSION_);
         $version = substr($version, 0, 2);
         if (($iso_localization_pack = Tools::getValue('iso_localization_pack')) && Validate::isFileName($iso_localization_pack)) {
             if (Tools::getValue('download_updated_pack') == '1' || defined('_PS_HOST_MODE_')) {
                 $pack = @Tools::file_get_contents(_PS_API_URL_ . '/localization/' . $version . '/' . $iso_localization_pack . '.xml');
             } else {
                 $pack = false;
             }
             if (defined('_PS_HOST_MODE_')) {
                 $path = _PS_CORE_DIR_ . '/localization/' . $iso_localization_pack . '.xml';
             } else {
                 $path = _PS_ROOT_DIR_ . '/localization/' . $iso_localization_pack . '.xml';
             }
             if (!$pack && !($pack = @Tools::file_get_contents($path))) {
                 $this->errors[] = $this->trans('Cannot load the localization pack.', array(), 'Admin.International.Notification');
             }
             if (!($selection = Tools::getValue('selection'))) {
                 $this->errors[] = $this->trans('Please select at least one item to import.', array(), 'Admin.International.Notification');
             } else {
                 foreach ($selection as $selected) {
                     if (!Validate::isLocalizationPackSelection($selected)) {
                         $this->errors[] = $this->trans('Invalid selection', array(), 'Admin.Notifications.Error');
                         return;
                     }
                 }
                 $localization_pack = new LocalizationPack();
                 if (!$localization_pack->loadLocalisationPack($pack, $selection, false, $iso_localization_pack)) {
                     $this->errors = array_merge($this->errors, $localization_pack->getErrors());
                 } else {
                     Tools::redirectAdmin(self::$currentIndex . '&conf=23&token=' . $this->token);
                 }
             }
         }
     }
     // Remove the module list cache if the default country changed
     if (Tools::isSubmit('submitOptionsconfiguration') && file_exists(Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST)) {
         @unlink(Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST);
     }
     parent::postProcess();
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:50,代码来源:AdminLocalizationController.php

示例8: postProcess

 public function postProcess()
 {
     /* Shipping fees */
     if (Tools::isSubmit('submitFees' . $this->table)) {
         if ($this->tabAccess['edit'] === '1') {
             if (($id_carrier = (int) Tools::getValue('id_carrier')) && $id_carrier == ($id_carrier2 = (int) Tools::getValue('id_carrier2'))) {
                 $carrier = new Carrier($id_carrier);
                 if (Validate::isLoadedObject($carrier)) {
                     /* Get configuration values */
                     $shipping_method = $carrier->getShippingMethod();
                     $rangeTable = $carrier->getRangeTable();
                     $carrier->deleteDeliveryPrice($rangeTable);
                     $currentList = Carrier::getDeliveryPriceByRanges($rangeTable, $id_carrier);
                     /* Build prices list */
                     $priceList = array();
                     foreach ($_POST as $key => $value) {
                         if (strstr($key, 'fees_')) {
                             $tmpArray = explode('_', $key);
                             $price = number_format(abs(str_replace(',', '.', $value)), 6, '.', '');
                             $current = 0;
                             foreach ($currentList as $item) {
                                 if ($item['id_zone'] == $tmpArray[1] && $item['id_' . $rangeTable] == $tmpArray[2]) {
                                     $current = $item;
                                 }
                             }
                             if ($current && $price == $current['price']) {
                                 continue;
                             }
                             $priceList[] = array('id_range_price' => $shipping_method == Carrier::SHIPPING_METHOD_PRICE ? (int) $tmpArray[2] : null, 'id_range_weight' => $shipping_method == Carrier::SHIPPING_METHOD_WEIGHT ? (int) $tmpArray[2] : null, 'id_carrier' => (int) $carrier->id, 'id_zone' => (int) $tmpArray[1], 'price' => $price);
                         }
                     }
                     /* Update delivery prices */
                     $carrier->addDeliveryPrice($priceList);
                     Tools::redirectAdmin(self::$currentIndex . '&conf=6&id_carrier=' . $carrier->id . '&token=' . $this->token);
                 } else {
                     $this->errors[] = Tools::displayError('An error occurred while attempting to update fees (cannot load carrier object).');
                 }
             } elseif (isset($id_carrier2)) {
                 $_POST['id_carrier'] = $id_carrier2;
             } else {
                 $this->errors[] = Tools::displayError('An error occurred while attempting to update fees (cannot load carrier object).');
             }
         } else {
             $this->errors[] = Tools::displayError('You do not have permission to edit this.');
         }
     } else {
         return parent::postProcess();
     }
 }
开发者ID:jpodracky,项目名称:dogs,代码行数:49,代码来源:AdminShippingController.php

示例9: postProcess

 public function postProcess()
 {
     $id = (int) Tools::getValue('id_' . $this->table);
     if (Tools::getValue('submitAdd' . $this->table)) {
         if (Tools::getValue('delimiter1') >= Tools::getValue('delimiter2')) {
             $this->errors[] = Tools::displayError('Invalid range');
         } elseif (!$id && RangeWeight::rangeExist((int) Tools::getValue('id_carrier'), (double) Tools::getValue('delimiter1'), (double) Tools::getValue('delimiter2'))) {
             $this->errors[] = Tools::displayError('The range already exists');
         } elseif (RangeWeight::isOverlapping((int) Tools::getValue('id_carrier'), (double) Tools::getValue('delimiter1'), (double) Tools::getValue('delimiter2'), $id ? (int) $id : null)) {
             $this->errors[] = Tools::displayError('Error: Ranges are overlapping');
         } elseif (!count($this->errors)) {
             parent::postProcess();
         }
     } else {
         parent::postProcess();
     }
 }
开发者ID:jpodracky,项目名称:dogs,代码行数:17,代码来源:AdminRangeWeightController.php

示例10: postProcess

 public function postProcess()
 {
     $upload_max_size = (int) str_replace('M', '', ini_get('upload_max_filesize'));
     $post_max_size = (int) str_replace('M', '', ini_get('post_max_size'));
     $max_size = $upload_max_size < $post_max_size ? $upload_max_size : $post_max_size;
     if (Tools::getValue('PS_LIMIT_UPLOAD_FILE_VALUE') > $max_size || Tools::getValue('PS_LIMIT_UPLOAD_IMAGE_VALUE') > $max_size) {
         $this->errors[] = Tools::displayError('The limit chosen is larger than the server\'s maximum upload limit. Please increase the limits of your server.');
         return;
     }
     if (Tools::getIsset('PS_LIMIT_UPLOAD_FILE_VALUE') && !Tools::getValue('PS_LIMIT_UPLOAD_FILE_VALUE')) {
         $_POST['PS_LIMIT_UPLOAD_FILE_VALUE'] = 1;
     }
     if (Tools::getIsset('PS_LIMIT_UPLOAD_IMAGE_VALUE') && !Tools::getValue('PS_LIMIT_UPLOAD_IMAGE_VALUE')) {
         $_POST['PS_LIMIT_UPLOAD_IMAGE_VALUE'] = 1;
     }
     parent::postProcess();
 }
开发者ID:dev-lav,项目名称:htdocs,代码行数:17,代码来源:AdminAdminPreferencesController.php

示例11: postProcess

 public function postProcess()
 {
     if ($this->tabAccess['edit'] === '1' && Tools::getValue('submitAdd' . $this->table)) {
         if (($id = (int) Tools::getValue($this->identifier)) && ($obj = new $this->className($id)) && Validate::isLoadedObject($obj)) {
             $previousProducts = $obj->getProducts();
             $removedProducts = array();
             foreach ($previousProducts as $product) {
                 if (!in_array($product['id_product'], $_POST['products'])) {
                     $removedProducts[] = $product['id_product'];
                 }
             }
             if (Configuration::get('PS_SEARCH_INDEXATION')) {
                 Search::removeProductsSearchIndex($removedProducts);
             }
             $obj->setProducts($_POST['products']);
         }
     }
     return parent::postProcess();
 }
开发者ID:dev-lav,项目名称:htdocs,代码行数:19,代码来源:AdminTagsController.php

示例12: postProcess

 public function postProcess()
 {
     if (Tools::isSubmit('submitAdddelivery')) {
         if (!Validate::isDate(Tools::getValue('date_from'))) {
             $this->errors[] = Tools::displayError('Invalid \'from\' date');
         }
         if (!Validate::isDate(Tools::getValue('date_to'))) {
             $this->errors[] = Tools::displayError('Invalid \'to\' date');
         }
         if (!count($this->errors)) {
             if (count(OrderInvoice::getByDeliveryDateInterval(Tools::getValue('date_from'), Tools::getValue('date_to')))) {
                 Tools::redirectAdmin($this->context->link->getAdminLink('AdminPdf') . '&submitAction=generateDeliverySlipsPDF&date_from=' . urlencode(Tools::getValue('date_from')) . '&date_to=' . urlencode(Tools::getValue('date_to')));
             } else {
                 $this->errors[] = Tools::displayError('No delivery slip was found for this period.');
             }
         }
     } else {
         parent::postProcess();
     }
 }
开发者ID:toufikadfab,项目名称:PrestaShop-1.5,代码行数:20,代码来源:AdminDeliverySlipController.php

示例13: postProcess

 public function postProcess()
 {
     if (Tools::getValue('submitAddorder_slip')) {
         if (!Validate::isDate(Tools::getValue('date_from'))) {
             $this->errors[] = $this->l('Invalid "From" date');
         }
         if (!Validate::isDate(Tools::getValue('date_to'))) {
             $this->errors[] = $this->l('Invalid "To" date');
         }
         if (!count($this->errors)) {
             $order_slips = OrderSlip::getSlipsIdByDate(Tools::getValue('date_from'), Tools::getValue('date_to'));
             if (count($order_slips)) {
                 Tools::redirectAdmin($this->context->link->getAdminLink('AdminPdf') . '&submitAction=generateOrderSlipsPDF&date_from=' . urlencode(Tools::getValue('date_from')) . '&date_to=' . urlencode(Tools::getValue('date_to')));
             }
             $this->errors[] = $this->l('No order slips were found for this period.');
         }
     } else {
         return parent::postProcess();
     }
 }
开发者ID:zangles,项目名称:lennyba,代码行数:20,代码来源:AdminSlipController.php

示例14: postProcess

 public function postProcess()
 {
     // When moving images, if duplicate images were found they are moved to a folder named duplicates/
     if (file_exists(_PS_PROD_IMG_DIR_ . 'duplicates/')) {
         $this->warnings[] = $this->l('Duplicate images were found when moving the product images. This is likely caused by unused demonstration images. Please make sure that the folder ') . _PS_PROD_IMG_DIR_ . 'duplicates/' . $this->l('only contains demonstration images, and then delete this folder.');
     }
     if (Tools::getValue('submitRegenerate' . $this->table)) {
         if ($this->tabAccess['edit'] === '1') {
             if ($this->_regenerateThumbnails(Tools::getValue('type'), Tools::getValue('erase'))) {
                 Tools::redirectAdmin(self::$currentIndex . '&conf=9' . '&token=' . $this->token);
             }
         } else {
             $this->errors[] = Tools::displayError('You do not have permission to edit here.');
         }
     } elseif (Tools::getValue('submitMoveImages' . $this->table)) {
         if ($this->tabAccess['edit'] === '1') {
             if ($this->_moveImagesToNewFileSystem()) {
                 Tools::redirectAdmin(self::$currentIndex . '&conf=25' . '&token=' . $this->token);
             }
         } else {
             $this->errors[] = Tools::displayError('You do not have permission to edit here.');
         }
     } elseif (Tools::getValue('submitImagePreferences')) {
         if ($this->tabAccess['edit'] === '1') {
             if ((int) Tools::getValue('PS_JPEG_QUALITY') < 0 || (int) Tools::getValue('PS_JPEG_QUALITY') > 100) {
                 $this->errors[] = Tools::displayError('Incorrect value for JPEG image quality.');
             } elseif ((int) Tools::getValue('PS_PNG_QUALITY') < 0 || (int) Tools::getValue('PS_PNG_QUALITY') > 9) {
                 $this->errors[] = Tools::displayError('Incorrect value for PNG image quality.');
             } elseif (!Configuration::updateValue('PS_IMAGE_QUALITY', Tools::getValue('PS_IMAGE_QUALITY')) || !Configuration::updateValue('PS_JPEG_QUALITY', Tools::getValue('PS_JPEG_QUALITY')) || !Configuration::updateValue('PS_PNG_QUALITY', Tools::getValue('PS_PNG_QUALITY'))) {
                 $this->errors[] = Tools::displayError('Unknown error.');
             } else {
                 return parent::postProcess();
             }
         } else {
             $this->errors[] = Tools::displayError('You do not have permission to edit here.');
         }
     } else {
         return parent::postProcess();
     }
 }
开发者ID:jicheng17,项目名称:pengwine,代码行数:40,代码来源:AdminImagesController.php

示例15: postProcess

 public function postProcess()
 {
     if (Tools::isSubmit('submitAddcart_rule') || Tools::isSubmit('submitAddcart_ruleAndStay')) {
         // If the reduction is associated to a specific product, then it must be part of the product restrictions
         if ((int) Tools::getValue('reduction_product') && Tools::getValue('apply_discount_to') == 'specific' && Tools::getValue('apply_discount') != 'off') {
             $reduction_product = (int) Tools::getValue('reduction_product');
             // First, check if it is not already part of the restrictions
             $already_restricted = false;
             if (is_array($rule_group_array = Tools::getValue('product_rule_group')) && count($rule_group_array) && Tools::getValue('product_restriction')) {
                 foreach ($rule_group_array as $rule_group_id) {
                     if (is_array($rule_array = Tools::getValue('product_rule_' . $rule_group_id)) && count($rule_array)) {
                         foreach ($rule_array as $rule_id) {
                             if (Tools::getValue('product_rule_' . $rule_group_id . '_' . $rule_id . '_type') == 'products' && in_array($reduction_product, Tools::getValue('product_rule_select_' . $rule_group_id . '_' . $rule_id))) {
                                 $already_restricted = true;
                                 break 2;
                             }
                         }
                     }
                 }
             }
             if ($already_restricted == false) {
                 // Check the product restriction
                 $_POST['product_restriction'] = 1;
                 // Add a new rule group
                 $rule_group_id = 1;
                 if (is_array($rule_group_array)) {
                     // Empty for (with a ; at the end), that just find the first rule_group_id available in rule_group_array
                     for ($rule_group_id = 1; in_array($rule_group_id, $rule_group_array); ++$rule_group_id) {
                         42;
                     }
                     $_POST['product_rule_group'][] = $rule_group_id;
                 } else {
                     $_POST['product_rule_group'] = array($rule_group_id);
                 }
                 // Set a quantity of 1 for this new rule group
                 $_POST['product_rule_group_' . $rule_group_id . '_quantity'] = 1;
                 // Add one rule to the new rule group
                 $_POST['product_rule_' . $rule_group_id] = array(1);
                 // Set a type 'product' for this 1 rule
                 $_POST['product_rule_' . $rule_group_id . '_1_type'] = 'products';
                 // Add the product in the selected products
                 $_POST['product_rule_select_' . $rule_group_id . '_1'] = array($reduction_product);
             }
         }
         // These are checkboxes (which aren't sent through POST when they are not check), so they are forced to 0
         foreach (array('country', 'carrier', 'group', 'cart_rule', 'product', 'shop') as $type) {
             if (!Tools::getValue($type . '_restriction')) {
                 $_POST[$type . '_restriction'] = 0;
             }
         }
         // Remove the gift if the radio button is set to "no"
         if (!(int) Tools::getValue('free_gift')) {
             $_POST['gift_product'] = 0;
         }
         // Retrieve the product attribute id of the gift (if available)
         if ($id_product = (int) Tools::getValue('gift_product')) {
             $_POST['gift_product_attribute'] = (int) Tools::getValue('ipa_' . $id_product);
         }
         // Idiot-proof control
         if (strtotime(Tools::getValue('date_from')) > strtotime(Tools::getValue('date_to'))) {
             $this->errors[] = Tools::displayError('The voucher cannot end before it begins.');
         }
         if ((int) Tools::getValue('minimum_amount') < 0) {
             $this->errors[] = Tools::displayError('The minimum amount cannot be lower than zero.');
         }
         if ((double) Tools::getValue('reduction_percent') < 0 || (double) Tools::getValue('reduction_percent') > 100) {
             $this->errors[] = Tools::displayError('Reduction percent must be between 0% and 100%');
         }
         if ((int) Tools::getValue('reduction_amount') < 0) {
             $this->errors[] = Tools::displayError('Reduction amount cannot be lower than zero.');
         }
         if (Tools::getValue('code') && ($same_code = (int) CartRule::getIdByCode(Tools::getValue('code'))) && $same_code != Tools::getValue('id_cart_rule')) {
             $this->errors[] = sprintf(Tools::displayError('This cart rule code is already used (conflict with cart rule %d)'), $same_code);
         }
         if (Tools::getValue('apply_discount') == 'off' && !Tools::getValue('free_shipping') && !Tools::getValue('free_gift')) {
             $this->errors[] = Tools::displayError('An action is required for this cart rule.');
         }
     }
     return parent::postProcess();
 }
开发者ID:toufikadfab,项目名称:PrestaShop-1.5,代码行数:80,代码来源:AdminCartRulesController.php


注:本文中的AdminController::postProcess方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。