From 91081c41a0e30fc8270192a4e1cc41608d6769ae Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 21 Mar 2019 09:44:17 +0100 Subject: Add a privacy policy link if it's set Signed-off-by: Christoph Wurst --- lib/Settings/WhoHasAccessSettings.php | 13 ++++++++++++- templates/who-has-access.php | 7 +++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/Settings/WhoHasAccessSettings.php b/lib/Settings/WhoHasAccessSettings.php index 69422c6..cd39a4e 100644 --- a/lib/Settings/WhoHasAccessSettings.php +++ b/lib/Settings/WhoHasAccessSettings.php @@ -21,6 +21,8 @@ */ namespace OCA\Privacy\Settings; +use OC; +use OCA\Theming\ThemingDefaults; use OCP\AppFramework\Http\TemplateResponse; use OCP\Settings\ISettings; @@ -35,7 +37,16 @@ class WhoHasAccessSettings implements ISettings { * @return TemplateResponse */ public function getForm():TemplateResponse { - return new TemplateResponse('privacy', 'who-has-access'); + $themingDefaults = OC::$server->getThemingDefaults(); + if ($themingDefaults instanceof ThemingDefaults) { + $privacyPolicyUrl = $themingDefaults->getPrivacyUrl(); + } else { + $privacyPolicyUrl = null; + } + + return new TemplateResponse('privacy', 'who-has-access', [ + 'privacyPolicyUrl' => $privacyPolicyUrl, + ]); } /** diff --git a/templates/who-has-access.php b/templates/who-has-access.php index 194e548..3a97c39 100644 --- a/templates/who-has-access.php +++ b/templates/who-has-access.php @@ -5,4 +5,11 @@

t('People you shared with')) ?>

+ + +

t('Privacy policy')) ?>

+

+ t('Read the privacy policy.')) ?> +

+ \ No newline at end of file -- cgit v1.2.3