1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-07-31 18:30:20 +02:00

Pages Plugin: Update Delete Action.

This commit is contained in:
Awilum
2012-09-30 11:10:03 +03:00
parent 86578abf8e
commit 337d90237c

View File

@@ -419,9 +419,10 @@
// Error 404 page can not be removed
if (Request::get('name') !== 'error404') {
// Get page title, delete page and update <parent> fields
// Get page
$page = $pages->select('[slug="'.Request::get('name').'"]', null);
// Delete page and update <parent> fields
if ($pages->deleteWhere('[slug="'.Request::get('name').'" ]')) {
$pages->updateWhere('[parent="'.Request::get('name').'"]', array('parent' => ''));
File::delete(STORAGE . DS . 'pages' . DS . $page['id'] . '.page.txt');