Callback for "page-delete" command
162919
public function cmdDeletePage()
    {
        $id = $this->getParam(0);
        $all = $this->getParam('all');
        $blog = $this->getParam('blog');

        if (empty($id) && empty($all) && empty($blog)) {
            $this->errorAndExit($this->text('Invalid command'));
        }

        if (isset($id) && (empty($id) || !is_numeric($id))) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        $options = null;

        if (isset($id)) {

            if ($this->getParam('store')) {
                $options = array('store_id' => $id);
            } else if ($this->getParam('category')) {
                $options = array('category_id' => $id);
            } else if ($this->getParam('user')) {
                $options = array('user_id' => $id);
            }

        } else if ($blog) {
            $options = array('blog_post' => true);
        } else if ($all) {
            $options = array();
        }

        if (isset($options)) {

            $deleted = $count = 0;
            foreach ($this->page->getList($options) as $item) {
                $count++;
                $deleted += (int) $this->page->delete($item['page_id']);
            }

            $result = $count && $count == $deleted;

        } else {
            $result = $this->page->delete($id);
        }

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        $this->output();
    }
321680
def do_index_command(self, index, **options):
        """"""
        if options["interactive"]:
            logger.warning("This will permanently delete the index '%s'.", index)
            if not self._confirm_action():
                logger.warning(
                    "Aborting deletion of index '%s' at user's request.", index
                )
                return
        return delete_index(index)
821539
protected function deleteImagesPage()
    {
        $this->controlAccess('page_edit');

        $file_ids = $this->getPosted('delete_images', array(), true, 'array');
        return $this->image->delete($file_ids);
    }
199571
public static void actionDelete(PageContext pc, Resource dir, boolean forceDelete, String serverPassword) throws PageException {
	SecurityManager securityManager = pc.getConfig().getSecurityManager();
	securityManager.checkFileLocation(pc.getConfig(), dir, serverPassword);

	// directory doesn't exist
	if (!dir.exists()) {
	    if (dir.isDirectory()) throw new ApplicationException("directory [" + dir.toString() + "] doesn't exist");
	    else if (dir.isFile()) throw new ApplicationException("file [" + dir.toString() + "] doesn't exist and isn't a directory");
	}

	// check if file
	if (dir.isFile()) throw new ApplicationException("can't delete [" + dir.toString() + "], it isn't a directory it is a file");

	// delete directory
	try {
	    dir.remove(forceDelete);
	}
	catch (IOException e) {
	    throw Caster.toPageException(e);
	}
    }
1297945
private void doRemoveDatasource() throws PageException {
	admin.removeDataSource(getString("admin", action, "name"));
	store();
	adminSync.broadcast(attributes, config);
    }
42811
public function deletePage(Page $page)
    {
        $findPage = $this->findPage($page);
        if ($findPage === false) {
            return false;
        }

        $deleteStm = $this->connection->prepare("DELETE FROM Page WHERE page_id=?");
        $deleteStm->execute([$page->getID()]);
        if (!$deleteStm->rowCount() > 0) {
            return false;
        }
        if ($findPage == 'active') {
            unset($this->activePages[$page->getID()]);
        } else {
            unset($this->inactivePages[$page->getID()]);
        }

        return true;
    }
346211
function cmd_DELE($fd, $cmd)
    {
        $user = $this->getUser($fd);
        $file = $this->fillDirName($user, $cmd[1]);
        $this->debug("DEL: $file");
        if (!file_exists($file))
        {
            $this->send($fd, "550 Could not delete " . $cmd[1] . ": No such file or directory");
        }
        elseif (unlink($file))
        {
            $this->send($fd, "250 Deleted " . $cmd[1]);
        }
        else
        {
            $this->send($fd, "550 Could not delete " . $cmd[1] . ": Permission denied");
        }
    }
320248
@Override
  public void deletePage(int pageID) {
    try {
      // / put id to empty pages list
      super.deletePage(pageID);

      // delete from file
      countWrite();
      byte[] array = pageToByteArray(null);
      long offset = ((long) (header.getReservedPages() + pageID)) * (long) pageSize;
      file.seek(offset);
      file.write(array);
    }
    catch(IOException e) {
      throw new RuntimeException(e);
    }
  }
782144
function del(id, callback) {

    callback = callback || emptyFn

    if (typeof callback !== 'function') {
      throw new TypeError('callback must be a function or empty')
    }

    if (!idIndexData[id]) {
      return callback(new Error('No object found with \'' + options.idProperty +
          '\' = \'' + id + '\''))
    }

    self.emit('delete', id)

    delete idIndexData[id]

    // Work around for dynamic property
    var find = {}
    find[options.idProperty] = id

    data.splice(_.findIndex(data, find), 1)

    saveFile('afterDelete', id, callback)
  }
