diff --git a/ground/controllers/ArticlesController.php b/ground/controllers/ArticlesController.php index 1b83f32..2e148cc 100644 --- a/ground/controllers/ArticlesController.php +++ b/ground/controllers/ArticlesController.php @@ -98,6 +98,8 @@ class ArticlesController extends Controller $article->title = $title; $article->text = $text; $article->html = $html; + $article->status = (isset($_POST['save']) && $_POST['save'] == 'published') ? 'published' : 'draft'; + $article->pubDate = time(); $article->photoId = Helper::getFirstImg($text); $article->allowComments = $allowComments; $article->save(); diff --git a/ground/views/articles/edit.php b/ground/views/articles/edit.php index e323049..e99854f 100644 --- a/ground/views/articles/edit.php +++ b/ground/views/articles/edit.php @@ -22,7 +22,8 @@ не сохранять
- + +