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

@@ -15,7 +15,17 @@ class Banners
public static function banner_save()
{
$response = [ 'status' => 'error', 'msg' => 'Podczas zapisywania baneru 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 ( $banner_id = \admin\factory\Banners::banner_save( $values['id'], $values['name'], $values['status'], $values['date_start'], $values['date_end'],
$values['home_page'], $values['src'], $values['url'], $values['html'], $values['text'] ) )