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


PHP AdminController::processUpdate方法代码示例

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


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

示例1: processUpdate

 public function processUpdate()
 {
     if (_PS_MODE_DEMO_) {
         $this->errors[] = Tools::displayError('This functionality has been disabled.');
         return;
     }
     if ((isset($_FILES['no_picture']) && !$_FILES['no_picture']['error'] || isset($_FILES['flag']) && !$_FILES['flag']['error']) && Validate::isLanguageIsoCode(Tools::getValue('iso_code'))) {
         if ($_FILES['no_picture']['error'] == UPLOAD_ERR_OK) {
             $this->copyNoPictureImage(strtolower(Tools::getValue('iso_code')));
         }
         // class AdminTab deal with every $_FILES content, don't do that for no_picture
         unset($_FILES['no_picture']);
     }
     /** @var Language $object */
     $object = $this->loadObject();
     if (Tools::getValue('active') != (int) $object->active) {
         if (!$this->checkDisableStatus($object)) {
             return false;
         }
     }
     $this->checkEmployeeIdLang($object->id);
     return parent::processUpdate();
 }
开发者ID:ortegon000,项目名称:tienda,代码行数:23,代码来源:AdminLanguagesController.php

示例2: processUpdate

 /**
  * @see AdminController::processUpdate();
  */
 public function processUpdate()
 {
     // loads object
     if (!($object = $this->loadObject(true))) {
         return;
     }
     /** @var Warehouse $object */
     $this->updateAddress();
     // handles carriers associations
     $ids_carriers_selected = Tools::getValue('ids_carriers_selected');
     if (Tools::isSubmit('ids_carriers_selected') && !empty($ids_carriers_selected)) {
         $object->setCarriers($ids_carriers_selected);
     } else {
         $object->setCarriers(Tools::getValue('ids_carriers_available'));
     }
     return parent::processUpdate();
 }
开发者ID:prestanesia,项目名称:PrestaShop,代码行数:20,代码来源:AdminWarehousesController.php

