Refactor value handling in multiple classes for improved data processing

This commit is contained in:
2024-10-30 09:38:37 +01:00
parent 9e05750801
commit ee240f7dbd
25 changed files with 364 additions and 25 deletions

View File

@@ -27,7 +27,17 @@ class Articles
public static function article_save()
{
$response = [ 'status' => 'error', 'msg' => 'Podczas zapisywania artykułu wystąpił błąd. Proszę spróbować ponownie.' ];
$values = json_decode( \S::get( 'values' ), true );
$values_tmp = json_decode( \S::get( 'values' ), true );
$values = [];
foreach ( $values_tmp as $item )
{
$name = $item['name'];
$value = $item['value'];
$keys = \S::parse_name( $name );
\S::set_array_value( $values, $keys, $value );
}
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['date_modify'], $values['seo_link'], $values['meta_title'],