1314167
private function page_delete( $table_name, $row_id ){
		$page_delete = new endpoint_form_delete($this->exdb, $this, $table_name, $row_id);
		return $page_delete->execute();
	}
400469
def close_page(self):
        """"""
        if self.suffix is not None:
            self._current_page.append(self.suffix)
        self._pages.append('\n'.join(self._current_page))

        if self.prefix is not None:
            self._current_page = [self.prefix]
            self._count = len(self.prefix) + 1 # prefix + newline
        else:
            self._current_page = []
            self._count = 0
818944
public function deletePage(Page $page)
    {
        if ($page->hasMainSection()) {
            $this->getEntityManager()
                    ->getRepository('BackBee\NestedNode\Section')
                    ->deleteSection($page->getSection());
        }

        if (null !== $page->getContentSet()) {
            $this->getEntityManager()
                    ->createQueryBuilder()
                    ->update('BackBee\NestedNode\\Page', 'p')
                    ->set('p._contentset', ':null')
                    ->where('p._contentset = :uid')
                    ->setParameter('uid', $page->getContentSet()->getUid())
                    ->setParameter('null', null)
                    ->getQuery()
                    ->execute();

            $this->getEntityManager()
                    ->getRepository('BackBee\ClassContent\AbstractClassContent')
                    ->deleteContent($page->getContentSet());
        }

        $this->getEntityManager()
                ->createQueryBuilder()
                ->update('BackBee\ClassContent\AbstractClassContent', 'c')
                ->set('c._mainnode', ':null')
                ->where('c._mainnode = :uid')
                ->setParameter('uid', $page->getUid())
                ->setParameter('null', null)
                ->getQuery()
                ->execute();

        $this->getEntityManager()->remove($page);
    }
1295646
public function cmdDeleteCountry()
    {
        $code = $this->getParam(0);
        $all = $this->getParam('all');

        if (empty($code) && empty($all)) {
            $this->errorAndExit($this->text('Invalid command'));
        }

        $result = null;

        if (!empty($code)) {
            $result = $this->country->delete($code);
        } else if (!empty($all)) {

            $deleted = $count = 0;
            foreach ($this->country->getList() as $item) {
                $count++;
                $deleted += (int) $this->country->delete($item['code']);
            }

            $result = $count && $count == $deleted;
        }

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        $this->output();
    }
465168
public function beforeDelete()
    {
        if (($url = UrlRule::findOne(['route' => '/system/page/view', 'params' => 'id=' . $this->id])) != null) {
            $url->delete();
        }
        parent::beforeDelete();
    }
346070
public function deletePage($page_id)
    {
        $url = "https://api.weixin.qq.com/shakearound/page/delete?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['page_id' => $page_id]);
    }
1196074
public void handleDelete(
        final String clientId,
        final String deleteOption,
        final I_CmsSimpleCallback<Void> callback) {

        CmsRpcAction<Void> action = new CmsRpcAction<Void>() {

            @Override
            public void execute() {

                getContainerpageService().handleDelete(
                    clientId,
                    deleteOption,
                    getData().getRpcContext().getPageStructureId(),
                    getData().getRequestParams(),
                    this);
            }

            @Override
            protected void onResponse(Void result) {

                if (callback != null) {
                    callback.execute(result);
                }
            }
        };
        action.execute();
    }
419866
public function moveToTrash()
    {

        // run any internal event we have for page trashing
        $pe = new Event($this);
        Events::dispatch('on_page_move_to_trash', $pe);

        $trash = self::getByPath(Config::get('concrete.paths.trash'));
        $app = Facade::getFacadeApplication();
        $logger = $app->make('log/factory')->createLogger(Channels::CHANNEL_SITE_ORGANIZATION);
        $logger->notice(t('Page "%s" at path "%s" Moved to trash',
            $this->getCollectionName(),
            $this->getCollectionPath()
        ));

        $this->move($trash);
        $this->deactivate();

        // if this page has a custom canonical path we need to clear it
        $path = $this->getCollectionPathObject();
        if (!$path->isPagePathAutoGenerated()) {
            $path = $this->getAutoGeneratedPagePathObject();
            $this->setCanonicalPagePath($path->getPagePath(), true);
            $this->rescanCollectionPath();
        }
        $cID = ($this->getCollectionPointerOriginalID() > 0) ? $this->getCollectionPointerOriginalID() : $this->cID;
        $pages = [];
        $pages = $this->populateRecursivePages($pages, ['cID' => $cID], $this->getCollectionParentID(), 0, false);
        $db = Database::connection();
        foreach ($pages as $page) {
            $db->executeQuery('update Pages set cIsActive = 0 where cID = ?', [$page['cID']]);
        }
    }