示例3: processUpdate

    public function processUpdate()
    {
        $country = $this->loadObject();
        if (Validate::isLoadedObject($country) && Tools::getValue('id_zone')) {
            $old_id_zone = $country->id_zone;
            $results = Db::getInstance()->executeS('SELECT `id_state` FROM `' . _DB_PREFIX_ . 'state` WHERE `id_country` = ' . (int) $country->id . ' AND `id_zone` = ' . (int) $old_id_zone);
            if ($results && count($results)) {
                $ids = array();
                foreach ($results as $res) {
                    $ids[] = (int) $res['id_state'];
                }
                if (count($ids)) {
                    $res = Db::getInstance()->execute('UPDATE `' . _DB_PREFIX_ . 'state` 
							SET `id_zone` = ' . (int) Tools::getValue('id_zone') . ' 
							WHERE `id_state` IN (' . implode(',', $ids) . ')');
                }
            }
        }
        return parent::processUpdate();
    }
开发者ID:AmineBENCHEIKHBRAHIM,项目名称:LnsTech-Prestashop-WebSite,代码行数:20,代码来源:AdminCountriesController.php

示例4: processUpdate

    public function processUpdate()
    {
        if (Validate::isLoadedObject($this->object)) {
            $customer_email = strval(Tools::getValue('email'));
            // check if e-mail already used
            if ($customer_email != $this->object->email) {
                $customer = new Customer();
                if (Validate::isEmail($customer_email)) {
                    $customer->getByEmail($customer_email);
                }
                if ($customer->id && $customer->id != (int) $this->object->id) {
                    $this->errors[] = Tools::displayError('An account already exists for this email address:') . ' ' . $customer_email;
                }
            }
            return parent::processUpdate();
        } else {
            $this->errors[] = Tools::displayError('An error occurred while loading the object.') . '
				<b>' . $this->table . '</b> ' . Tools::displayError('(cannot load object)');
        }
    }
开发者ID:nmardones,项目名称:PrestaShop,代码行数:20,代码来源:AdminCustomersController.php

示例5: processUpdate

 /**
  * Override processUpdate to change SaveAndStay button action
  * @see classes/AdminControllerCore::processUpdate()
  */
 public function processUpdate()
 {
     $object = parent::processUpdate();
     if (Tools::isSubmit('submitAdd' . $this->table . 'AndStay') && !count($this->errors)) {
         if ($this->display == 'add') {
             $this->redirect_after = self::$currentIndex . '&' . $this->identifier . '=&conf=3&update' . $this->table . '&token=' . $this->token;
         } else {
             $this->redirect_after = self::$currentIndex . '&' . $this->identifier . '=&id_attribute_group=' . (int) Tools::getValue('id_attribute_group') . '&conf=3&update' . $this->table . '&token=' . $this->token;
         }
     }
     if (count($this->errors)) {
         $this->setTypeAttribute();
     }
     return $object;
 }
开发者ID:rongandat,项目名称:vatfairfoot,代码行数:19,代码来源:AdminAttributesGroupsController.php

示例6: processUpdate

 public function processUpdate()
 {
     $id = Tools::getValue('block_identifier');
     $block = BelvgStaticBlocks::getBlockByIdentifier($id);
     if ($block === FALSE || $block->id == $_POST[$this->identifier]) {
         return parent::processUpdate();
     }
     $this->errors[] = Tools::displayError('Duplicate field "block_identifier".');
     $this->display = 'edit';
     return FALSE;
 }
开发者ID:ecssjapan,项目名称:guiding-you-afteropen,代码行数:11,代码来源:AdminStaticBlocks.php

示例7: processUpdate

 public function processUpdate()
 {
     $this->redirect_shop_url = false;
     $current_url = parse_url($_SERVER['REQUEST_URI']);
     if (trim(dirname(dirname($current_url['path'])), '/') == trim($this->object->getBaseURI(), '/')) {
         $this->redirect_shop_url = true;
     }
     /** @var ShopUrl $object */
     $object = $this->loadObject(true);
     if ($object->main && !Tools::getValue('main')) {
         $this->errors[] = $this->trans('You cannot change a main URL to a non-main URL. You have to set another URL as your Main URL for the selected shop.', array(), 'Admin.Notifications.Error');
     }
     if (($object->main || Tools::getValue('main')) && !Tools::getValue('active')) {
         $this->errors[] = $this->trans('You cannot disable the Main URL.', array(), 'Admin.Notifications.Error');
     }
     return parent::processUpdate();
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:17,代码来源:AdminShopUrlController.php

示例8: processUpdate

 /**
  * Override processUpdate to change SaveAndStay button action
  * @see classes/AdminControllerCore::processUpdate()
  */
 public function processUpdate()
 {
     $object = parent::processUpdate();
     if (Tools::isSubmit('submitAdd' . $this->table . 'AndStay') && !count($this->errors)) {
         $this->redirect_after = self::$currentIndex . '&' . $this->identifier . '=&conf=3&update' . $this->table . '&token=' . $this->token;
     }
     return $object;
 }
开发者ID:retallicka,项目名称:PrestaShop,代码行数:12,代码来源:AdminFeaturesController.php

示例9: processUpdate

 /**
  * @see AdminController::processUpdate();
  */
 public function processUpdate()
 {
     // loads object
     if (!($obj = $this->loadObject(true))) {
         return;
     }
     $this->updateAddress();
     // handles carriers associations
     $obj->setCarriers(Tools::getValue('ids_carriers'), array());
     return parent::processUpdate();
 }
开发者ID:dev-lav,项目名称:htdocs,代码行数:14,代码来源:AdminWarehousesController.php

示例10: processUpdate

 public function processUpdate()
 {
     $this->redirect_shop_url = false;
     $current_url = parse_url($_SERVER['REQUEST_URI']);
     if (trim(dirname(dirname($current_url['path'])), '/') == trim($this->object->getBaseURI(), '/')) {
         $this->redirect_shop_url = true;
     }
     return parent::processUpdate();
 }
开发者ID:toufikadfab,项目名称:PrestaShop-1.5,代码行数:9,代码来源:AdminShopUrlController.php

示例11: processUpdate

    public function processUpdate()
    {
        if (Validate::isLoadedObject($this->object)) {
            return parent::processUpdate();
        } else {
            $this->errors[] = Tools::displayError('An error occurred while loading the object.') . '
				<b>' . $this->table . '</b> ' . Tools::displayError('(cannot load object)');
        }
    }
开发者ID:ekachandrasetiawan,项目名称:SupraShop,代码行数:9,代码来源:AdminConfirmPaymentController.php

示例12: processUpdate

    public function processUpdate()
    {
        $country = $this->loadObject();
        if (Validate::isLoadedObject($country) && Tools::getValue('id_zone')) {
            $old_id_zone = $country->id_zone;
            //we change zone for states attached to this country, only if they have the same id zone before change
            if (parent::processUpdate()) {
                $results = Db::getInstance()->executeS('SELECT `id_state` FROM `' . _DB_PREFIX_ . 'state` WHERE `id_country` = ' . (int) $country->id . ' AND `id_zone` = ' . (int) $old_id_zone);
                $ids = array();
                foreach ($results as $res) {
                    $ids[] = (int) $res['id_state'];
                }
                Db::getInstance()->execute('UPDATE `' . _DB_PREFIX_ . 'state` 
					SET `id_zone` = ' . (int) Tools::getValue('id_zone') . ' 
					WHERE `id_state` IN (' . implode(',', $ids) . ')');
            }
        } else {
            parent::processUpdate();
        }
    }
开发者ID:dev-lav,项目名称:htdocs,代码行数:20,代码来源:AdminCountriesController.php


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