3434use OCP \AppFramework \Http \Attribute \OpenAPI ;
3535use OCP \AppFramework \Http \ContentSecurityPolicy ;
3636use OCP \AppFramework \Http \TemplateResponse ;
37+ use OCP \IAppConfig ;
3738use OCP \IConfig ;
3839use OCP \IGroupManager ;
3940use OCP \IL10N ;
@@ -59,6 +60,9 @@ class HelpController extends Controller {
5960 /** @var IConfig */
6061 private $ config ;
6162
63+ /** @var IAppConfig */
64+ private $ appConfig ;
65+
6266 public function __construct (
6367 string $ appName ,
6468 IRequest $ request ,
@@ -68,6 +72,7 @@ public function __construct(
6872 IGroupManager $ groupManager ,
6973 IL10N $ l10n ,
7074 IConfig $ config ,
75+ IAppConfig $ appConfig ,
7176 ) {
7277 parent ::__construct ($ appName , $ request );
7378 $ this ->navigationManager = $ navigationManager ;
@@ -76,6 +81,7 @@ public function __construct(
7681 $ this ->groupManager = $ groupManager ;
7782 $ this ->l10n = $ l10n ;
7883 $ this ->config = $ config ;
84+ $ this ->appConfig = $ appConfig ;
7985 }
8086
8187 /**
@@ -107,6 +113,9 @@ public function help(string $mode = 'user'): TemplateResponse {
107113 $ urlAdminDocs = $ this ->urlGenerator ->linkToDocs ('admin ' );
108114 }
109115
116+ $ legalNoticeUrl = $ this ->appConfig ->getValueString ('theming ' , 'imprintUrl ' );
117+ $ privacyUrl = $ this ->appConfig ->getValueString ('theming ' , 'privacyUrl ' );
118+
110119 $ response = new TemplateResponse ('settings ' , 'help ' , [
111120 'admin ' => $ this ->groupManager ->isAdmin ($ this ->userId ),
112121 'url ' => $ documentationUrl ,
@@ -115,6 +124,8 @@ public function help(string $mode = 'user'): TemplateResponse {
115124 'mode ' => $ mode ,
116125 'pageTitle ' => $ pageTitle ,
117126 'knowledgebaseEmbedded ' => $ knowledgebaseEmbedded ,
127+ 'legalNoticeUrl ' => $ legalNoticeUrl ,
128+ 'privacyUrl ' => $ privacyUrl ,
118129 ]);
119130 $ policy = new ContentSecurityPolicy ();
120131 $ policy ->addAllowedFrameDomain ('\'self \'' );
0 commit comments