1818use OCP \AppFramework \Http \DataResponse ;
1919use OCP \AppFramework \OCSController ;
2020use OCP \AppFramework \Services \IAppConfig ;
21+ use OCP \Config \IUserConfig ;
2122use OCP \Dashboard \IAPIWidget ;
2223use OCP \Dashboard \IAPIWidgetV2 ;
2324use OCP \Dashboard \IButtonWidget ;
3031use OCP \Dashboard \Model \WidgetItem ;
3132
3233use OCP \Dashboard \Model \WidgetOptions ;
33- use OCP \IConfig ;
3434use OCP \IRequest ;
3535
3636/**
@@ -45,7 +45,7 @@ public function __construct(
4545 IRequest $ request ,
4646 private IManager $ dashboardManager ,
4747 private IAppConfig $ appConfig ,
48- private IConfig $ config ,
48+ private IUserConfig $ userConfig ,
4949 private ?string $ userId ,
5050 private DashboardService $ service ,
5151 ) {
@@ -59,7 +59,7 @@ public function __construct(
5959 private function getShownWidgets (array $ widgetIds ): array {
6060 if (empty ($ widgetIds )) {
6161 $ systemDefault = $ this ->appConfig ->getAppValueString ('layout ' , 'recommendations,spreed,mail,calendar ' );
62- $ widgetIds = explode (', ' , $ this ->config -> getUserValue ($ this ->userId , 'dashboard ' , 'layout ' , $ systemDefault ));
62+ $ widgetIds = explode (', ' , $ this ->userConfig -> getValueString ($ this ->userId , 'dashboard ' , 'layout ' , $ systemDefault ));
6363 }
6464
6565 return array_filter (
@@ -202,7 +202,7 @@ public function getLayout(): DataResponse {
202202 #[NoAdminRequired]
203203 #[ApiRoute(verb: 'POST ' , url: '/api/v3/layout ' )]
204204 public function updateLayout (array $ layout ): DataResponse {
205- $ this ->config -> setUserValue ($ this ->userId , 'dashboard ' , 'layout ' , implode (', ' , $ layout ));
205+ $ this ->userConfig -> setValueString ($ this ->userId , 'dashboard ' , 'layout ' , implode (', ' , $ layout ));
206206 return new DataResponse (['layout ' => $ layout ]);
207207 }
208208
@@ -230,7 +230,7 @@ public function getStatuses(): DataResponse {
230230 #[NoAdminRequired]
231231 #[ApiRoute(verb: 'POST ' , url: '/api/v3/statuses ' )]
232232 public function updateStatuses (array $ statuses ): DataResponse {
233- $ this ->config -> setUserValue ($ this ->userId , 'dashboard ' , 'statuses ' , implode (', ' , $ statuses ));
233+ $ this ->userConfig -> setValueString ($ this ->userId , 'dashboard ' , 'statuses ' , implode (', ' , $ statuses ));
234234 return new DataResponse (['statuses ' => $ statuses ]);
235235 }
236236}
0 commit comments