diff --git a/admin/ajax.php b/admin/ajax.php index ba49ca1..61fff4e 100644 --- a/admin/ajax.php +++ b/admin/ajax.php @@ -1,5 +1,5 @@
- authors ) ): foreach ( $this -> authors as $author ): $authors[ $author['id'] ] = $author['author']; endforeach; endif;?> + authors ) ): + foreach ( $this -> authors as $author ): + $authors[ $author['id'] ] = $author['author']; + endforeach; + endif; + ?> 'Autor', 'name' => "id_author", 'id' => 'id_author', - 'values' => array_merge( [ '0' => '--- wybierz autora ---' ], $authors ), + 'values' => $authors, 'value' => $this -> article['id_author'] ] );?> $this -> article['show_title'] == 1 ? true : false ) );?> + 'Pokaż spis treści', + 'name' => 'show_table_of_contents', + 'checked' => $this -> article['show_table_of_contents'] == 1 ? true : false + ] );?> 'Pokaż datę dodania', @@ -169,6 +181,15 @@ ob_start(); 'checked' => $this -> article['show_date_modify'] == 1 ? true : false ) );?> + 'Data modyfikacji', + 'class' => 'date-time', + 'name' => 'date_modify', + 'id' => 'date_modify', + 'value' => $this -> article['date_modify'] ? $this -> article['date_modify'] : date( 'Y-m-d H:i:s' ) + ) + );?> 'Powtórz wprowadzenie', diff --git a/autoload/admin/controls/class.Articles.php b/autoload/admin/controls/class.Articles.php index 96c2581..b6f9e7d 100644 --- a/autoload/admin/controls/class.Articles.php +++ b/autoload/admin/controls/class.Articles.php @@ -99,7 +99,7 @@ class Articles if ( $id = \admin\factory\Articles::article_save( $values['id'], $values['title'], $values['main_image'], $values['entry'], $values['text'], $values['table_of_contents'], $values['status'], $values['show_title'], $values['show_table_of_contents'], $values['show_date_add'], $values['date_add'], - $values['show_date_modify'], $values['seo_link'], $values['meta_title'], $values['meta_description'], $values['meta_keywords'], $values['layout_id'], + $values['show_date_modify'], $values['date_modify'], $values['seo_link'], $values['meta_title'], $values['meta_description'], $values['meta_keywords'], $values['layout_id'], $values['pages'], $values['noindex'], $values['repeat_entry'], $values['copy_from'], $values['social_icons'], $values['event_date'], $values['hidden-tags'], $values['block_direct_access'], $values['priority'], $values['password'], $values['pixieset'], $values['id_author'], $params ) ) diff --git a/autoload/admin/factory/class.Articles.php b/autoload/admin/factory/class.Articles.php index a10b710..9a5a585 100644 --- a/autoload/admin/factory/class.Articles.php +++ b/autoload/admin/factory/class.Articles.php @@ -238,7 +238,7 @@ class Articles } public static function article_save( - $article_id, $title, $main_image, $entry, $text, $table_of_contents, $status, $show_title, $show_table_of_contents, $show_date_add, $date_add, $show_date_modify, $seo_link, $meta_title, $meta_description, + $article_id, $title, $main_image, $entry, $text, $table_of_contents, $status, $show_title, $show_table_of_contents, $show_date_add, $date_add, $show_date_modify, $date_modify, $seo_link, $meta_title, $meta_description, $meta_keywords, $layout_id, $pages, $noindex, $repeat_entry, $copy_from, $social_icons, $event_date, $tags, $block_direct_access, $priority, $password, $pixieset, $id_author, $params ) { @@ -254,8 +254,8 @@ class Articles 'show_table_of_contents' => $show_table_of_contents == 'on' ? 1 : 0, 'show_date_add' => $show_date_add == 'on' ? 1 : 0, 'show_date_modify' => $show_date_modify == 'on' ? 1 : 0, - 'date_add' => $date_add ? $date_add : date( 'Y-m-d H:i:s' ), - 'date_modify' => $date_add ? $date_add : date( 'Y-m-d H:i:s' ), + 'date_add' => date( 'Y-m-d H:i:s' ), + 'date_modify' => date( 'Y-m-d H:i:s' ), 'modify_by' => $user['id'], 'layout_id' => $layout_id ? (int)$layout_id : null, 'status' => $status == 'on' ? 1 : 0, @@ -438,8 +438,9 @@ class Articles 'show_title' => $show_title == 'on' ? 1 : 0, 'show_table_of_contents' => $show_table_of_contents == 'on' ? 1 : 0, 'show_date_add' => $show_date_add == 'on' ? 1 : 0, + 'date_add' => $date_add, 'show_date_modify' => $show_date_modify == 'on' ? 1 : 0, - 'date_modify' => date( 'Y-m-d H:i:s' ), + 'date_modify' => $date_modify ? $date_modify : date( 'Y-m-d H:i:s' ), 'modify_by' => $user['id'], 'layout_id' => $layout_id ? (int)$layout_id : null, 'status' => $status == 'on' ? 1 : 0,