Make the where is your data section optional
Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
This commit is contained in:
parent
b8d25a1247
commit
6c52821389
|
@ -116,9 +116,6 @@ class PersonalInfo implements ISettings {
|
|||
$localeParameters = $this->getLocales($user);
|
||||
$messageParameters = $this->getMessageParameters($userData);
|
||||
|
||||
$adminContactConfigId = $this->config->getSystemValue(ServerInfo::SETTING_PROVIDER_ADMIN_CONTACT);
|
||||
$adminContact = $this->userManager->get($adminContactConfigId);
|
||||
|
||||
$parameters = [
|
||||
'total_space' => $totalSpace,
|
||||
'usage' => \OC_Helper::humanFileSize($storageInfo['used']),
|
||||
|
@ -144,16 +141,38 @@ class PersonalInfo implements ISettings {
|
|||
'twitterScope' => $userData[AccountManager::PROPERTY_TWITTER]['scope'],
|
||||
'twitterVerification' => $userData[AccountManager::PROPERTY_TWITTER]['verified'],
|
||||
'groups' => $this->getGroups($user),
|
||||
] + $this->getWhereIsYourDataParams() + $messageParameters + $languageParameters + $localeParameters;
|
||||
|
||||
return new TemplateResponse('settings', 'settings/personal/personal.info', $parameters, '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the "where is your data" template params.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function getWhereIsYourDataParams() {
|
||||
|
||||
$adminContactConfigId = $this->config->getSystemValue(ServerInfo::SETTING_PROVIDER_ADMIN_CONTACT);
|
||||
$adminContact = $this->userManager->get($adminContactConfigId);
|
||||
|
||||
$params = [
|
||||
'dataLocation' => $this->config->getSystemValue(ServerInfo::SETTING_LOCATION),
|
||||
'provider' => $this->config->getSystemValue(ServerInfo::SETTING_PROVIDER),
|
||||
'providerLink' => $this->config->getSystemValue(ServerInfo::SETTING_PROVIDER_WEBSITE),
|
||||
'providerPrivacyLink' => $this->config->getSystemValue(ServerInfo::SETTING_PROVIDER_PRIVACY_LINK),
|
||||
'encryptionEnabled' => $this->encryptionManager->isEnabled(),
|
||||
'adminName' => $adminContact !== null ? $adminContact->getDisplayName() : '',
|
||||
'adminMail' => $adminContact !== null ? $adminContact->getEMailAddress() : '',
|
||||
] + $messageParameters + $languageParameters + $localeParameters;
|
||||
'adminMail' => $adminContact !== null ? $adminContact->getEMailAddress() : ''
|
||||
];
|
||||
|
||||
$params['show_where_is_your_data_section'] = empty($params['dataLocation']) === false
|
||||
|| empty($params['provider']) === false
|
||||
|| $params['encryptionEnabled'] === true
|
||||
|| empty($params['adminName']) === false;
|
||||
|
||||
return $params;
|
||||
|
||||
return new TemplateResponse('settings', 'settings/personal/personal.info', $parameters, '');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -95,7 +95,11 @@ script('settings', [
|
|||
<progress value="<?php p($_['usage_relative']); ?>" max="100"<?php if($_['usage_relative'] > 80): ?> class="warn" <?php endif; ?>></progress>
|
||||
</div>
|
||||
</div>
|
||||
<?php include __DIR__ . '/partials/where-is-your-data.php' ?>
|
||||
<?php
|
||||
if ($_['show_where_is_your_data_section']) {
|
||||
include __DIR__ . '/partials/where-is-your-data.php';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="personal-settings-container">
|
||||
|
|
Loading…
Reference in New Issue