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


PHP AdminController::processBulkDelete方法代码示例

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


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

示例1: processBulkDelete

 protected function processBulkDelete()
 {
     $can_bulk = true;
     if (is_array($this->boxes) && !empty($this->boxes)) {
         foreach ($this->boxes as $id_lang) {
             $object = new Language((int) $id_lang);
             if (!$this->checkDeletion($object)) {
                 return false;
             }
             if (!$this->deleteNoPictureImages((int) $object->id)) {
                 $this->errors[] = Tools::displayError('An error occurred while deleting the object.') . ' <b>' . $this->table . '</b> ';
                 return false;
             }
         }
     }
     return parent::processBulkDelete();
 }
开发者ID:ortegon000,项目名称:tienda,代码行数:17,代码来源:AdminLanguagesController.php

示例2: processBulkDelete

 protected function processBulkDelete()
 {
     if ($this->tabAccess['delete'] === '1') {
         $cats_ids = array();
         foreach (Tools::getValue($this->table . 'Box') as $id_category) {
             $category = new Category((int) $id_category);
             if (!$category->isRootCategoryForAShop()) {
                 $cats_ids[$category->id] = $category->id_parent;
             }
         }
         if (parent::processBulkDelete()) {
             $this->setDeleteMode();
             foreach ($cats_ids as $id => $id_parent) {
                 $this->processFatherlessProducts((int) $id_parent);
             }
             return true;
         } else {
             return false;
         }
     } else {
         $this->errors[] = Tools::displayError('You do not have permission to delete here.');
     }
 }
开发者ID:jicheng17,项目名称:pengwine,代码行数:23,代码来源:AdminCategoriesController.php

示例3: processBulkDelete

 /**
  * Delete multiple items
  *
  * @return boolean true if succcess
  */
 protected function processBulkDelete()
 {
     if (is_array($this->boxes) && !empty($this->boxes)) {
         $deleted = false;
         foreach ($this->boxes as $id) {
             $to_delete = new Address((int) $id);
             if ($to_delete->isUsed()) {
                 $deleted = true;
                 break;
             }
         }
         $this->deleted = $deleted;
     }
     return parent::processBulkDelete();
 }
开发者ID:dev-lav,项目名称:htdocs,代码行数:20,代码来源:AdminAddressesController.php

示例4: processBulkDelete

 protected function processBulkDelete()
 {
     if (is_array($this->boxes) && !empty($this->boxes)) {
         foreach ($this->boxes as $id_employee) {
             if ((int) $this->context->employee->id == (int) $id_employee) {
                 $this->restrict_edition = true;
                 return $this->canModifyEmployee();
             }
         }
     }
     return parent::processBulkDelete();
 }
开发者ID:ortegon000,项目名称:tienda,代码行数:12,代码来源:AdminEmployeesController.php

示例5: processBulkDelete

 /**
  * Overrides parent to delete items from sublist
  *
  * @return mixed
  */
 public function processBulkDelete()
 {
     // If we are deleting attributes instead of attribute_groups
     if (Tools::getIsset('attributeBox')) {
         $this->className = 'Attribute';
         $this->table = 'attribute';
         $this->boxes = Tools::getValue($this->table . 'Box');
     }
     $result = parent::processBulkDelete();
     // Restore vars
     $this->className = 'AttributeGroup';
     $this->table = 'attribute_group';
     return $result;
 }
开发者ID:rongandat,项目名称:vatfairfoot,代码行数:19,代码来源:AdminAttributesGroupsController.php

示例6: processBulkDelete

 protected function processBulkDelete()
 {
     $this->_setDeletedMode();
     parent::processBulkDelete();
 }
开发者ID:nmardones,项目名称:PrestaShop,代码行数:5,代码来源:AdminCustomersController.php

示例7: processBulkDelete

 protected function processBulkDelete()
 {
     if (is_array($this->boxes) && !empty($this->boxes)) {
         foreach ($this->boxes as $id_currency) {
             $object = new Currency((int) $id_currency);
             if (!$this->checkDeletion($object)) {
                 return false;
             }
         }
     }
     return parent::processBulkDelete();
 }
开发者ID:jpodracky,项目名称:dogs,代码行数:12,代码来源:AdminCurrenciesController.php

