本文整理汇总了PHP中AdminController::processDelete方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminController::processDelete方法的具体用法?PHP AdminController::processDelete怎么用?PHP AdminController::processDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminController
的用法示例。
在下文中一共展示了AdminController::processDelete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processDelete
/**
* @see AdminController::processDelete()
*/
public function processDelete()
{
$object = $this->loadObject();
if (!$this->checkDeletion($object)) {
return false;
}
return parent::processDelete();
}
示例2: processDelete
public function processDelete()
{
$object = $this->loadObject();
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 parent::processDelete();
}
示例3: processDelete
public function processDelete()
{
if (!Validate::isLoadedObject($object = $this->loadObject())) {
$this->errors[] = Tools::displayError('Unable to load this shop.');
} else {
if (!Shop::hasDependency($object->id)) {
$result = Category::deleteCategoriesFromShop($object->id) && parent::processDelete();
Tools::generateHtaccess();
return $result;
} else {
$this->errors[] = Tools::displayError('You can\'t delete this shop (customer and/or order dependency).');
}
}
return false;
}
示例4: processDelete
/**
* @see AdminController::processDelete();
*/
public function processDelete()
{
if (Tools::isSubmit('delete' . $this->table)) {
/** @var Warehouse $obj */
// check if the warehouse exists and can be deleted
if (!($obj = $this->loadObject(true))) {
return;
} elseif ($obj->getQuantitiesOfProducts() > 0) {
// not possible : products
$this->errors[] = $this->l('It is not possible to delete a warehouse when there are products in it.');
} elseif (SupplyOrder::warehouseHasPendingOrders($obj->id)) {
// not possible : supply orders
$this->errors[] = $this->l('It is not possible to delete a Warehouse if it has pending supply orders.');
} else {
// else, it can be deleted
// sets the address of the warehouse as deleted
$address = new Address($obj->id_address);
$address->deleted = 1;
$address->save();
// removes associations with carriers/shops/products location
$obj->setCarriers(array());
$obj->resetProductsLocations();
return parent::processDelete();
}
}
}
示例5: processDelete
public function processDelete()
{
$res = parent::processDelete();
if (Tools::isSubmit('delete' . $this->table)) {
$back = urldecode(Tools::getValue('back', ''));
if (!empty($back)) {
$this->redirect_after = $back;
}
}
return $res;
}
示例6: processDelete
public function processDelete()
{
if (!$this->canModifyEmployee()) {
return false;
}
return parent::processDelete();
}
示例7: processDelete
public function processDelete()
{
$id_parent = BlogCategory::getRootCategory();
$id_parent = $id_parent['id_smart_blog_category'];
if ((int) Tools::getValue('id_smart_blog_category') == (int) $id_parent) {
$this->errors[] = $this->l('You cannot delete this category because it is the root category');
} else {
parent::processDelete();
}
}
示例8: processDelete
public function processDelete()
{
$category = $this->loadObject();
if ($this->tabAccess['delete'] === '1') {
if ($category->isRootCategoryForAShop()) {
$this->errors[] = Tools::displayError('You cannot remove this category because a shop uses this category as a root category.');
} else {
if (parent::processDelete()) {
$this->setDeleteMode();
$this->processFatherlessProducts((int) $category->id_parent);
return true;
} else {
return false;
}
}
} else {
$this->errors[] = Tools::displayError('You do not have permission to delete here.');
}
}
示例9: processDelete
public function processDelete()
{
$obj = $this->loadObject();
if ($obj && $obj->isUsed()) {
$this->errors[] = $this->l('This theme is already used by at least one shop. Please choose another theme first.');
return false;
}
return parent::processDelete();
}
示例10: processDelete
public function processDelete()
{
$obj = $this->loadObject();
if ($obj) {
if ($obj->isUsed()) {
$this->errors[] = $this->l('The theme is being used by at least one shop. Please choose another theme before continuing.');
return false;
}
$themes = array();
foreach (Theme::getThemes() as $theme) {
if ($theme->id != $obj->id) {
$themes[] = $theme->directory;
}
}
if (is_dir(_PS_ALL_THEMES_DIR_ . $obj->directory) && !in_array($obj->directory, $themes)) {
Tools::deleteDirectory(_PS_ALL_THEMES_DIR_ . $obj->directory . '/');
}
$ids_themes = Tools::unSerialize(Configuration::get('PS_ADDONS_THEMES_IDS'));
if (array_key_exists($obj->directory, $ids_themes)) {
unset($ids_themes[$obj->directory]);
}
$obj->removeMetas();
} elseif ($obj === false && ($theme_dir = Tools::getValue('theme_dir'))) {
$theme_dir = basename($theme_dir);
if (Tools::deleteDirectory(_PS_ALL_THEMES_DIR_ . $theme_dir . '/')) {
Tools::redirectAdmin(Context::getContext()->link->getAdminLink('AdminThemes') . '&conf=2');
} else {
$this->errors[] = Tools::displayError('The folder cannot be deleted');
}
}
return parent::processDelete();
}
示例11: processDelete
/**
* Object Delete
*/
public function processDelete()
{
if (Validate::isLoadedObject($object = $this->loadObject())) {
/** @var Address $object */
if (!$object->isUsed()) {
$this->deleted = false;
}
}
$res = parent::processDelete();
if ($back = Tools::getValue('back')) {
$this->redirect_after = urldecode($back) . '&conf=1';
}
return $res;
}
示例12: processDelete
public function processDelete()
{
if ($this->access('delete')) {
/** @var Category $category */
$category = $this->loadObject();
if ($category->isRootCategoryForAShop()) {
$this->errors[] = $this->trans('You cannot remove this category because one of your shops uses it as a root category.', array(), 'Admin.Catalog.Notification');
} elseif (parent::processDelete()) {
$this->setDeleteMode();
$this->processFatherlessProducts((int) $category->id_parent);
return true;
}
} else {
$this->errors[] = $this->trans('You do not have permission to delete this.', array(), 'Admin.Notifications.Error');
}
return false;
}
示例13: processDelete
public function processDelete()
{
$object = $this->loadObject();
if (!$this->checkDeletion($object)) {
return false;
}
if (!$this->deleteNoPictureImages((int) $object->id)) {
$this->errors[] = $this->trans('An error occurred while deleting the object.', array(), 'Admin.Notifications.Error') . ' <b>' . $this->table . '</b> ';
}
return parent::processDelete();
}
示例14: processDelete
public function processDelete()
{
$obj = $this->loadObject();
if ($obj && is_dir(_PS_ALL_THEMES_DIR_ . $obj->directory)) {
Tools::deleteDirectory(_PS_ALL_THEMES_DIR_ . $obj->directory . '/');
}
if ($obj && $obj->isUsed()) {
$this->errors[] = $this->l('This theme is already used by at least one shop. Please choose another theme first.');
return false;
}
return parent::processDelete();
}
示例15: processDelete
public function processDelete()
{
parent::processDelete();
return $this->getQuickAccessesList();
}