diff --git a/admin/controllers/dashboard.php b/admin/controllers/dashboard.php index 63322461..602e33e0 100644 --- a/admin/controllers/dashboard.php +++ b/admin/controllers/dashboard.php @@ -33,4 +33,4 @@ foreach($pages as $Page) if(!$Page->published()) { array_push($_draftPages, $Page); } -} \ No newline at end of file +} diff --git a/admin/controllers/edit-page.php b/admin/controllers/edit-page.php index 29fa99ec..e591d578 100644 --- a/admin/controllers/edit-page.php +++ b/admin/controllers/edit-page.php @@ -26,6 +26,8 @@ function editPage($args) { $dbPages->regenerate(); + //$dbTags->reindexPages( $dbPages->db ); + Alert::set($Language->g('The changes have been saved')); Redirect::page('admin', 'edit-page/'.$args['key']); } diff --git a/admin/controllers/edit-post.php b/admin/controllers/edit-post.php index 659b6485..a52ee912 100644 --- a/admin/controllers/edit-post.php +++ b/admin/controllers/edit-post.php @@ -7,6 +7,7 @@ function editPost($args) { global $dbPosts; + global $dbTags; global $Language; // Post status, published or draft. @@ -20,6 +21,9 @@ function editPost($args) // Edit the post. if( $dbPosts->edit($args) ) { + // Regenerate the database tags + $dbTags->reindexPosts( $dbPosts->db ); + Alert::set($Language->g('The changes have been saved')); Redirect::page('admin', 'edit-post/'.$args['key']); } @@ -32,10 +36,14 @@ function editPost($args) function deletePost($key) { global $dbPosts; + global $dbTags; global $Language; if( $dbPosts->delete($key) ) { + // Regenerate the database tags + $dbTags->reindexPosts( $dbPosts->db ); + Alert::set($Language->g('The post has been deleted successfully')); Redirect::page('admin', 'manage-posts'); } diff --git a/admin/controllers/new-page.php b/admin/controllers/new-page.php index 0dd12df7..0b54d994 100644 --- a/admin/controllers/new-page.php +++ b/admin/controllers/new-page.php @@ -24,6 +24,8 @@ function addPage($args) // Add the page. if( $dbPages->add($args) ) { + //$dbTags->reindexPages( $dbPages->db ); + Alert::set($Language->g('Page added successfully')); Redirect::page('admin', 'manage-pages'); } diff --git a/admin/controllers/new-post.php b/admin/controllers/new-post.php index f13cba22..92131b52 100644 --- a/admin/controllers/new-post.php +++ b/admin/controllers/new-post.php @@ -11,6 +11,7 @@ function addPost($args) { global $dbPosts; + global $dbTags; global $Language; // Page status, published or draft. @@ -24,6 +25,9 @@ function addPost($args) // Add the page. if( $dbPosts->add($args) ) { + // Regenerate the database tags + $dbTags->reindexPosts( $dbPosts->db ); + Alert::set($Language->g('Post added successfully')); Redirect::page('admin', 'manage-posts'); } diff --git a/admin/views/edit-page.php b/admin/views/edit-page.php index 7dccff93..3f733924 100644 --- a/admin/views/edit-page.php +++ b/admin/views/edit-page.php @@ -6,10 +6,10 @@ -