- Dodano PSR-4 autoloader do wszystkich 6 punktów wejścia - Shared\: CacheHandler, Helpers, Html, ImageManipulator, Tpl - Domain\: LanguagesRepository, SettingsRepository, UserRepository - Stare class.*.php → cienkie wrappery (kompatybilność wsteczna) - Dodano dokumentację: docs/PROJECT_STRUCTURE.md + pozostałe docs/ - Dodano CLAUDE.md z workflow Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
74 lines
2.8 KiB
PHP
74 lines
2.8 KiB
PHP
<?php
|
|
namespace admin\factory;
|
|
|
|
/**
|
|
* @deprecated Wrapper — używaj \Domain\Settings\SettingsRepository przez DI.
|
|
*/
|
|
class Settings
|
|
{
|
|
private static function repo(): \Domain\Settings\SettingsRepository
|
|
{
|
|
global $mdb;
|
|
return new \Domain\Settings\SettingsRepository( $mdb );
|
|
}
|
|
|
|
public static function settings_details(): array
|
|
{
|
|
return self::repo()->allSettings();
|
|
}
|
|
|
|
public static function settings_update( $param, $value )
|
|
{
|
|
return self::repo()->update( (string)$param, $value );
|
|
}
|
|
|
|
public static function settings_save(
|
|
$firm_name, $firm_adress, $additional_info, $contact_form, $contact_email,
|
|
$email_host, $email_port, $email_login, $email_password, $google_maps,
|
|
$facebook_link, $statistic_code, $htaccess, $robots,
|
|
$newsletter_header, $newsletter_footer_1, $newsletter_footer_2,
|
|
$google_map_key, $google_search_console, $update, $devel,
|
|
$news_limit, $visit_counter, $calendar, $tags, $ssl, $mysql_debug,
|
|
$htaccess_cache, $visits, $links_structure, $link_version,
|
|
$widget_phone, $update_key
|
|
): bool {
|
|
$data = [
|
|
'firm_name' => $firm_name,
|
|
'firm_adress' => $firm_adress,
|
|
'additional_info' => $additional_info,
|
|
'contact_form' => $contact_form,
|
|
'contact_email' => $contact_email,
|
|
'email_host' => $email_host,
|
|
'email_port' => $email_port,
|
|
'email_login' => $email_login,
|
|
'email_password' => $email_password,
|
|
'google_maps' => $google_maps == 'on' ? 1 : 0,
|
|
'facebook_link' => $facebook_link,
|
|
'statistic_code' => $statistic_code,
|
|
'htaccess' => $htaccess,
|
|
'robots' => $robots,
|
|
'newsletter_header' => $newsletter_header,
|
|
'newsletter_footer_1' => $newsletter_footer_1,
|
|
'newsletter_footer_2' => $newsletter_footer_2,
|
|
'google_map_key' => $google_map_key,
|
|
'google_search_console'=> $google_search_console,
|
|
'update' => $update == 'on' ? 1 : 0,
|
|
'devel' => $devel == 'on' ? 1 : 0,
|
|
'news_limit' => $news_limit,
|
|
'visit_counter' => $visit_counter == 'on' ? 1 : 0,
|
|
'calendar' => $calendar == 'on' ? 1 : 0,
|
|
'tags' => $tags == 'on' ? 1 : 0,
|
|
'ssl' => $ssl == 'on' ? 1 : 0,
|
|
'mysql_debug' => $mysql_debug == 'on' ? 1 : 0,
|
|
'htaccess_cache' => $htaccess_cache == 'on' ? 1 : 0,
|
|
'visits' => $visits,
|
|
'links_structure' => $links_structure,
|
|
'link_version' => $link_version,
|
|
'widget_phone' => $widget_phone == 'on' ? 1 : 0,
|
|
'update_key' => $update_key,
|
|
];
|
|
|
|
return self::repo()->save( $data );
|
|
}
|
|
}
|