2323class Admin implements IDelegatedSettings {
2424
2525 public function __construct (
26- private string $ appName ,
2726 private IConfig $ config ,
2827 private IL10N $ l ,
2928 private ThemingDefaults $ themingDefaults ,
@@ -38,11 +37,11 @@ public function __construct(
3837 * @return TemplateResponse
3938 */
4039 public function getForm (): TemplateResponse {
41- $ themable = true ;
40+ $ themeable = true ;
4241 $ errorMessage = '' ;
4342 $ theme = $ this ->config ->getSystemValue ('theme ' , '' );
4443 if ($ theme !== '' ) {
45- $ themable = false ;
44+ $ themeable = false ;
4645 $ errorMessage = $ this ->l ->t ('You are already using a custom theme. Theming app settings might be overwritten by that. ' );
4746 }
4847
@@ -51,9 +50,17 @@ public function getForm(): TemplateResponse {
5150 return $ carry ;
5251 }, []);
5352
53+ $ this ->initialState ->provideInitialState ('adminThemingInfo ' , [
54+ 'isThemeable ' => $ themeable ,
55+ 'notThemeableErrorMessage ' => $ errorMessage ,
56+ 'defaultBackgroundURL ' => $ this ->urlGenerator ->linkTo (Application::APP_ID , 'img/background/ ' . BackgroundService::DEFAULT_BACKGROUND_IMAGE ),
57+ 'defaultBackgroundColor ' => BackgroundService::DEFAULT_BACKGROUND_COLOR ,
58+ 'docUrl ' => $ this ->urlGenerator ->linkToDocs ('admin-theming ' ),
59+ 'docUrlIcons ' => $ this ->urlGenerator ->linkToDocs ('admin-theming-icons ' ),
60+ 'canThemeIcons ' => $ this ->imageManager ->shouldReplaceIcons (),
61+ ]);
62+
5463 $ this ->initialState ->provideInitialState ('adminThemingParameters ' , [
55- 'isThemable ' => $ themable ,
56- 'notThemableErrorMessage ' => $ errorMessage ,
5764 'name ' => $ this ->themingDefaults ->getEntity (),
5865 'url ' => $ this ->themingDefaults ->getBaseUrl (),
5966 'slogan ' => $ this ->themingDefaults ->getSlogan (),
@@ -62,30 +69,25 @@ public function getForm(): TemplateResponse {
6269 'logoMime ' => $ this ->config ->getAppValue (Application::APP_ID , 'logoMime ' , '' ),
6370 'allowedMimeTypes ' => $ allowedMimeTypes ,
6471 'backgroundURL ' => $ this ->imageManager ->getImageUrl ('background ' ),
65- 'defaultBackgroundURL ' => $ this ->urlGenerator ->linkTo (Application::APP_ID , 'img/background/ ' . BackgroundService::DEFAULT_BACKGROUND_IMAGE ),
66- 'defaultBackgroundColor ' => BackgroundService::DEFAULT_BACKGROUND_COLOR ,
6772 'backgroundMime ' => $ this ->config ->getAppValue (Application::APP_ID , 'backgroundMime ' , '' ),
6873 'logoheaderMime ' => $ this ->config ->getAppValue (Application::APP_ID , 'logoheaderMime ' , '' ),
6974 'faviconMime ' => $ this ->config ->getAppValue (Application::APP_ID , 'faviconMime ' , '' ),
7075 'legalNoticeUrl ' => $ this ->themingDefaults ->getImprintUrl (),
7176 'privacyPolicyUrl ' => $ this ->themingDefaults ->getPrivacyUrl (),
72- 'docUrl ' => $ this ->urlGenerator ->linkToDocs ('admin-theming ' ),
73- 'docUrlIcons ' => $ this ->urlGenerator ->linkToDocs ('admin-theming-icons ' ),
74- 'canThemeIcons ' => $ this ->imageManager ->shouldReplaceIcons (),
75- 'userThemingDisabled ' => $ this ->themingDefaults ->isUserThemingDisabled (),
77+ 'disableUserTheming ' => $ this ->themingDefaults ->isUserThemingDisabled (),
7678 'defaultApps ' => $ this ->navigationManager ->getDefaultEntryIds (),
7779 ]);
7880
79- Util::addScript ( $ this -> appName , 'admin-theming ' );
80-
81- return new TemplateResponse ($ this -> appName , 'settings-admin ' );
81+ Util::addStyle (Application:: APP_ID , 'settings-admin ' );
82+ Util:: addScript (Application:: APP_ID , ' settings-admin ' );
83+ return new TemplateResponse (Application:: APP_ID , 'settings-admin ' );
8284 }
8385
8486 /**
8587 * @return string the section ID, e.g. 'sharing'
8688 */
8789 public function getSection (): string {
88- return $ this -> appName ;
90+ return Application:: APP_ID ;
8991 }
9092
9193 /**
@@ -105,7 +107,7 @@ public function getName(): ?string {
105107
106108 public function getAuthorizedAppConfig (): array {
107109 return [
108- $ this -> appName => '/.*/ ' ,
110+ Application:: APP_ID => '/.*/ ' ,
109111 ];
110112 }
111113}
0 commit comments