示例8: postProcess

 public function postProcess()
 {
     if (Tools::isSubmit($this->table . 'Orderby') || Tools::isSubmit($this->table . 'Orderway')) {
         $this->filter = true;
     }
     if (Tools::isSubmit('submitAddorder_return_state') || Tools::isSubmit('submitAddorder_return_state')) {
         $id_order_return_state = Tools::getValue('id_order_return_state');
         // Create Object OrderReturnState
         $order_return_state = new OrderReturnState((int) $id_order_return_state);
         $order_return_state->color = Tools::getValue('color');
         $order_return_state->name = array();
         $languages = Language::getLanguages(false);
         foreach ($languages as $language) {
             $order_return_state->name[$language['id_lang']] = Tools::getValue('name_' . $language['id_lang']);
         }
         // Update object
         if (!$order_return_state->save()) {
             $this->errors[] = Tools::displayError('An error has occurred: Can\'t save the current order\'s return state.');
         } else {
             Tools::redirectAdmin(self::$currentIndex . '&conf=4&token=' . $this->token);
         }
     }
     if (Tools::isSubmit('submitBulkdeleteorder_return_state')) {
         $this->className = 'OrderReturnState';
         $this->table = 'order_return_state';
         $this->boxes = Tools::getValue('order_return_stateBox');
         parent::processBulkDelete();
     }
     if (Tools::isSubmit('deleteorder_return_state')) {
         $id_order_return_state = Tools::getValue('id_order_return_state');
         // Create Object OrderReturnState
         $order_return_state = new OrderReturnState((int) $id_order_return_state);
         if (!$order_return_state->delete()) {
             $this->errors[] = Tools::displayError('An error has occurred: Can\'t delete the current order\'s return state.');
         } else {
             Tools::redirectAdmin(self::$currentIndex . '&conf=1&token=' . $this->token);
         }
     }
     if (Tools::isSubmit('submitAdd' . $this->table)) {
         $this->deleted = false;
         // Disabling saving historisation
         $_POST['invoice'] = (int) Tools::getValue('invoice_on');
         $_POST['logable'] = (int) Tools::getValue('logable_on');
         $_POST['send_email'] = (int) Tools::getValue('send_email_on');
         $_POST['hidden'] = (int) Tools::getValue('hidden_on');
         $_POST['shipped'] = (int) Tools::getValue('shipped_on');
         $_POST['paid'] = (int) Tools::getValue('paid_on');
         $_POST['delivery'] = (int) Tools::getValue('delivery_on');
         if (!$_POST['send_email']) {
             $languages = Language::getLanguages(false);
             foreach ($languages as $language) {
                 $_POST['template_' . $language['id_lang']] = '';
             }
         }
         return parent::postProcess();
     } else {
         if (Tools::isSubmit('delete' . $this->table)) {
             $order_state = new OrderState(Tools::getValue('id_order_state'), $this->context->language->id);
             if (!$order_state->isRemovable()) {
                 $this->errors[] = $this->l('For security reasons, you cannot delete default order statuses.');
             } else {
                 return parent::postProcess();
             }
         } else {
             if (Tools::isSubmit('submitBulkdelete' . $this->table)) {
                 foreach (Tools::getValue($this->table . 'Box') as $selection) {
                     $order_state = new OrderState((int) $selection, $this->context->language->id);
                     if (!$order_state->isRemovable()) {
                         $this->errors[] = $this->l('For security reasons, you cannot delete default order statuses.');
                         break;
                     }
                 }
                 if (!count($this->errors)) {
                     return parent::postProcess();
                 }
             } else {
                 return parent::postProcess();
             }
         }
     }
 }
开发者ID:dev-lav,项目名称:htdocs,代码行数:81,代码来源:AdminStatusesController.php

示例9: processBulkDelete

 protected function processBulkDelete()
 {
     if ($this->access('delete')) {
         $cats_ids = array();
         foreach (Tools::getValue($this->table . 'Box') as $id_category) {
             $category = new Category((int) $id_category);
             if (!$category->isRootCategoryForAShop()) {
                 $cats_ids[$category->id] = $category->id_parent;
             }
         }
         if (parent::processBulkDelete()) {
             $this->setDeleteMode();
             foreach ($cats_ids as $id => $id_parent) {
                 $this->processFatherlessProducts((int) $id_parent);
             }
             return true;
         } else {
             return false;
         }
     } else {
         $this->errors[] = $this->trans('You do not have permission to delete this.', array(), 'Admin.Notifications.Error');
     }
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:23,代码来源:AdminCategoriesController.php

示例10: processBulkDelete

 protected function processBulkDelete()
 {
     $cats_ids = array();
     foreach (Tools::getValue($this->table . 'Box') as $id_category) {
         $category = new Category((int) $id_category);
         if (!$category->isRootCategoryForAShop()) {
             $cats_ids[$category->id] = $category->id_parent;
         }
     }
     if (parent::processBulkDelete()) {
         $this->setDeleteMode();
         foreach ($cats_ids as $id => $id_parent) {
             $this->processFatherlessProducts((int) $id_parent);
         }
         return true;
     } else {
         return false;
     }
 }
开发者ID:jicheng17,项目名称:vipinsg,代码行数:19,代码来源:AdminCategoriesController.php


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