88
99use OCA \Theming \AppInfo \Application ;
1010use OCA \Theming \Service \BackgroundService ;
11+ use OCA \Theming \Service \ThemesService ;
1112use OCP \Capabilities \IPublicCapability ;
1213use OCP \IConfig ;
1314use OCP \IURLGenerator ;
2122 */
2223class Capabilities implements IPublicCapability {
2324
24- /**
25- * @param ThemingDefaults $theming
26- * @param Util $util
27- * @param IURLGenerator $url
28- * @param IConfig $config
29- */
3025 public function __construct (
3126 protected ThemingDefaults $ theming ,
3227 protected Util $ util ,
3328 protected IURLGenerator $ url ,
3429 protected IConfig $ config ,
3530 protected IUserSession $ userSession ,
31+ protected ThemesService $ themesService ,
3632 ) {
3733 }
3834
@@ -44,6 +40,8 @@ public function __construct(
4440 * name: string,
4541 * productName: string,
4642 * url: string,
43+ * imprintUrl: string,
44+ * privacyUrl: string,
4745 * slogan: string,
4846 * color: string,
4947 * color-text: string,
@@ -57,6 +55,13 @@ public function __construct(
5755 * background-default: bool,
5856 * logoheader: string,
5957 * favicon: string,
58+ * primaryColor: string,
59+ * backgroundColor: string,
60+ * defaultPrimaryColor: string,
61+ * defaultBackgroundColor: string,
62+ * inverted: bool,
63+ * cacheBuster: string,
64+ * enabledThemes: list<string>,
6065 * },
6166 * }
6267 */
@@ -98,6 +103,8 @@ public function getCapabilities() {
98103 'name ' => $ this ->theming ->getName (),
99104 'productName ' => $ this ->theming ->getProductName (),
100105 'url ' => $ this ->theming ->getBaseUrl (),
106+ 'imprintUrl ' => $ this ->theming ->getImprintUrl (),
107+ 'privacyUrl ' => $ this ->theming ->getPrivacyUrl (),
101108 'slogan ' => $ this ->theming ->getSlogan (),
102109 'color ' => $ color ,
103110 'color-text ' => $ colorText ,
@@ -111,6 +118,13 @@ public function getCapabilities() {
111118 'background-default ' => !$ this ->util ->isBackgroundThemed (),
112119 'logoheader ' => $ this ->url ->getAbsoluteURL ($ this ->theming ->getLogo ()),
113120 'favicon ' => $ this ->url ->getAbsoluteURL ($ this ->theming ->getLogo ()),
121+ 'primaryColor ' => $ color ,
122+ 'backgroundColor ' => $ backgroundColor ,
123+ 'defaultPrimaryColor ' => $ this ->theming ->getDefaultColorPrimary (),
124+ 'defaultBackgroundColor ' => $ this ->theming ->getDefaultColorBackground (),
125+ 'inverted ' => $ this ->util ->invertTextColor ($ color ),
126+ 'cacheBuster ' => $ this ->util ->getCacheBuster (),
127+ 'enabledThemes ' => $ this ->themesService ->getEnabledThemes (),
114128 ],
115129 ];
116130 }
0 commit comments