88namespace OCA \Recognize \Settings ;
99
1010use OCA \Recognize \Service \SettingsService ;
11+ use OCP \App \IAppManager ;
1112use OCP \AppFramework \Http \TemplateResponse ;
1213use OCP \AppFramework \Services \IInitialState ;
1314use OCP \Settings \ISettings ;
1415
1516final class AdminSettings implements ISettings {
16- private IInitialState $ initialState ;
17- private SettingsService $ settingsService ;
18-
19- public function __construct (IInitialState $ initialState , SettingsService $ settingsService ) {
20- $ this ->initialState = $ initialState ;
21- $ this ->settingsService = $ settingsService ;
17+ public function __construct (
18+ private IInitialState $ initialState ,
19+ private SettingsService $ settingsService ,
20+ private IAppManager $ appManager ,
21+ ) {
2222 }
2323
2424 /**
@@ -32,6 +32,9 @@ public function getForm(): TemplateResponse {
3232 $ modelsDownloaded = file_exists ($ modelsPath );
3333 $ this ->initialState ->provideInitialState ('modelsDownloaded ' , $ modelsDownloaded );
3434
35+ $ tagsEnabled = $ this ->appManager ->isEnabledForAnyone ('systemtags ' );
36+ $ this ->initialState ->provideInitialState ('tagsEnabled ' , $ tagsEnabled );
37+
3538 return new TemplateResponse ('recognize ' , 'admin ' );
3639 }
3740
0 commit comments