1 | <?php |
||
24 | class settings |
||
25 | { |
||
26 | const NO_THEME = 'no'; |
||
27 | const DEFAULT_THEME = 'light'; |
||
28 | |||
29 | /** @var cache_driver */ |
||
30 | protected $cache; |
||
31 | |||
32 | /** @var config */ |
||
33 | protected $config; |
||
34 | |||
35 | /** @var db_driver */ |
||
36 | protected $db; |
||
37 | |||
38 | /** @var manager */ |
||
39 | protected $ext_manager; |
||
40 | |||
41 | /** @var request */ |
||
42 | protected $request; |
||
43 | |||
44 | /** @var string */ |
||
45 | protected $phpbb_root_path; |
||
46 | |||
47 | /** @var string */ |
||
48 | protected $u_action; |
||
49 | |||
50 | /** |
||
51 | * Constructor |
||
52 | * |
||
53 | * @param cache_driver $cache |
||
54 | * @param config $config |
||
55 | * @param db_driver $db |
||
56 | * @param manager $phpbb_ext_manager |
||
57 | * @param request $request |
||
58 | * @param $phpbb_root_path |
||
59 | */ |
||
60 | 3 | public function __construct(cache_driver $cache, config $config, db_driver $db, manager $phpbb_ext_manager, request $request, $phpbb_root_path) |
|
61 | { |
||
62 | 3 | $this->cache = $cache; |
|
63 | 3 | $this->config = $config; |
|
64 | 3 | $this->db = $db; |
|
65 | 3 | $this->ext_manager = $phpbb_ext_manager; |
|
66 | 3 | $this->request = $request; |
|
67 | 3 | $this->phpbb_root_path = $phpbb_root_path; |
|
68 | 3 | } |
|
69 | |||
70 | /** |
||
71 | * Display the settings with the current config values |
||
72 | * |
||
73 | * @param string $u_action |
||
74 | * @return array |
||
75 | */ |
||
76 | 1 | public function display_settings($u_action) |
|
93 | |||
94 | /** |
||
95 | * Set the settings data from the form to the database |
||
96 | */ |
||
97 | 1 | public function set_settings() |
|
113 | |||
114 | /** |
||
115 | * Update topic_preview_theme setting in the styles table |
||
116 | * |
||
117 | * @param int $style_id Identifier of the board style |
||
118 | * @param string $theme Name of the selected theme |
||
119 | */ |
||
120 | 1 | protected function set_style_theme($style_id, $theme) |
|
130 | |||
131 | /** |
||
132 | * Get style data from the styles table |
||
133 | * |
||
134 | * @return array Style data |
||
135 | */ |
||
136 | 2 | protected function get_styles() |
|
148 | |||
149 | /** |
||
150 | * Get file names from Topic Preview's CSS files |
||
151 | * |
||
152 | * @return array File name data |
||
153 | */ |
||
154 | 1 | protected function get_themes() |
|
174 | } |
||
175 |