diff --git a/apps/theming/css/theming.scss b/apps/theming/css/theming.scss
index f65e20fa9b71e..6b0566039d214 100644
--- a/apps/theming/css/theming.scss
+++ b/apps/theming/css/theming.scss
@@ -192,3 +192,9 @@ input.primary,
border: 1px solid #ebebeb;
}
}
+
+@if ($has-legal-links == 'true') {
+ footer {
+ height: 92px;
+ }
+}
diff --git a/apps/theming/js/settings-admin.js b/apps/theming/js/settings-admin.js
index 76d9fb965ca56..afc218b7ffad1 100644
--- a/apps/theming/js/settings-admin.js
+++ b/apps/theming/js/settings-admin.js
@@ -84,7 +84,8 @@ function hideUndoButton(setting, value) {
color: '#0082c9',
logoMime: '',
backgroundMime: '',
- imprintUrl: ''
+ imprintUrl: '',
+ privacyUrl: ''
};
if (value === themingDefaults[setting] || value === '') {
diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php
index dd7bf4bb04de6..a834bb1c5abec 100644
--- a/apps/theming/lib/Controller/ThemingController.php
+++ b/apps/theming/lib/Controller/ThemingController.php
@@ -171,6 +171,16 @@ public function updateStylesheet($setting, $value) {
]);
}
break;
+ case 'privacyUrl':
+ if (strlen($value) > 500) {
+ return new DataResponse([
+ 'data' => [
+ 'message' => $this->l10n->t('The given privacy policy address is too long'),
+ ],
+ 'status' => 'error'
+ ]);
+ }
+ break;
case 'slogan':
if (strlen($value) > 500) {
return new DataResponse([
@@ -419,6 +429,7 @@ public function getJavascript() {
slogan: ' . json_encode($this->themingDefaults->getSlogan()) . ',
color: ' . json_encode($this->themingDefaults->getColorPrimary()) . ',
imprintUrl: ' . json_encode($this->themingDefaults->getImprintUrl()) . ',
+ privacyUrl: ' . json_encode($this->themingDefaults->getPrivacyUrl()) . ',
inverted: ' . json_encode($this->util->invertTextColor($this->themingDefaults->getColorPrimary())) . ',
cacheBuster: ' . json_encode($cacheBusterValue) . '
};
diff --git a/apps/theming/lib/Settings/Admin.php b/apps/theming/lib/Settings/Admin.php
index ef296688ed2ce..6a95dd39d43c6 100644
--- a/apps/theming/lib/Settings/Admin.php
+++ b/apps/theming/lib/Settings/Admin.php
@@ -85,6 +85,7 @@ public function getForm(): TemplateResponse {
'iconDocs' => $this->urlGenerator->linkToDocs('admin-theming-icons'),
'images' => $this->imageManager->getCustomImages(),
'imprintUrl' => $this->themingDefaults->getImprintUrl(),
+ 'privacyUrl' => $this->themingDefaults->getPrivacyUrl(),
];
return new TemplateResponse('theming', 'settings-admin', $parameters, '');
diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php
index d2f5747124235..00c47676bc802 100644
--- a/apps/theming/lib/ThemingDefaults.php
+++ b/apps/theming/lib/ThemingDefaults.php
@@ -142,7 +142,11 @@ public function getSlogan() {
}
public function getImprintUrl() {
- return $this->config->getAppValue('theming', 'imprintUrl', '');
+ return (string)$this->config->getAppValue('theming', 'imprintUrl', '');
+ }
+
+ public function getPrivacyUrl() {
+ return (string)$this->config->getAppValue('theming', 'privacyUrl', '');
}
public function getShortFooter() {
@@ -151,14 +155,31 @@ public function getShortFooter() {
' rel="noreferrer noopener">' .$this->getEntity() . ''.
($slogan !== '' ? ' – ' . $slogan : '');
- $imprintUrl = (string)$this->getImprintUrl();
- if($imprintUrl !== ''
- && filter_var($imprintUrl, FILTER_VALIDATE_URL, [
- 'flags' => FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED
- ])
- ) {
- $footer .= '
' . $this->l->t('Legal notice') . '';
+ $links = [
+ [
+ 'text' => $this->l->t('Legal notice'),
+ 'url' => (string)$this->getImprintUrl()
+ ],
+ [
+ 'text' => $this->l->t('Privacy policy'),
+ 'url' => (string)$this->getPrivacyUrl()
+ ],
+ ];
+
+ $legalLinks = ''; $divider = '';
+ foreach($links as $link) {
+ if($link['url'] !== ''
+ && filter_var($link['url'], FILTER_VALIDATE_URL, [
+ 'flags' => FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED
+ ])
+ ) {
+ $legalLinks .= $divider . '' . $link['text'] . '';
+ $divider = ' · ';
+ }
+ }
+ if($legalLinks !== '' ) {
+ $footer .= '
' . $legalLinks;
}
return $footer;
@@ -266,6 +287,12 @@ public function getScssVariables() {
if ($this->config->getAppValue('theming', 'backgroundMime', null) === 'backgroundColor') {
$variables['image-login-plain'] = 'true';
}
+
+ $variables['has-legal-links'] = 'false';
+ if($this->getImprintUrl() !== '' || $this->getPrivacyUrl() !== '') {
+ $variables['has-legal-links'] = 'true';
+ }
+
$cache->set('getScssVariables', $variables);
return $variables;
}
diff --git a/apps/theming/templates/settings-admin.php b/apps/theming/templates/settings-admin.php
index 26ab78637c911..0cc224abc240d 100644
--- a/apps/theming/templates/settings-admin.php
+++ b/apps/theming/templates/settings-admin.php
@@ -96,9 +96,16 @@