diff --git a/.gitignore b/.gitignore index e84236e0..6acb932d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ .DS_Store bl-content/* -bl-plugins/timemachine \ No newline at end of file +bl-plugins/timemachine diff --git a/bl-kernel/admin/controllers/new-category.php b/bl-kernel/admin/controllers/new-category.php index 072cc697..f26a1d61 100644 --- a/bl-kernel/admin/controllers/new-category.php +++ b/bl-kernel/admin/controllers/new-category.php @@ -17,6 +17,7 @@ function add($category) { global $dbCategories; global $Language; + global $Syslog; if( Text::isEmpty($category) ) { Alert::set($Language->g('Category name is empty'), ALERT_STATUS_FAIL); @@ -24,8 +25,17 @@ function add($category) } if( $dbCategories->add($category) ) { + // Add to syslog + $Syslog->add(array( + 'dictionaryKey'=>'new-category-created', + 'notes'=>$category + )); + + // Create an alert Alert::set($Language->g('Category added'), ALERT_STATUS_OK); - return true; + + // Redirect + Redirect::page('categories'); } else { Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to create the category.'); @@ -43,9 +53,7 @@ function add($category) if( $_SERVER['REQUEST_METHOD'] == 'POST' ) { - if( add($_POST['category']) ) { - Redirect::page('categories'); - } + add($_POST['category']); } // ============================================================================ diff --git a/bl-kernel/dbsyslog.class.php b/bl-kernel/dbsyslog.class.php index d671dfa2..1520d2dc 100644 --- a/bl-kernel/dbsyslog.class.php +++ b/bl-kernel/dbsyslog.class.php @@ -16,6 +16,27 @@ class dbSyslog extends dbJSON parent::__construct(DB_SYSLOG); } + // Returns TRUE if the ID of execution exists, FALSE otherwise + public function exists($idExecution) + { + foreach($this->db as $field) { + if( $field['idExecution']==$idExecution ) { + return true; + } + } + return false; + } + + public function get($idExecution) + { + foreach($this->db as $field) { + if( $field['idExecution']==$idExecution ) { + return $field; + } + } + return false; + } + public function add($args) { global $Language; diff --git a/bl-themes/editorial/assets/css/bludit.css b/bl-themes/editorial/assets/css/bludit.css index b4486f8f..889c616e 100644 --- a/bl-themes/editorial/assets/css/bludit.css +++ b/bl-themes/editorial/assets/css/bludit.css @@ -1,3 +1,8 @@ +/* Hacks +------------------------------------------------------------------------------ */ +img { + width: 100%; +} /* Plugins ------------------------------------------------------------------------------ */