1919
2020class config_settings extends base
2121{
22+ /** @var \phpbb\config\db_text */
23+ protected $ config_text ;
24+
2225 /** @var \phpbb\group\helper $group_helper */
2326 protected $ group_helper ;
2427
@@ -28,26 +31,28 @@ class config_settings extends base
2831 /**
2932 * Constructor
3033 *
31- * @param \phpbb\auth\auth $auth
32- * @param \phpbb\config\config $config
34+ * @param \phpbb\auth\auth $auth
35+ * @param \phpbb\config\config $config
36+ * @param \phpbb\config\db_text $config_text
3337 * @param \phpbb\db\driver\driver_interface $db
34- * @param \phpbb\template\template $template
35- * @param \phpbb\user $user
36- * @param \phpbb\titania\cache\service $cache
37- * @param \phpbb\titania\controller\helper $helper
38- * @param type_collection $types
39- * @param \phpbb\request\request $request
40- * @param \phpbb\titania\config\config $ext_config
41- * @param \phpbb\titania\display $display
42- * @param \phpbb\titania\message\message $message
43- * @param \phpbb\group\helper $group_helper
38+ * @param \phpbb\template\template $template
39+ * @param \phpbb\user $user
40+ * @param \phpbb\titania\cache\service $cache
41+ * @param \phpbb\titania\controller\helper $helper
42+ * @param type_collection $types
43+ * @param \phpbb\request\request $request
44+ * @param \phpbb\titania\config\config $ext_config
45+ * @param \phpbb\titania\display $display
46+ * @param \phpbb\titania\message\message $message
47+ * @param \phpbb\group\helper $group_helper
4448 */
45- public function __construct (\phpbb \auth \auth $ auth , \phpbb \config \config $ config , \phpbb \db \driver \driver_interface $ db , \phpbb \template \template $ template , \phpbb \user $ user , \phpbb \titania \cache \service $ cache , \phpbb \titania \controller \helper $ helper , type_collection $ types , \phpbb \request \request $ request , \phpbb \titania \config \config $ ext_config , \phpbb \titania \display $ display , \phpbb \titania \message \message $ message , \phpbb \group \helper $ group_helper )
49+ public function __construct (\phpbb \auth \auth $ auth , \phpbb \config \config $ config , \phpbb \config \ db_text $ config_text , \ phpbb \ db \driver \driver_interface $ db , \phpbb \template \template $ template , \phpbb \user $ user , \phpbb \titania \cache \service $ cache , \phpbb \titania \controller \helper $ helper , type_collection $ types , \phpbb \request \request $ request , \phpbb \titania \config \config $ ext_config , \phpbb \titania \display $ display , \phpbb \titania \message \message $ message , \phpbb \group \helper $ group_helper )
4650 {
4751 parent ::__construct ($ auth , $ config , $ db , $ template , $ user , $ cache , $ helper , $ types , $ request , $ ext_config , $ display );
4852
4953 $ this ->message = $ message ;
5054 $ this ->group_helper = $ group_helper ;
55+ $ this ->config_text = $ config_text ;
5156 }
5257
5358 /**
@@ -116,13 +121,15 @@ public function save()
116121 {
117122 $ value [$ key ] = $ this ->request ->variable ($ config . '_ ' . $ key , $ this ->get_default ($ type [1 ]));
118123 }
124+ $ this ->config_text ->set (ext::TITANIA_CONFIG_PREFIX . $ config , json_encode ($ value ));
125+ $ this ->config ->delete (ext::TITANIA_CONFIG_PREFIX . $ config ); // delete it from config if its still there for any reason
119126 }
120127 else
121128 {
122129 $ value = $ this ->request ->variable ($ config , $ this ->get_default ($ type ));
130+ $ this ->config ->set (ext::TITANIA_CONFIG_PREFIX . $ config , json_encode ($ value ));
123131 }
124132
125- $ this ->config ->set (ext::TITANIA_CONFIG_PREFIX . $ config , json_encode ($ value ));
126133 $ this ->ext_config ->__set ($ config , $ value );
127134 }
128135 }
0 commit comments