diff --git a/bl-kernel/admin/controllers/edit-page.php b/bl-kernel/admin/controllers/edit-page.php index 23e53c51..856d9275 100644 --- a/bl-kernel/admin/controllers/edit-page.php +++ b/bl-kernel/admin/controllers/edit-page.php @@ -8,83 +8,6 @@ // Functions // ============================================================================ -function editPage($args) -{ - global $dbPages; - global $Language; - global $Syslog; - - if(!isset($args['parent'])) { - $args['parent'] = NO_PARENT_CHAR; - } - - // Edit the page - $key = $dbPages->edit($args); - - if($key) { - // Re-index categories - reindexCategories(); - - // Re-index tags - reindextags(); - - // Call the plugins after page modified - Theme::plugins('afterPageModify'); - - // Add to syslog - $Syslog->add(array( - 'dictionaryKey'=>'page-edited', - 'notes'=>$args['title'] - )); - - // Create an alert - Alert::set( $Language->g('The changes have been saved') ); - - // Redirect - Redirect::page('edit-page/'.$key); - } - else { - Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to edit the page.'); - } - - return false; -} - -function deletePage($key) -{ - global $dbPages; - global $Language; - global $Syslog; - - if( $dbPages->delete($key) ) { - // Re-index categories - reindexCategories(); - - // Re-index tags - reindextags(); - - // Call the plugins after page deleted - Theme::plugins('afterPageDelete'); - - // Add to syslog - $Syslog->add(array( - 'dictionaryKey'=>'page-deleted', - 'notes'=>$key - )); - - // Create an alert - Alert::set( $Language->g('The changes have been saved') ); - - // Redirect - Redirect::page('pages'); - } - else { - Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to delete the page.'); - } - - return false; -} - // ============================================================================ // Main before POST // ============================================================================ @@ -96,11 +19,20 @@ function deletePage($key) if( $_SERVER['REQUEST_METHOD'] == 'POST' ) { if( isset($_POST['delete-page']) ) { - deletePage($_POST['key']); + if( deletePage($_POST['key']) ) { + Alert::set( $Language->g('The changes have been saved') ); + Redirect::page('pages'); + } } else { - editPage($_POST); + $key = editPage($_POST); + if( $key!==false ) { + Alert::set( $Language->g('The changes have been saved') ); + Redirect::page('edit-page/'.$key); + } } + + Redirect::page('pages'); } // ============================================================================ diff --git a/bl-kernel/admin/themes/default/css/default.css b/bl-kernel/admin/themes/default/css/default.css index 3369e64c..ce418b10 100644 --- a/bl-kernel/admin/themes/default/css/default.css +++ b/bl-kernel/admin/themes/default/css/default.css @@ -13,6 +13,7 @@ .label-draft, .label-fixed, .label-sticky, +.label-scheduled, .label-empty-title, .label-time { background: #A979D1 none repeat scroll 0 0; @@ -30,6 +31,10 @@ background: #7BD179; } +.label-scheduled { + background: #7BD179; +} + .label-empty-title { background: #53D192; } diff --git a/bl-kernel/admin/views/edit-page.php b/bl-kernel/admin/views/edit-page.php index 80583795..8e62cf26 100644 --- a/bl-kernel/admin/views/edit-page.php +++ b/bl-kernel/admin/views/edit-page.php @@ -135,7 +135,7 @@ echo '