本文整理汇总了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();
}
示例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();
}
示例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)');
}
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}
示例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)');
}
}
示例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();
}
}