File tree Expand file tree Collapse file tree 2 files changed +34
-34
lines changed
Expand file tree Collapse file tree 2 files changed +34
-34
lines changed Original file line number Diff line number Diff line change 11<?php
2+
3+ declare (strict_types=1 );
24/**
35 * Privacy App
46 *
2325
2426use OCP \AppFramework \Http \TemplateResponse ;
2527use OCP \Settings \ISettings ;
28+ use OCP \Support \Subscription \IRegistry ;
2629
27- /**
28- * Class MissionSettings
29- *
30- * @package OCA\Privacy\Settings
31- */
3230class MissionSettings implements ISettings {
3331
34- /**
35- * @return TemplateResponse
36- */
37- public function getForm ():TemplateResponse {
32+ /** @var IRegistry */
33+ protected $ subscription ;
34+
35+ public function __construct (IRegistry $ subscription ) {
36+ $ this ->subscription = $ subscription ;
37+ }
38+
39+ public function getForm (): TemplateResponse {
3840 return new TemplateResponse ('privacy ' , 'mission ' );
3941 }
4042
41- /**
42- * @return string
43- */
44- public function getSection ():string {
43+ public function getSection (): ?string {
44+ if ($ this ->subscription ->delegateHasValidSubscription ()) {
45+ return null ;
46+ }
47+
4548 return 'privacy ' ;
4649 }
4750
48- /**
49- * @return int
50- */
51- public function getPriority ():int {
51+ public function getPriority (): int {
5252 return 0 ;
5353 }
5454}
Original file line number Diff line number Diff line change 11<?php
2+
3+ declare (strict_types=1 );
24/**
35 * Privacy App
46 *
2325
2426use OCP \AppFramework \Http \TemplateResponse ;
2527use OCP \Settings \ISettings ;
28+ use OCP \Support \Subscription \IRegistry ;
2629
27- /**
28- * Class UserDataManifestoSettings
29- *
30- * @package OCA\Privacy\Settings
31- */
3230class UserDataManifestoSettings implements ISettings {
3331
34- /**
35- * @return TemplateResponse
36- */
37- public function getForm ():TemplateResponse {
32+ /** @var IRegistry */
33+ protected $ subscription ;
34+
35+ public function __construct (IRegistry $ subscription ) {
36+ $ this ->subscription = $ subscription ;
37+ }
38+
39+ public function getForm (): TemplateResponse {
3840 return new TemplateResponse ('privacy ' , 'user-data-manifesto ' );
3941 }
4042
41- /**
42- * @return string
43- */
44- public function getSection ():string {
43+ public function getSection (): ?string {
44+ if ($ this ->subscription ->delegateHasValidSubscription ()) {
45+ return null ;
46+ }
47+
4548 return 'privacy ' ;
4649 }
4750
48- /**
49- * @return int
50- */
51- public function getPriority ():int {
51+ public function getPriority (): int {
5252 return 5 ;
5353 }
5454}
You can’t perform that action at this time.
0 commit comments