Make isOnlyofficeEnabled an attribute

Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
Pablo Zmdl 2026-01-19 12:02:41 +01:00
parent 1013cb02fd
commit 2c7f32c4d4
5 changed files with 10 additions and 24 deletions

View file

@ -73,6 +73,11 @@ class ConfigurationManager
set { $this->set('isClamavEnabled', $value); }
}
public bool $isOnlyofficeEnabled {
get => $this->get('isOnlyofficeEnabled', false);
set { $this->set('isOnlyofficeEnabled', $value); }
}
public function GetConfig() : array
{
if ($this->config === [] && file_exists(DataConst::GetConfigFile()))
@ -243,21 +248,6 @@ class ConfigurationManager
$this->WriteConfig($config);
}
public function isOnlyofficeEnabled() : bool {
$config = $this->GetConfig();
if (isset($config['isOnlyofficeEnabled']) && $config['isOnlyofficeEnabled'] === 1) {
return true;
} else {
return false;
}
}
public function SetOnlyofficeEnabledState(int $value) : void {
$config = $this->GetConfig();
$config['isOnlyofficeEnabled'] = $value;
$this->WriteConfig($config);
}
public function isCollaboraEnabled() : bool {
$config = $this->GetConfig();
if (isset($config['isCollaboraEnabled']) && $config['isCollaboraEnabled'] === 0) {