1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-01 10:50:37 +02:00

Pages Plugin: Fix delete() action

This commit is contained in:
Awilum
2012-11-09 21:14:28 +02:00
parent 0f1547c26f
commit c5c5500cdb

View File

@@ -505,10 +505,13 @@
// Delete page and update <parent> fields
if ($pages->deleteWhere('[slug="'.$page['slug'].'" ]')) {
$_pages = $pages->select('[parent="'.$page['slug'].'"]', 'all');
$_pages = $pages->select('[parent="'.$page['slug'].'"]');
if(!empty($_pages)) {
foreach($_pages as $_page) {
$pages->updateWhere('[slug="'.$_page['slug'].'"]', array('parent' => ''));
}
}
File::delete(STORAGE . DS . 'pages' . DS . $page['id'] . '.page.txt');
Notification::set('success', __('Page <i>:page</i> deleted', 'pages', array(':page' => Html::toText($page['title']))));