@@ -51,6 +51,9 @@ discard block |
||
51 | 51 | ]; |
52 | 52 | } |
53 | 53 | |
54 | + /** |
|
55 | + * @param string $type |
|
56 | + */ |
|
54 | 57 | protected function formatSections($sections, $currentSection, $type) { |
55 | 58 | $templateParameters = []; |
56 | 59 | /** @var \OCP\Settings\ISection[] $prioritizedSections */ |
@@ -81,6 +84,9 @@ discard block |
||
81 | 84 | return $templateParameters; |
82 | 85 | } |
83 | 86 | |
87 | + /** |
|
88 | + * @param string $currentSections |
|
89 | + */ |
|
84 | 90 | protected function formatPersonalSections($currentSections) { |
85 | 91 | $sections = $this->settingsManager->getPersonalSections(); |
86 | 92 | $templateParameters = $this->formatSections($sections, $currentSections, 'personal'); |
@@ -88,6 +94,9 @@ discard block |
||
88 | 94 | return $templateParameters; |
89 | 95 | } |
90 | 96 | |
97 | + /** |
|
98 | + * @param string $currentSections |
|
99 | + */ |
|
91 | 100 | protected function formatAdminSections($currentSections) { |
92 | 101 | $sections = $this->settingsManager->getAdminSections(); |
93 | 102 | $templateParameters = $this->formatSections($sections, $currentSections, 'admin'); |
@@ -111,6 +120,9 @@ discard block |
||
111 | 120 | return ['content' => $html]; |
112 | 121 | } |
113 | 122 | |
123 | + /** |
|
124 | + * @param string $section |
|
125 | + */ |
|
114 | 126 | private function getIndexResponse($section) { |
115 | 127 | $templateParams = []; |
116 | 128 | $templateParams = array_merge($templateParams, $this->getNavigationParameters($section)); |
@@ -29,95 +29,95 @@ |
||
29 | 29 | use OCP\Settings\ISettings; |
30 | 30 | |
31 | 31 | trait CommonSettingsTrait { |
32 | - /** @var ISettingsManager */ |
|
33 | - private $settingsManager; |
|
34 | - |
|
35 | - /** |
|
36 | - * @param string $currentSection |
|
37 | - * @return array |
|
38 | - */ |
|
39 | - private function getNavigationParameters($currentSection) { |
|
40 | - $templateParameters = [ |
|
41 | - 'personal' => $this->formatPersonalSections($currentSection), |
|
42 | - 'admin' => [] |
|
43 | - ]; |
|
44 | - |
|
45 | - if(\OC_User::isAdminUser(\OC_User::getUser())) { |
|
46 | - $templateParameters['admin'] = $this->formatAdminSections($currentSection); |
|
47 | - } |
|
48 | - |
|
49 | - return [ |
|
50 | - 'forms' => $templateParameters |
|
51 | - ]; |
|
52 | - } |
|
53 | - |
|
54 | - protected function formatSections($sections, $currentSection, $type) { |
|
55 | - $templateParameters = []; |
|
56 | - /** @var \OCP\Settings\ISection[] $prioritizedSections */ |
|
57 | - foreach($sections as $prioritizedSections) { |
|
58 | - foreach ($prioritizedSections as $section) { |
|
59 | - if($type === 'admin') { |
|
60 | - $settings = $this->settingsManager->getAdminSettings($section->getID()); |
|
61 | - } else if($type === 'personal') { |
|
62 | - $settings = $this->settingsManager->getPersonalSettings($section->getID()); |
|
63 | - } |
|
64 | - if (empty($settings)) { |
|
65 | - continue; |
|
66 | - } |
|
67 | - |
|
68 | - $icon = ''; |
|
69 | - if ($section instanceof IIconSection) { |
|
70 | - $icon = $section->getIcon(); |
|
71 | - } |
|
72 | - |
|
73 | - $templateParameters[] = [ |
|
74 | - 'anchor' => $section->getID(), |
|
75 | - 'section-name' => $section->getName(), |
|
76 | - 'active' => $section->getID() === $currentSection, |
|
77 | - 'icon' => $icon, |
|
78 | - ]; |
|
79 | - } |
|
80 | - } |
|
81 | - return $templateParameters; |
|
82 | - } |
|
83 | - |
|
84 | - protected function formatPersonalSections($currentSections) { |
|
85 | - $sections = $this->settingsManager->getPersonalSections(); |
|
86 | - $templateParameters = $this->formatSections($sections, $currentSections, 'personal'); |
|
87 | - |
|
88 | - return $templateParameters; |
|
89 | - } |
|
90 | - |
|
91 | - protected function formatAdminSections($currentSections) { |
|
92 | - $sections = $this->settingsManager->getAdminSections(); |
|
93 | - $templateParameters = $this->formatSections($sections, $currentSections, 'admin'); |
|
94 | - |
|
95 | - return $templateParameters; |
|
96 | - } |
|
97 | - |
|
98 | - /** |
|
99 | - * @param ISettings[] $settings |
|
100 | - * @return array |
|
101 | - */ |
|
102 | - private function formatSettings($settings) { |
|
103 | - $html = ''; |
|
104 | - foreach ($settings as $prioritizedSettings) { |
|
105 | - foreach ($prioritizedSettings as $setting) { |
|
106 | - /** @var \OCP\Settings\ISettings $setting */ |
|
107 | - $form = $setting->getForm(); |
|
108 | - $html .= $form->renderAs('')->render(); |
|
109 | - } |
|
110 | - } |
|
111 | - return ['content' => $html]; |
|
112 | - } |
|
113 | - |
|
114 | - private function getIndexResponse($section) { |
|
115 | - $templateParams = []; |
|
116 | - $templateParams = array_merge($templateParams, $this->getNavigationParameters($section)); |
|
117 | - $templateParams = array_merge($templateParams, $this->getSettings($section)); |
|
118 | - |
|
119 | - return new TemplateResponse('settings', 'settings/frame', $templateParams); |
|
120 | - } |
|
121 | - |
|
122 | - abstract public function getSettings($section); |
|
32 | + /** @var ISettingsManager */ |
|
33 | + private $settingsManager; |
|
34 | + |
|
35 | + /** |
|
36 | + * @param string $currentSection |
|
37 | + * @return array |
|
38 | + */ |
|
39 | + private function getNavigationParameters($currentSection) { |
|
40 | + $templateParameters = [ |
|
41 | + 'personal' => $this->formatPersonalSections($currentSection), |
|
42 | + 'admin' => [] |
|
43 | + ]; |
|
44 | + |
|
45 | + if(\OC_User::isAdminUser(\OC_User::getUser())) { |
|
46 | + $templateParameters['admin'] = $this->formatAdminSections($currentSection); |
|
47 | + } |
|
48 | + |
|
49 | + return [ |
|
50 | + 'forms' => $templateParameters |
|
51 | + ]; |
|
52 | + } |
|
53 | + |
|
54 | + protected function formatSections($sections, $currentSection, $type) { |
|
55 | + $templateParameters = []; |
|
56 | + /** @var \OCP\Settings\ISection[] $prioritizedSections */ |
|
57 | + foreach($sections as $prioritizedSections) { |
|
58 | + foreach ($prioritizedSections as $section) { |
|
59 | + if($type === 'admin') { |
|
60 | + $settings = $this->settingsManager->getAdminSettings($section->getID()); |
|
61 | + } else if($type === 'personal') { |
|
62 | + $settings = $this->settingsManager->getPersonalSettings($section->getID()); |
|
63 | + } |
|
64 | + if (empty($settings)) { |
|
65 | + continue; |
|
66 | + } |
|
67 | + |
|
68 | + $icon = ''; |
|
69 | + if ($section instanceof IIconSection) { |
|
70 | + $icon = $section->getIcon(); |
|
71 | + } |
|
72 | + |
|
73 | + $templateParameters[] = [ |
|
74 | + 'anchor' => $section->getID(), |
|
75 | + 'section-name' => $section->getName(), |
|
76 | + 'active' => $section->getID() === $currentSection, |
|
77 | + 'icon' => $icon, |
|
78 | + ]; |
|
79 | + } |
|
80 | + } |
|
81 | + return $templateParameters; |
|
82 | + } |
|
83 | + |
|
84 | + protected function formatPersonalSections($currentSections) { |
|
85 | + $sections = $this->settingsManager->getPersonalSections(); |
|
86 | + $templateParameters = $this->formatSections($sections, $currentSections, 'personal'); |
|
87 | + |
|
88 | + return $templateParameters; |
|
89 | + } |
|
90 | + |
|
91 | + protected function formatAdminSections($currentSections) { |
|
92 | + $sections = $this->settingsManager->getAdminSections(); |
|
93 | + $templateParameters = $this->formatSections($sections, $currentSections, 'admin'); |
|
94 | + |
|
95 | + return $templateParameters; |
|
96 | + } |
|
97 | + |
|
98 | + /** |
|
99 | + * @param ISettings[] $settings |
|
100 | + * @return array |
|
101 | + */ |
|
102 | + private function formatSettings($settings) { |
|
103 | + $html = ''; |
|
104 | + foreach ($settings as $prioritizedSettings) { |
|
105 | + foreach ($prioritizedSettings as $setting) { |
|
106 | + /** @var \OCP\Settings\ISettings $setting */ |
|
107 | + $form = $setting->getForm(); |
|
108 | + $html .= $form->renderAs('')->render(); |
|
109 | + } |
|
110 | + } |
|
111 | + return ['content' => $html]; |
|
112 | + } |
|
113 | + |
|
114 | + private function getIndexResponse($section) { |
|
115 | + $templateParams = []; |
|
116 | + $templateParams = array_merge($templateParams, $this->getNavigationParameters($section)); |
|
117 | + $templateParams = array_merge($templateParams, $this->getSettings($section)); |
|
118 | + |
|
119 | + return new TemplateResponse('settings', 'settings/frame', $templateParams); |
|
120 | + } |
|
121 | + |
|
122 | + abstract public function getSettings($section); |
|
123 | 123 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | use OCP\Settings\IIconSection; |
29 | 29 | use OCP\Settings\ISettings; |
30 | 30 | |
31 | -trait CommonSettingsTrait { |
|
31 | +trait CommonSettingsTrait { |
|
32 | 32 | /** @var ISettingsManager */ |
33 | 33 | private $settingsManager; |
34 | 34 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | 'admin' => [] |
43 | 43 | ]; |
44 | 44 | |
45 | - if(\OC_User::isAdminUser(\OC_User::getUser())) { |
|
45 | + if (\OC_User::isAdminUser(\OC_User::getUser())) { |
|
46 | 46 | $templateParameters['admin'] = $this->formatAdminSections($currentSection); |
47 | 47 | } |
48 | 48 | |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | protected function formatSections($sections, $currentSection, $type) { |
55 | 55 | $templateParameters = []; |
56 | 56 | /** @var \OCP\Settings\ISection[] $prioritizedSections */ |
57 | - foreach($sections as $prioritizedSections) { |
|
57 | + foreach ($sections as $prioritizedSections) { |
|
58 | 58 | foreach ($prioritizedSections as $section) { |
59 | - if($type === 'admin') { |
|
59 | + if ($type === 'admin') { |
|
60 | 60 | $settings = $this->settingsManager->getAdminSettings($section->getID()); |
61 | - } else if($type === 'personal') { |
|
61 | + } else if ($type === 'personal') { |
|
62 | 62 | $settings = $this->settingsManager->getPersonalSettings($section->getID()); |
63 | 63 | } |
64 | 64 | if (empty($settings)) { |
@@ -135,7 +135,7 @@ |
||
135 | 135 | $ln = array('code' => $lang, 'name' => $potentialName); |
136 | 136 | } elseif ($lang === 'en') { |
137 | 137 | $ln = ['code' => $lang, 'name' => 'English (US)']; |
138 | - }else{//fallback to language code |
|
138 | + } else{//fallback to language code |
|
139 | 139 | $ln=array('code'=>$lang, 'name'=>$lang); |
140 | 140 | } |
141 | 141 |
@@ -154,16 +154,16 @@ discard block |
||
154 | 154 | $commonLanguages = []; |
155 | 155 | $userLang = $this->config->getUserValue($uid, 'core', 'lang', $this->l10nFactory->findLanguage()); |
156 | 156 | $languageCodes = $this->l10nFactory->findAvailableLanguages(); |
157 | - foreach($languageCodes as $lang) { |
|
157 | + foreach ($languageCodes as $lang) { |
|
158 | 158 | $l = \OC::$server->getL10N('settings', $lang); |
159 | 159 | // TRANSLATORS this is the language name for the language switcher in the personal settings and should be the localized version |
160 | 160 | $potentialName = (string) $l->t('__language_name__'); |
161 | - if($l->getLanguageCode() === $lang && substr($potentialName, 0, 1) !== '_') {//first check if the language name is in the translation file |
|
161 | + if ($l->getLanguageCode() === $lang && substr($potentialName, 0, 1) !== '_') {//first check if the language name is in the translation file |
|
162 | 162 | $ln = array('code' => $lang, 'name' => $potentialName); |
163 | 163 | } elseif ($lang === 'en') { |
164 | 164 | $ln = ['code' => $lang, 'name' => 'English (US)']; |
165 | - }else{//fallback to language code |
|
166 | - $ln=array('code'=>$lang, 'name'=>$lang); |
|
165 | + } else {//fallback to language code |
|
166 | + $ln = array('code'=>$lang, 'name'=>$lang); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | // put appropriate languages into appropriate arrays, to print them sorted |
@@ -171,9 +171,9 @@ discard block |
||
171 | 171 | if ($lang === $userLang) { |
172 | 172 | $userLang = $ln; |
173 | 173 | } elseif (in_array($lang, self::COMMON_LANGUAGE_CODES)) { |
174 | - $commonLanguages[array_search($lang, self::COMMON_LANGUAGE_CODES)]=$ln; |
|
174 | + $commonLanguages[array_search($lang, self::COMMON_LANGUAGE_CODES)] = $ln; |
|
175 | 175 | } else { |
176 | - $languages[]=$ln; |
|
176 | + $languages[] = $ln; |
|
177 | 177 | } |
178 | 178 | } |
179 | 179 | |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | ksort($commonLanguages); |
189 | 189 | |
190 | 190 | // sort now by displayed language not the iso-code |
191 | - usort( $languages, function ($a, $b) { |
|
191 | + usort($languages, function($a, $b) { |
|
192 | 192 | if ($a['code'] === $a['name'] && $b['code'] !== $b['name']) { |
193 | 193 | // If a doesn't have a name, but b does, list b before a |
194 | 194 | return 1; |
@@ -37,204 +37,204 @@ |
||
37 | 37 | use OCP\Settings\ISettings; |
38 | 38 | |
39 | 39 | class PersonalInfo implements ISettings { |
40 | - /** @var IConfig */ |
|
41 | - private $config; |
|
42 | - /** @var IUserManager */ |
|
43 | - private $userManager; |
|
44 | - /** @var AccountManager */ |
|
45 | - private $accountManager; |
|
46 | - /** @var IGroupManager */ |
|
47 | - private $groupManager; |
|
48 | - /** @var IFactory */ |
|
49 | - private $l10nFactory; |
|
50 | - |
|
51 | - const COMMON_LANGUAGE_CODES = [ |
|
52 | - 'en', 'es', 'fr', 'de', 'de_DE', 'ja', 'ar', 'ru', 'nl', 'it', |
|
53 | - 'pt_BR', 'pt_PT', 'da', 'fi_FI', 'nb_NO', 'sv', 'tr', 'zh_CN', 'ko' |
|
54 | - ]; |
|
55 | - |
|
56 | - /** @var IL10N */ |
|
57 | - private $l; |
|
58 | - |
|
59 | - /** |
|
60 | - * @param IConfig $config |
|
61 | - * @param IUserManager $userManager |
|
62 | - * @param IGroupManager $groupManager |
|
63 | - * @param AccountManager $accountManager |
|
64 | - * @param IFactory $l10nFactory |
|
65 | - * @param IL10N $l |
|
66 | - */ |
|
67 | - public function __construct( |
|
68 | - IConfig $config, |
|
69 | - IUserManager $userManager, |
|
70 | - IGroupManager $groupManager, |
|
71 | - AccountManager $accountManager, |
|
72 | - IFactory $l10nFactory, |
|
73 | - IL10N $l |
|
74 | - ) { |
|
75 | - $this->config = $config; |
|
76 | - $this->userManager = $userManager; |
|
77 | - $this->accountManager = $accountManager; |
|
78 | - $this->groupManager = $groupManager; |
|
79 | - $this->l10nFactory = $l10nFactory; |
|
80 | - $this->l = $l; |
|
81 | - } |
|
82 | - |
|
83 | - /** |
|
84 | - * @return TemplateResponse returns the instance with all parameters set, ready to be rendered |
|
85 | - * @since 9.1 |
|
86 | - */ |
|
87 | - public function getForm() { |
|
88 | - $lookupServerUploadEnabled = $this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'yes'); |
|
89 | - $lookupServerUploadEnabled = $lookupServerUploadEnabled === 'yes'; |
|
90 | - |
|
91 | - $uid = \OC_User::getUser(); |
|
92 | - $user = $this->userManager->get($uid); |
|
93 | - $userData = $this->accountManager->getUser($user); |
|
94 | - |
|
95 | - $storageInfo = \OC_Helper::getStorageInfo('/'); |
|
96 | - if ($storageInfo['quota'] === FileInfo::SPACE_UNLIMITED) { |
|
97 | - $totalSpace = $this->l->t('Unlimited'); |
|
98 | - } else { |
|
99 | - $totalSpace = \OC_Helper::humanFileSize($storageInfo['total']); |
|
100 | - } |
|
101 | - |
|
102 | - list($activeLanguage, $commonLanguages, $languages) = $this->getLanguages($user); |
|
103 | - |
|
104 | - $parameters = [ |
|
105 | - 'total_space' => $totalSpace, |
|
106 | - 'usage' => \OC_Helper::humanFileSize($storageInfo['used']), |
|
107 | - 'usage_relative' => $storageInfo['relative'], |
|
108 | - 'quota' => $storageInfo['quota'], |
|
109 | - 'avatarChangeSupported' => \OC_User::canUserChangeAvatar($uid), |
|
110 | - 'lookupServerUploadEnabled' => $lookupServerUploadEnabled, |
|
111 | - 'avatar_scope' => $userData[AccountManager::PROPERTY_AVATAR]['scope'], |
|
112 | - 'displayNameChangeSupported' => \OC_User::canUserChangeDisplayName($uid), |
|
113 | - 'displayName' => $userData[AccountManager::PROPERTY_DISPLAYNAME]['value'], |
|
114 | - 'email' => $userData[AccountManager::PROPERTY_EMAIL]['value'], |
|
115 | - 'emailScope' => $userData[AccountManager::PROPERTY_EMAIL]['scope'], |
|
116 | - 'emailMesage' => '', |
|
117 | - 'emailVerification' => $userData[AccountManager::PROPERTY_EMAIL]['verified'], |
|
118 | - 'phone' => $userData[AccountManager::PROPERTY_PHONE]['value'], |
|
119 | - 'phoneScope' => $userData[AccountManager::PROPERTY_PHONE]['scope'], |
|
120 | - 'address', $userData[AccountManager::PROPERTY_ADDRESS]['value'], |
|
121 | - 'addressScope', $userData[AccountManager::PROPERTY_ADDRESS]['scope'], |
|
122 | - 'website' => $userData[AccountManager::PROPERTY_WEBSITE]['value'], |
|
123 | - 'websiteScope' => $userData[AccountManager::PROPERTY_WEBSITE]['scope'], |
|
124 | - 'websiteVerification' => $userData[AccountManager::PROPERTY_WEBSITE]['verified'], |
|
125 | - 'twitter' => $userData[AccountManager::PROPERTY_TWITTER]['value'], |
|
126 | - 'twitterScope' => $userData[AccountManager::PROPERTY_TWITTER]['scope'], |
|
127 | - 'twitterVerification' => $userData[AccountManager::PROPERTY_TWITTER]['verified'], |
|
128 | - 'groups' => $this->getGroups($user), |
|
129 | - 'passwordChangeSupported' => \OC_User::canUserChangePassword($uid), |
|
130 | - 'activelanguage' => $activeLanguage, |
|
131 | - 'commonlanguages' => $commonLanguages, |
|
132 | - 'languages' => $languages, |
|
133 | - ]; |
|
134 | - |
|
135 | - |
|
136 | - return new TemplateResponse('settings', 'settings/personal/personal.info', $parameters, ''); |
|
137 | - } |
|
138 | - |
|
139 | - /** |
|
140 | - * @return string the section ID, e.g. 'sharing' |
|
141 | - * @since 9.1 |
|
142 | - */ |
|
143 | - public function getSection() { |
|
144 | - return 'personal-info'; |
|
145 | - } |
|
146 | - |
|
147 | - /** |
|
148 | - * @return int whether the form should be rather on the top or bottom of |
|
149 | - * the admin section. The forms are arranged in ascending order of the |
|
150 | - * priority values. It is required to return a value between 0 and 100. |
|
151 | - * |
|
152 | - * E.g.: 70 |
|
153 | - * @since 9.1 |
|
154 | - */ |
|
155 | - public function getPriority() { |
|
156 | - return 10; |
|
157 | - } |
|
158 | - |
|
159 | - /** |
|
160 | - * returns a sorted list of the user's group GIDs |
|
161 | - * |
|
162 | - * @param IUser $user |
|
163 | - * @return array |
|
164 | - */ |
|
165 | - private function getGroups(IUser $user) { |
|
166 | - $groups = array_map( |
|
167 | - function(IGroup $group) { |
|
168 | - return $group->getGID(); |
|
169 | - }, |
|
170 | - $this->groupManager->getUserGroups($user) |
|
171 | - ); |
|
172 | - sort($groups); |
|
173 | - |
|
174 | - return $groups; |
|
175 | - } |
|
176 | - |
|
177 | - /** |
|
178 | - * returns the user language, common language and other languages in an |
|
179 | - * associative array |
|
180 | - * |
|
181 | - * @param IUser $user |
|
182 | - * @return array |
|
183 | - */ |
|
184 | - private function getLanguages(IUser $user) { |
|
185 | - $uid = $user->getUID(); |
|
186 | - |
|
187 | - $commonLanguages = []; |
|
188 | - $userLang = $this->config->getUserValue($uid, 'core', 'lang', $this->l10nFactory->findLanguage()); |
|
189 | - $languageCodes = $this->l10nFactory->findAvailableLanguages(); |
|
190 | - foreach($languageCodes as $lang) { |
|
191 | - $l = \OC::$server->getL10N('settings', $lang); |
|
192 | - // TRANSLATORS this is the language name for the language switcher in the personal settings and should be the localized version |
|
193 | - $potentialName = (string) $l->t('__language_name__'); |
|
194 | - if($l->getLanguageCode() === $lang && substr($potentialName, 0, 1) !== '_') {//first check if the language name is in the translation file |
|
195 | - $ln = array('code' => $lang, 'name' => $potentialName); |
|
196 | - } elseif ($lang === 'en') { |
|
197 | - $ln = ['code' => $lang, 'name' => 'English (US)']; |
|
198 | - }else{//fallback to language code |
|
199 | - $ln=array('code'=>$lang, 'name'=>$lang); |
|
200 | - } |
|
201 | - |
|
202 | - // put appropriate languages into appropriate arrays, to print them sorted |
|
203 | - // used language -> common languages -> divider -> other languages |
|
204 | - if ($lang === $userLang) { |
|
205 | - $userLang = $ln; |
|
206 | - } elseif (in_array($lang, self::COMMON_LANGUAGE_CODES)) { |
|
207 | - $commonLanguages[array_search($lang, self::COMMON_LANGUAGE_CODES)]=$ln; |
|
208 | - } else { |
|
209 | - $languages[]=$ln; |
|
210 | - } |
|
211 | - } |
|
212 | - |
|
213 | - // if user language is not available but set somehow: show the actual code as name |
|
214 | - if (!is_array($userLang)) { |
|
215 | - $userLang = [ |
|
216 | - 'code' => $userLang, |
|
217 | - 'name' => $userLang, |
|
218 | - ]; |
|
219 | - } |
|
220 | - |
|
221 | - ksort($commonLanguages); |
|
222 | - |
|
223 | - // sort now by displayed language not the iso-code |
|
224 | - usort( $languages, function ($a, $b) { |
|
225 | - if ($a['code'] === $a['name'] && $b['code'] !== $b['name']) { |
|
226 | - // If a doesn't have a name, but b does, list b before a |
|
227 | - return 1; |
|
228 | - } |
|
229 | - if ($a['code'] !== $a['name'] && $b['code'] === $b['name']) { |
|
230 | - // If a does have a name, but b doesn't, list a before b |
|
231 | - return -1; |
|
232 | - } |
|
233 | - // Otherwise compare the names |
|
234 | - return strcmp($a['name'], $b['name']); |
|
235 | - }); |
|
236 | - |
|
237 | - return [$userLang, $commonLanguages, $languages]; |
|
238 | - } |
|
40 | + /** @var IConfig */ |
|
41 | + private $config; |
|
42 | + /** @var IUserManager */ |
|
43 | + private $userManager; |
|
44 | + /** @var AccountManager */ |
|
45 | + private $accountManager; |
|
46 | + /** @var IGroupManager */ |
|
47 | + private $groupManager; |
|
48 | + /** @var IFactory */ |
|
49 | + private $l10nFactory; |
|
50 | + |
|
51 | + const COMMON_LANGUAGE_CODES = [ |
|
52 | + 'en', 'es', 'fr', 'de', 'de_DE', 'ja', 'ar', 'ru', 'nl', 'it', |
|
53 | + 'pt_BR', 'pt_PT', 'da', 'fi_FI', 'nb_NO', 'sv', 'tr', 'zh_CN', 'ko' |
|
54 | + ]; |
|
55 | + |
|
56 | + /** @var IL10N */ |
|
57 | + private $l; |
|
58 | + |
|
59 | + /** |
|
60 | + * @param IConfig $config |
|
61 | + * @param IUserManager $userManager |
|
62 | + * @param IGroupManager $groupManager |
|
63 | + * @param AccountManager $accountManager |
|
64 | + * @param IFactory $l10nFactory |
|
65 | + * @param IL10N $l |
|
66 | + */ |
|
67 | + public function __construct( |
|
68 | + IConfig $config, |
|
69 | + IUserManager $userManager, |
|
70 | + IGroupManager $groupManager, |
|
71 | + AccountManager $accountManager, |
|
72 | + IFactory $l10nFactory, |
|
73 | + IL10N $l |
|
74 | + ) { |
|
75 | + $this->config = $config; |
|
76 | + $this->userManager = $userManager; |
|
77 | + $this->accountManager = $accountManager; |
|
78 | + $this->groupManager = $groupManager; |
|
79 | + $this->l10nFactory = $l10nFactory; |
|
80 | + $this->l = $l; |
|
81 | + } |
|
82 | + |
|
83 | + /** |
|
84 | + * @return TemplateResponse returns the instance with all parameters set, ready to be rendered |
|
85 | + * @since 9.1 |
|
86 | + */ |
|
87 | + public function getForm() { |
|
88 | + $lookupServerUploadEnabled = $this->config->getAppValue('files_sharing', 'lookupServerUploadEnabled', 'yes'); |
|
89 | + $lookupServerUploadEnabled = $lookupServerUploadEnabled === 'yes'; |
|
90 | + |
|
91 | + $uid = \OC_User::getUser(); |
|
92 | + $user = $this->userManager->get($uid); |
|
93 | + $userData = $this->accountManager->getUser($user); |
|
94 | + |
|
95 | + $storageInfo = \OC_Helper::getStorageInfo('/'); |
|
96 | + if ($storageInfo['quota'] === FileInfo::SPACE_UNLIMITED) { |
|
97 | + $totalSpace = $this->l->t('Unlimited'); |
|
98 | + } else { |
|
99 | + $totalSpace = \OC_Helper::humanFileSize($storageInfo['total']); |
|
100 | + } |
|
101 | + |
|
102 | + list($activeLanguage, $commonLanguages, $languages) = $this->getLanguages($user); |
|
103 | + |
|
104 | + $parameters = [ |
|
105 | + 'total_space' => $totalSpace, |
|
106 | + 'usage' => \OC_Helper::humanFileSize($storageInfo['used']), |
|
107 | + 'usage_relative' => $storageInfo['relative'], |
|
108 | + 'quota' => $storageInfo['quota'], |
|
109 | + 'avatarChangeSupported' => \OC_User::canUserChangeAvatar($uid), |
|
110 | + 'lookupServerUploadEnabled' => $lookupServerUploadEnabled, |
|
111 | + 'avatar_scope' => $userData[AccountManager::PROPERTY_AVATAR]['scope'], |
|
112 | + 'displayNameChangeSupported' => \OC_User::canUserChangeDisplayName($uid), |
|
113 | + 'displayName' => $userData[AccountManager::PROPERTY_DISPLAYNAME]['value'], |
|
114 | + 'email' => $userData[AccountManager::PROPERTY_EMAIL]['value'], |
|
115 | + 'emailScope' => $userData[AccountManager::PROPERTY_EMAIL]['scope'], |
|
116 | + 'emailMesage' => '', |
|
117 | + 'emailVerification' => $userData[AccountManager::PROPERTY_EMAIL]['verified'], |
|
118 | + 'phone' => $userData[AccountManager::PROPERTY_PHONE]['value'], |
|
119 | + 'phoneScope' => $userData[AccountManager::PROPERTY_PHONE]['scope'], |
|
120 | + 'address', $userData[AccountManager::PROPERTY_ADDRESS]['value'], |
|
121 | + 'addressScope', $userData[AccountManager::PROPERTY_ADDRESS]['scope'], |
|
122 | + 'website' => $userData[AccountManager::PROPERTY_WEBSITE]['value'], |
|
123 | + 'websiteScope' => $userData[AccountManager::PROPERTY_WEBSITE]['scope'], |
|
124 | + 'websiteVerification' => $userData[AccountManager::PROPERTY_WEBSITE]['verified'], |
|
125 | + 'twitter' => $userData[AccountManager::PROPERTY_TWITTER]['value'], |
|
126 | + 'twitterScope' => $userData[AccountManager::PROPERTY_TWITTER]['scope'], |
|
127 | + 'twitterVerification' => $userData[AccountManager::PROPERTY_TWITTER]['verified'], |
|
128 | + 'groups' => $this->getGroups($user), |
|
129 | + 'passwordChangeSupported' => \OC_User::canUserChangePassword($uid), |
|
130 | + 'activelanguage' => $activeLanguage, |
|
131 | + 'commonlanguages' => $commonLanguages, |
|
132 | + 'languages' => $languages, |
|
133 | + ]; |
|
134 | + |
|
135 | + |
|
136 | + return new TemplateResponse('settings', 'settings/personal/personal.info', $parameters, ''); |
|
137 | + } |
|
138 | + |
|
139 | + /** |
|
140 | + * @return string the section ID, e.g. 'sharing' |
|
141 | + * @since 9.1 |
|
142 | + */ |
|
143 | + public function getSection() { |
|
144 | + return 'personal-info'; |
|
145 | + } |
|
146 | + |
|
147 | + /** |
|
148 | + * @return int whether the form should be rather on the top or bottom of |
|
149 | + * the admin section. The forms are arranged in ascending order of the |
|
150 | + * priority values. It is required to return a value between 0 and 100. |
|
151 | + * |
|
152 | + * E.g.: 70 |
|
153 | + * @since 9.1 |
|
154 | + */ |
|
155 | + public function getPriority() { |
|
156 | + return 10; |
|
157 | + } |
|
158 | + |
|
159 | + /** |
|
160 | + * returns a sorted list of the user's group GIDs |
|
161 | + * |
|
162 | + * @param IUser $user |
|
163 | + * @return array |
|
164 | + */ |
|
165 | + private function getGroups(IUser $user) { |
|
166 | + $groups = array_map( |
|
167 | + function(IGroup $group) { |
|
168 | + return $group->getGID(); |
|
169 | + }, |
|
170 | + $this->groupManager->getUserGroups($user) |
|
171 | + ); |
|
172 | + sort($groups); |
|
173 | + |
|
174 | + return $groups; |
|
175 | + } |
|
176 | + |
|
177 | + /** |
|
178 | + * returns the user language, common language and other languages in an |
|
179 | + * associative array |
|
180 | + * |
|
181 | + * @param IUser $user |
|
182 | + * @return array |
|
183 | + */ |
|
184 | + private function getLanguages(IUser $user) { |
|
185 | + $uid = $user->getUID(); |
|
186 | + |
|
187 | + $commonLanguages = []; |
|
188 | + $userLang = $this->config->getUserValue($uid, 'core', 'lang', $this->l10nFactory->findLanguage()); |
|
189 | + $languageCodes = $this->l10nFactory->findAvailableLanguages(); |
|
190 | + foreach($languageCodes as $lang) { |
|
191 | + $l = \OC::$server->getL10N('settings', $lang); |
|
192 | + // TRANSLATORS this is the language name for the language switcher in the personal settings and should be the localized version |
|
193 | + $potentialName = (string) $l->t('__language_name__'); |
|
194 | + if($l->getLanguageCode() === $lang && substr($potentialName, 0, 1) !== '_') {//first check if the language name is in the translation file |
|
195 | + $ln = array('code' => $lang, 'name' => $potentialName); |
|
196 | + } elseif ($lang === 'en') { |
|
197 | + $ln = ['code' => $lang, 'name' => 'English (US)']; |
|
198 | + }else{//fallback to language code |
|
199 | + $ln=array('code'=>$lang, 'name'=>$lang); |
|
200 | + } |
|
201 | + |
|
202 | + // put appropriate languages into appropriate arrays, to print them sorted |
|
203 | + // used language -> common languages -> divider -> other languages |
|
204 | + if ($lang === $userLang) { |
|
205 | + $userLang = $ln; |
|
206 | + } elseif (in_array($lang, self::COMMON_LANGUAGE_CODES)) { |
|
207 | + $commonLanguages[array_search($lang, self::COMMON_LANGUAGE_CODES)]=$ln; |
|
208 | + } else { |
|
209 | + $languages[]=$ln; |
|
210 | + } |
|
211 | + } |
|
212 | + |
|
213 | + // if user language is not available but set somehow: show the actual code as name |
|
214 | + if (!is_array($userLang)) { |
|
215 | + $userLang = [ |
|
216 | + 'code' => $userLang, |
|
217 | + 'name' => $userLang, |
|
218 | + ]; |
|
219 | + } |
|
220 | + |
|
221 | + ksort($commonLanguages); |
|
222 | + |
|
223 | + // sort now by displayed language not the iso-code |
|
224 | + usort( $languages, function ($a, $b) { |
|
225 | + if ($a['code'] === $a['name'] && $b['code'] !== $b['name']) { |
|
226 | + // If a doesn't have a name, but b does, list b before a |
|
227 | + return 1; |
|
228 | + } |
|
229 | + if ($a['code'] !== $a['name'] && $b['code'] === $b['name']) { |
|
230 | + // If a does have a name, but b doesn't, list a before b |
|
231 | + return -1; |
|
232 | + } |
|
233 | + // Otherwise compare the names |
|
234 | + return strcmp($a['name'], $b['name']); |
|
235 | + }); |
|
236 | + |
|
237 | + return [$userLang, $commonLanguages, $languages]; |
|
238 | + } |
|
239 | 239 | |
240 | 240 | } |
@@ -35,84 +35,84 @@ |
||
35 | 35 | * @package OC\Settings\Controller |
36 | 36 | */ |
37 | 37 | class AdminSettingsController extends Controller { |
38 | - use CommonSettingsTrait; |
|
38 | + use CommonSettingsTrait; |
|
39 | 39 | |
40 | - /** @var INavigationManager */ |
|
41 | - private $navigationManager; |
|
42 | - /** @var ISettingsManager */ |
|
43 | - private $settingsManager; |
|
40 | + /** @var INavigationManager */ |
|
41 | + private $navigationManager; |
|
42 | + /** @var ISettingsManager */ |
|
43 | + private $settingsManager; |
|
44 | 44 | |
45 | - /** |
|
46 | - * @param string $appName |
|
47 | - * @param IRequest $request |
|
48 | - * @param INavigationManager $navigationManager |
|
49 | - * @param ISettingsManager $settingsManager |
|
50 | - */ |
|
51 | - public function __construct( |
|
52 | - $appName, |
|
53 | - IRequest $request, |
|
54 | - INavigationManager $navigationManager, |
|
55 | - ISettingsManager $settingsManager |
|
56 | - ) { |
|
57 | - parent::__construct($appName, $request); |
|
58 | - $this->navigationManager = $navigationManager; |
|
59 | - $this->settingsManager = $settingsManager; |
|
60 | - } |
|
45 | + /** |
|
46 | + * @param string $appName |
|
47 | + * @param IRequest $request |
|
48 | + * @param INavigationManager $navigationManager |
|
49 | + * @param ISettingsManager $settingsManager |
|
50 | + */ |
|
51 | + public function __construct( |
|
52 | + $appName, |
|
53 | + IRequest $request, |
|
54 | + INavigationManager $navigationManager, |
|
55 | + ISettingsManager $settingsManager |
|
56 | + ) { |
|
57 | + parent::__construct($appName, $request); |
|
58 | + $this->navigationManager = $navigationManager; |
|
59 | + $this->settingsManager = $settingsManager; |
|
60 | + } |
|
61 | 61 | |
62 | - /** |
|
63 | - * @param string $section |
|
64 | - * @return TemplateResponse |
|
65 | - * |
|
66 | - * @NoCSRFRequired |
|
67 | - */ |
|
68 | - public function index($section) { |
|
69 | - $this->navigationManager->setActiveEntry('admin'); |
|
70 | - return $this->getIndexResponse($section); |
|
71 | - } |
|
62 | + /** |
|
63 | + * @param string $section |
|
64 | + * @return TemplateResponse |
|
65 | + * |
|
66 | + * @NoCSRFRequired |
|
67 | + */ |
|
68 | + public function index($section) { |
|
69 | + $this->navigationManager->setActiveEntry('admin'); |
|
70 | + return $this->getIndexResponse($section); |
|
71 | + } |
|
72 | 72 | |
73 | - /** |
|
74 | - * @param string $section |
|
75 | - * @return array |
|
76 | - */ |
|
77 | - private function getSettings($section) { |
|
78 | - // PhpStorm shows this as unused, but is required by CommonSettingsTrait |
|
79 | - $settings = $this->settingsManager->getAdminSettings($section); |
|
80 | - $formatted = $this->formatSettings($settings); |
|
81 | - if($section === 'additional') { |
|
82 | - $formatted['content'] .= $this->getLegacyForms(); |
|
83 | - } |
|
84 | - return $formatted; |
|
85 | - } |
|
73 | + /** |
|
74 | + * @param string $section |
|
75 | + * @return array |
|
76 | + */ |
|
77 | + private function getSettings($section) { |
|
78 | + // PhpStorm shows this as unused, but is required by CommonSettingsTrait |
|
79 | + $settings = $this->settingsManager->getAdminSettings($section); |
|
80 | + $formatted = $this->formatSettings($settings); |
|
81 | + if($section === 'additional') { |
|
82 | + $formatted['content'] .= $this->getLegacyForms(); |
|
83 | + } |
|
84 | + return $formatted; |
|
85 | + } |
|
86 | 86 | |
87 | - /** |
|
88 | - * @return bool|string |
|
89 | - */ |
|
90 | - private function getLegacyForms() { |
|
91 | - $forms = \OC_App::getForms('admin'); |
|
87 | + /** |
|
88 | + * @return bool|string |
|
89 | + */ |
|
90 | + private function getLegacyForms() { |
|
91 | + $forms = \OC_App::getForms('admin'); |
|
92 | 92 | |
93 | - $forms = array_map(function ($form) { |
|
94 | - if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) { |
|
95 | - $sectionName = str_replace('<h2' . $regs['class'] . '>', '', $regs[0]); |
|
96 | - $sectionName = str_replace('</h2>', '', $sectionName); |
|
97 | - $anchor = strtolower($sectionName); |
|
98 | - $anchor = str_replace(' ', '-', $anchor); |
|
93 | + $forms = array_map(function ($form) { |
|
94 | + if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) { |
|
95 | + $sectionName = str_replace('<h2' . $regs['class'] . '>', '', $regs[0]); |
|
96 | + $sectionName = str_replace('</h2>', '', $sectionName); |
|
97 | + $anchor = strtolower($sectionName); |
|
98 | + $anchor = str_replace(' ', '-', $anchor); |
|
99 | 99 | |
100 | - return array( |
|
101 | - 'anchor' => $anchor, |
|
102 | - 'section-name' => $sectionName, |
|
103 | - 'form' => $form |
|
104 | - ); |
|
105 | - } |
|
106 | - return array( |
|
107 | - 'form' => $form |
|
108 | - ); |
|
109 | - }, $forms); |
|
100 | + return array( |
|
101 | + 'anchor' => $anchor, |
|
102 | + 'section-name' => $sectionName, |
|
103 | + 'form' => $form |
|
104 | + ); |
|
105 | + } |
|
106 | + return array( |
|
107 | + 'form' => $form |
|
108 | + ); |
|
109 | + }, $forms); |
|
110 | 110 | |
111 | - $out = new Template('settings', 'admin/additional'); |
|
112 | - $out->assign('forms', $forms); |
|
111 | + $out = new Template('settings', 'admin/additional'); |
|
112 | + $out->assign('forms', $forms); |
|
113 | 113 | |
114 | - return $out->fetchPage(); |
|
115 | - } |
|
114 | + return $out->fetchPage(); |
|
115 | + } |
|
116 | 116 | |
117 | 117 | |
118 | 118 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | // PhpStorm shows this as unused, but is required by CommonSettingsTrait |
79 | 79 | $settings = $this->settingsManager->getAdminSettings($section); |
80 | 80 | $formatted = $this->formatSettings($settings); |
81 | - if($section === 'additional') { |
|
81 | + if ($section === 'additional') { |
|
82 | 82 | $formatted['content'] .= $this->getLegacyForms(); |
83 | 83 | } |
84 | 84 | return $formatted; |
@@ -90,9 +90,9 @@ discard block |
||
90 | 90 | private function getLegacyForms() { |
91 | 91 | $forms = \OC_App::getForms('admin'); |
92 | 92 | |
93 | - $forms = array_map(function ($form) { |
|
93 | + $forms = array_map(function($form) { |
|
94 | 94 | if (preg_match('%(<h2(?P<class>[^>]*)>.*?</h2>)%i', $form, $regs)) { |
95 | - $sectionName = str_replace('<h2' . $regs['class'] . '>', '', $regs[0]); |
|
95 | + $sectionName = str_replace('<h2'.$regs['class'].'>', '', $regs[0]); |
|
96 | 96 | $sectionName = str_replace('</h2>', '', $sectionName); |
97 | 97 | $anchor = strtolower($sectionName); |
98 | 98 | $anchor = str_replace(' ', '-', $anchor); |
@@ -30,44 +30,44 @@ |
||
30 | 30 | use OCP\Settings\IManager as ISettingsManager; |
31 | 31 | |
32 | 32 | class PersonalSettingsController extends Controller { |
33 | - use CommonSettingsTrait { |
|
34 | - getSettings as private; |
|
35 | - } |
|
33 | + use CommonSettingsTrait { |
|
34 | + getSettings as private; |
|
35 | + } |
|
36 | 36 | |
37 | - /** @var INavigationManager */ |
|
38 | - private $navigationManager; |
|
37 | + /** @var INavigationManager */ |
|
38 | + private $navigationManager; |
|
39 | 39 | |
40 | - public function __construct( |
|
41 | - $appName, |
|
42 | - IRequest $request, |
|
43 | - INavigationManager $navigationManager, |
|
44 | - ISettingsManager $settingsManager |
|
45 | - ) { |
|
46 | - parent::__construct($appName, $request); |
|
47 | - $this->navigationManager = $navigationManager; |
|
48 | - $this->settingsManager = $settingsManager; |
|
49 | - } |
|
40 | + public function __construct( |
|
41 | + $appName, |
|
42 | + IRequest $request, |
|
43 | + INavigationManager $navigationManager, |
|
44 | + ISettingsManager $settingsManager |
|
45 | + ) { |
|
46 | + parent::__construct($appName, $request); |
|
47 | + $this->navigationManager = $navigationManager; |
|
48 | + $this->settingsManager = $settingsManager; |
|
49 | + } |
|
50 | 50 | |
51 | - /** |
|
52 | - * @param string $section |
|
53 | - * @return TemplateResponse |
|
54 | - * |
|
55 | - * @NoCSRFRequired |
|
56 | - * @NoAdminRequired |
|
57 | - * @NoSubadminRequired |
|
58 | - */ |
|
59 | - public function index($section) { |
|
60 | - $this->navigationManager->setActiveEntry('personal'); |
|
61 | - return $this->getIndexResponse($section); |
|
62 | - } |
|
51 | + /** |
|
52 | + * @param string $section |
|
53 | + * @return TemplateResponse |
|
54 | + * |
|
55 | + * @NoCSRFRequired |
|
56 | + * @NoAdminRequired |
|
57 | + * @NoSubadminRequired |
|
58 | + */ |
|
59 | + public function index($section) { |
|
60 | + $this->navigationManager->setActiveEntry('personal'); |
|
61 | + return $this->getIndexResponse($section); |
|
62 | + } |
|
63 | 63 | |
64 | - /** |
|
65 | - * @param string $section |
|
66 | - * @return array |
|
67 | - */ |
|
68 | - private function getSettings($section) { |
|
69 | - // PhpStorm shows this as unused, but is required by CommonSettingsTrait |
|
70 | - $settings = $this->settingsManager->getPersonalSettings($section); |
|
71 | - return $this->formatSettings($settings); |
|
72 | - } |
|
64 | + /** |
|
65 | + * @param string $section |
|
66 | + * @return array |
|
67 | + */ |
|
68 | + private function getSettings($section) { |
|
69 | + // PhpStorm shows this as unused, but is required by CommonSettingsTrait |
|
70 | + $settings = $this->settingsManager->getPersonalSettings($section); |
|
71 | + return $this->formatSettings($settings); |
|
72 | + } |
|
73 | 73 | } |
@@ -32,13 +32,13 @@ discard block |
||
32 | 32 | <ul> |
33 | 33 | <li class="settings-caption">Personal</li> |
34 | 34 | <?php |
35 | - foreach($_['forms']['personal'] as $form) { |
|
36 | - if (isset($form['anchor'])) { |
|
37 | - $anchor = \OC::$server->getURLGenerator()->linkToRoute('settings.PersonalSettings.index', ['section' => $form['anchor']]); |
|
38 | - $class = 'nav-icon-' . $form['anchor']; |
|
39 | - $sectionName = $form['section-name']; |
|
40 | - $active = $form['active'] ? ' class="active"' : ''; |
|
41 | - ?> |
|
35 | + foreach($_['forms']['personal'] as $form) { |
|
36 | + if (isset($form['anchor'])) { |
|
37 | + $anchor = \OC::$server->getURLGenerator()->linkToRoute('settings.PersonalSettings.index', ['section' => $form['anchor']]); |
|
38 | + $class = 'nav-icon-' . $form['anchor']; |
|
39 | + $sectionName = $form['section-name']; |
|
40 | + $active = $form['active'] ? ' class="active"' : ''; |
|
41 | + ?> |
|
42 | 42 | <li <?php print_unescaped($form['active'] ? ' class="active"' : ''); ?>> |
43 | 43 | <a href="<?php p($anchor); ?>"> |
44 | 44 | <?php if (!empty($form['icon'])) { ?> |
@@ -50,24 +50,24 @@ discard block |
||
50 | 50 | </a> |
51 | 51 | </li> |
52 | 52 | <?php |
53 | - } |
|
54 | - } |
|
55 | - ?> |
|
53 | + } |
|
54 | + } |
|
55 | + ?> |
|
56 | 56 | |
57 | 57 | <?php |
58 | - if(!empty($_['forms']['admin'])) { |
|
59 | - ?> |
|
58 | + if(!empty($_['forms']['admin'])) { |
|
59 | + ?> |
|
60 | 60 | <li class="settings-caption">Administration</li> |
61 | 61 | <?php |
62 | - } |
|
63 | - foreach($_['forms']['admin'] as $form) { |
|
64 | - if (isset($form['anchor'])) { |
|
62 | + } |
|
63 | + foreach($_['forms']['admin'] as $form) { |
|
64 | + if (isset($form['anchor'])) { |
|
65 | 65 | |
66 | - $anchor = \OC::$server->getURLGenerator()->linkToRoute('settings.AdminSettings.index', ['section' => $form['anchor']]); |
|
67 | - $class = 'nav-icon-' . $form['anchor']; |
|
68 | - $sectionName = $form['section-name']; |
|
69 | - $active = $form['active'] ? ' class="active"' : ''; |
|
70 | - ?> |
|
66 | + $anchor = \OC::$server->getURLGenerator()->linkToRoute('settings.AdminSettings.index', ['section' => $form['anchor']]); |
|
67 | + $class = 'nav-icon-' . $form['anchor']; |
|
68 | + $sectionName = $form['section-name']; |
|
69 | + $active = $form['active'] ? ' class="active"' : ''; |
|
70 | + ?> |
|
71 | 71 | <li <?php print_unescaped($form['active'] ? ' class="active"' : ''); ?>> |
72 | 72 | <a href="<?php p($anchor); ?>"> |
73 | 73 | <?php if (!empty($form['icon'])) { ?> |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | </a> |
80 | 80 | </li> |
81 | 81 | <?php |
82 | - } |
|
83 | - } |
|
84 | - ?> |
|
82 | + } |
|
83 | + } |
|
84 | + ?> |
|
85 | 85 | </ul> |
86 | 86 | </div> |
87 | 87 |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | |
24 | 24 | style('settings', 'settings'); |
25 | -script('settings', [ 'settings', 'admin', 'log', 'certificates'] ); |
|
25 | +script('settings', ['settings', 'admin', 'log', 'certificates']); |
|
26 | 26 | script('core', ['multiselect', 'setupchecks']); |
27 | 27 | script('files', 'jquery.fileupload'); |
28 | 28 | |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | <ul> |
33 | 33 | <li class="settings-caption">Personal</li> |
34 | 34 | <?php |
35 | - foreach($_['forms']['personal'] as $form) { |
|
35 | + foreach ($_['forms']['personal'] as $form) { |
|
36 | 36 | if (isset($form['anchor'])) { |
37 | 37 | $anchor = \OC::$server->getURLGenerator()->linkToRoute('settings.PersonalSettings.index', ['section' => $form['anchor']]); |
38 | - $class = 'nav-icon-' . $form['anchor']; |
|
38 | + $class = 'nav-icon-'.$form['anchor']; |
|
39 | 39 | $sectionName = $form['section-name']; |
40 | 40 | $active = $form['active'] ? ' class="active"' : ''; |
41 | 41 | ?> |
@@ -55,16 +55,16 @@ discard block |
||
55 | 55 | ?> |
56 | 56 | |
57 | 57 | <?php |
58 | - if(!empty($_['forms']['admin'])) { |
|
58 | + if (!empty($_['forms']['admin'])) { |
|
59 | 59 | ?> |
60 | 60 | <li class="settings-caption">Administration</li> |
61 | 61 | <?php |
62 | 62 | } |
63 | - foreach($_['forms']['admin'] as $form) { |
|
63 | + foreach ($_['forms']['admin'] as $form) { |
|
64 | 64 | if (isset($form['anchor'])) { |
65 | 65 | |
66 | 66 | $anchor = \OC::$server->getURLGenerator()->linkToRoute('settings.AdminSettings.index', ['section' => $form['anchor']]); |
67 | - $class = 'nav-icon-' . $form['anchor']; |
|
67 | + $class = 'nav-icon-'.$form['anchor']; |
|
68 | 68 | $sectionName = $form['section-name']; |
69 | 69 | $active = $form['active'] ? ' class="active"' : ''; |
70 | 70 | ?> |
@@ -36,77 +36,77 @@ |
||
36 | 36 | |
37 | 37 | $application = new Application(); |
38 | 38 | $application->registerRoutes($this, [ |
39 | - 'resources' => [ |
|
40 | - 'users' => ['url' => '/settings/users/users'], |
|
41 | - 'AuthSettings' => ['url' => '/settings/personal/authtokens'], |
|
42 | - ], |
|
43 | - 'routes' => [ |
|
44 | - ['name' => 'MailSettings#setMailSettings', 'url' => '/settings/admin/mailsettings', 'verb' => 'POST'], |
|
45 | - ['name' => 'MailSettings#storeCredentials', 'url' => '/settings/admin/mailsettings/credentials', 'verb' => 'POST'], |
|
46 | - ['name' => 'MailSettings#sendTestMail', 'url' => '/settings/admin/mailtest', 'verb' => 'POST'], |
|
47 | - ['name' => 'Encryption#startMigration', 'url' => '/settings/admin/startmigration', 'verb' => 'POST'], |
|
48 | - ['name' => 'AppSettings#listCategories', 'url' => '/settings/apps/categories', 'verb' => 'GET'], |
|
49 | - ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps', 'verb' => 'GET'], |
|
50 | - ['name' => 'AppSettings#listApps', 'url' => '/settings/apps/list', 'verb' => 'GET'], |
|
51 | - ['name' => 'SecuritySettings#trustedDomains', 'url' => '/settings/admin/security/trustedDomains', 'verb' => 'POST'], |
|
52 | - ['name' => 'Users#setDisplayName', 'url' => '/settings/users/{username}/displayName', 'verb' => 'POST'], |
|
53 | - ['name' => 'Users#setEMailAddress', 'url' => '/settings/users/{id}/mailAddress', 'verb' => 'PUT'], |
|
54 | - ['name' => 'Users#setUserSettings', 'url' => '/settings/users/{username}/settings', 'verb' => 'PUT'], |
|
55 | - ['name' => 'Users#getVerificationCode', 'url' => '/settings/users/{account}/verify', 'verb' => 'GET'], |
|
56 | - ['name' => 'Users#setEnabled', 'url' => '/settings/users/{id}/setEnabled', 'verb' => 'POST'], |
|
57 | - ['name' => 'Users#stats', 'url' => '/settings/users/stats', 'verb' => 'GET'], |
|
58 | - ['name' => 'LogSettings#setLogLevel', 'url' => '/settings/admin/log/level', 'verb' => 'POST'], |
|
59 | - ['name' => 'LogSettings#getEntries', 'url' => '/settings/admin/log/entries', 'verb' => 'GET'], |
|
60 | - ['name' => 'LogSettings#download', 'url' => '/settings/admin/log/download', 'verb' => 'GET'], |
|
61 | - ['name' => 'CheckSetup#check', 'url' => '/settings/ajax/checksetup', 'verb' => 'GET'], |
|
62 | - ['name' => 'CheckSetup#getFailedIntegrityCheckFiles', 'url' => '/settings/integrity/failed', 'verb' => 'GET'], |
|
63 | - ['name' => 'CheckSetup#rescanFailedIntegrityCheck', 'url' => '/settings/integrity/rescan', 'verb' => 'GET'], |
|
64 | - ['name' => 'Certificate#addPersonalRootCertificate', 'url' => '/settings/personal/certificate', 'verb' => 'POST'], |
|
65 | - ['name' => 'Certificate#removePersonalRootCertificate', 'url' => '/settings/personal/certificate/{certificateIdentifier}', 'verb' => 'DELETE'], |
|
66 | - ['name' => 'Certificate#addSystemRootCertificate', 'url' => '/settings/admin/certificate', 'verb' => 'POST'], |
|
67 | - ['name' => 'Certificate#removeSystemRootCertificate', 'url' => '/settings/admin/certificate/{certificateIdentifier}', 'verb' => 'DELETE'], |
|
68 | - ['name' => 'PersonalSettings#index', 'url' => '/settings/user/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'personal-info']], |
|
69 | - ['name' => 'AdminSettings#index', 'url' => '/settings/admin/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'server']], |
|
70 | - ['name' => 'AdminSettings#form', 'url' => '/settings/admin/{section}', 'verb' => 'GET'], |
|
71 | - ['name' => 'ChangePassword#changePersonalPassword', 'url' => '/settings/personal/changepassword', 'verb' => 'POST'], |
|
72 | - ['name' => 'ChangePassword#changeUserPassword', 'url' => '/settings/users/changepassword', 'verb' => 'POST'], |
|
73 | - ['name' => 'Personal#setLanguage', 'url' => '/settings/ajax/setlanguage.php', 'verb' => 'POST'], |
|
74 | - ['name' => 'Groups#index', 'url' => '/settings/users/groups', 'verb' => 'GET'], |
|
75 | - ['name' => 'Groups#show', 'url' => '/settings/users/groups/{id}', 'requirements' => ['id' => '[^?]*'], 'verb' => 'GET'], |
|
76 | - ['name' => 'Groups#create', 'url' => '/settings/users/groups', 'verb' => 'POST'], |
|
77 | - ['name' => 'Groups#update', 'url' => '/settings/users/groups/{id}', 'requirements' => ['id' => '[^?]*'], 'verb' => 'PUT'], |
|
78 | - ['name' => 'Groups#destroy', 'url' => '/settings/users/groups/{id}', 'requirements' => ['id' => '[^?]*'], 'verb' => 'DELETE'], |
|
79 | - ] |
|
39 | + 'resources' => [ |
|
40 | + 'users' => ['url' => '/settings/users/users'], |
|
41 | + 'AuthSettings' => ['url' => '/settings/personal/authtokens'], |
|
42 | + ], |
|
43 | + 'routes' => [ |
|
44 | + ['name' => 'MailSettings#setMailSettings', 'url' => '/settings/admin/mailsettings', 'verb' => 'POST'], |
|
45 | + ['name' => 'MailSettings#storeCredentials', 'url' => '/settings/admin/mailsettings/credentials', 'verb' => 'POST'], |
|
46 | + ['name' => 'MailSettings#sendTestMail', 'url' => '/settings/admin/mailtest', 'verb' => 'POST'], |
|
47 | + ['name' => 'Encryption#startMigration', 'url' => '/settings/admin/startmigration', 'verb' => 'POST'], |
|
48 | + ['name' => 'AppSettings#listCategories', 'url' => '/settings/apps/categories', 'verb' => 'GET'], |
|
49 | + ['name' => 'AppSettings#viewApps', 'url' => '/settings/apps', 'verb' => 'GET'], |
|
50 | + ['name' => 'AppSettings#listApps', 'url' => '/settings/apps/list', 'verb' => 'GET'], |
|
51 | + ['name' => 'SecuritySettings#trustedDomains', 'url' => '/settings/admin/security/trustedDomains', 'verb' => 'POST'], |
|
52 | + ['name' => 'Users#setDisplayName', 'url' => '/settings/users/{username}/displayName', 'verb' => 'POST'], |
|
53 | + ['name' => 'Users#setEMailAddress', 'url' => '/settings/users/{id}/mailAddress', 'verb' => 'PUT'], |
|
54 | + ['name' => 'Users#setUserSettings', 'url' => '/settings/users/{username}/settings', 'verb' => 'PUT'], |
|
55 | + ['name' => 'Users#getVerificationCode', 'url' => '/settings/users/{account}/verify', 'verb' => 'GET'], |
|
56 | + ['name' => 'Users#setEnabled', 'url' => '/settings/users/{id}/setEnabled', 'verb' => 'POST'], |
|
57 | + ['name' => 'Users#stats', 'url' => '/settings/users/stats', 'verb' => 'GET'], |
|
58 | + ['name' => 'LogSettings#setLogLevel', 'url' => '/settings/admin/log/level', 'verb' => 'POST'], |
|
59 | + ['name' => 'LogSettings#getEntries', 'url' => '/settings/admin/log/entries', 'verb' => 'GET'], |
|
60 | + ['name' => 'LogSettings#download', 'url' => '/settings/admin/log/download', 'verb' => 'GET'], |
|
61 | + ['name' => 'CheckSetup#check', 'url' => '/settings/ajax/checksetup', 'verb' => 'GET'], |
|
62 | + ['name' => 'CheckSetup#getFailedIntegrityCheckFiles', 'url' => '/settings/integrity/failed', 'verb' => 'GET'], |
|
63 | + ['name' => 'CheckSetup#rescanFailedIntegrityCheck', 'url' => '/settings/integrity/rescan', 'verb' => 'GET'], |
|
64 | + ['name' => 'Certificate#addPersonalRootCertificate', 'url' => '/settings/personal/certificate', 'verb' => 'POST'], |
|
65 | + ['name' => 'Certificate#removePersonalRootCertificate', 'url' => '/settings/personal/certificate/{certificateIdentifier}', 'verb' => 'DELETE'], |
|
66 | + ['name' => 'Certificate#addSystemRootCertificate', 'url' => '/settings/admin/certificate', 'verb' => 'POST'], |
|
67 | + ['name' => 'Certificate#removeSystemRootCertificate', 'url' => '/settings/admin/certificate/{certificateIdentifier}', 'verb' => 'DELETE'], |
|
68 | + ['name' => 'PersonalSettings#index', 'url' => '/settings/user/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'personal-info']], |
|
69 | + ['name' => 'AdminSettings#index', 'url' => '/settings/admin/{section}', 'verb' => 'GET', 'defaults' => ['section' => 'server']], |
|
70 | + ['name' => 'AdminSettings#form', 'url' => '/settings/admin/{section}', 'verb' => 'GET'], |
|
71 | + ['name' => 'ChangePassword#changePersonalPassword', 'url' => '/settings/personal/changepassword', 'verb' => 'POST'], |
|
72 | + ['name' => 'ChangePassword#changeUserPassword', 'url' => '/settings/users/changepassword', 'verb' => 'POST'], |
|
73 | + ['name' => 'Personal#setLanguage', 'url' => '/settings/ajax/setlanguage.php', 'verb' => 'POST'], |
|
74 | + ['name' => 'Groups#index', 'url' => '/settings/users/groups', 'verb' => 'GET'], |
|
75 | + ['name' => 'Groups#show', 'url' => '/settings/users/groups/{id}', 'requirements' => ['id' => '[^?]*'], 'verb' => 'GET'], |
|
76 | + ['name' => 'Groups#create', 'url' => '/settings/users/groups', 'verb' => 'POST'], |
|
77 | + ['name' => 'Groups#update', 'url' => '/settings/users/groups/{id}', 'requirements' => ['id' => '[^?]*'], 'verb' => 'PUT'], |
|
78 | + ['name' => 'Groups#destroy', 'url' => '/settings/users/groups/{id}', 'requirements' => ['id' => '[^?]*'], 'verb' => 'DELETE'], |
|
79 | + ] |
|
80 | 80 | ]); |
81 | 81 | |
82 | 82 | /** @var $this \OCP\Route\IRouter */ |
83 | 83 | |
84 | 84 | // Settings pages |
85 | 85 | $this->create('settings_help', '/settings/help') |
86 | - ->actionInclude('settings/help.php'); |
|
86 | + ->actionInclude('settings/help.php'); |
|
87 | 87 | $this->create('settings_users', '/settings/users') |
88 | - ->actionInclude('settings/users.php'); |
|
88 | + ->actionInclude('settings/users.php'); |
|
89 | 89 | // Settings ajax actions |
90 | 90 | // users |
91 | 91 | $this->create('settings_ajax_setquota', '/settings/ajax/setquota.php') |
92 | - ->actionInclude('settings/ajax/setquota.php'); |
|
92 | + ->actionInclude('settings/ajax/setquota.php'); |
|
93 | 93 | $this->create('settings_ajax_togglegroups', '/settings/ajax/togglegroups.php') |
94 | - ->actionInclude('settings/ajax/togglegroups.php'); |
|
94 | + ->actionInclude('settings/ajax/togglegroups.php'); |
|
95 | 95 | $this->create('settings_ajax_togglesubadmins', '/settings/ajax/togglesubadmins.php') |
96 | - ->actionInclude('settings/ajax/togglesubadmins.php'); |
|
96 | + ->actionInclude('settings/ajax/togglesubadmins.php'); |
|
97 | 97 | $this->create('settings_ajax_changegorupname', '/settings/ajax/changegroupname.php') |
98 | - ->actionInclude('settings/ajax/changegroupname.php'); |
|
98 | + ->actionInclude('settings/ajax/changegroupname.php'); |
|
99 | 99 | // apps |
100 | 100 | $this->create('settings_ajax_enableapp', '/settings/ajax/enableapp.php') |
101 | - ->actionInclude('settings/ajax/enableapp.php'); |
|
101 | + ->actionInclude('settings/ajax/enableapp.php'); |
|
102 | 102 | $this->create('settings_ajax_disableapp', '/settings/ajax/disableapp.php') |
103 | - ->actionInclude('settings/ajax/disableapp.php'); |
|
103 | + ->actionInclude('settings/ajax/disableapp.php'); |
|
104 | 104 | $this->create('settings_ajax_updateapp', '/settings/ajax/updateapp.php') |
105 | - ->actionInclude('settings/ajax/updateapp.php'); |
|
105 | + ->actionInclude('settings/ajax/updateapp.php'); |
|
106 | 106 | $this->create('settings_ajax_uninstallapp', '/settings/ajax/uninstallapp.php') |
107 | - ->actionInclude('settings/ajax/uninstallapp.php'); |
|
107 | + ->actionInclude('settings/ajax/uninstallapp.php'); |
|
108 | 108 | $this->create('settings_ajax_navigationdetect', '/settings/ajax/navigationdetect.php') |
109 | - ->actionInclude('settings/ajax/navigationdetect.php'); |
|
109 | + ->actionInclude('settings/ajax/navigationdetect.php'); |
|
110 | 110 | // admin |
111 | 111 | $this->create('settings_ajax_excludegroups', '/settings/ajax/excludegroups.php') |
112 | - ->actionInclude('settings/ajax/excludegroups.php'); |
|
112 | + ->actionInclude('settings/ajax/excludegroups.php'); |
@@ -29,31 +29,31 @@ |
||
29 | 29 | |
30 | 30 | class AppPasswords implements ISettings { |
31 | 31 | |
32 | - /** |
|
33 | - * @return TemplateResponse returns the instance with all parameters set, ready to be rendered |
|
34 | - * @since 9.1 |
|
35 | - */ |
|
36 | - public function getForm() { |
|
37 | - return new TemplateResponse('settings', 'settings/personal/app-passwords'); |
|
38 | - } |
|
32 | + /** |
|
33 | + * @return TemplateResponse returns the instance with all parameters set, ready to be rendered |
|
34 | + * @since 9.1 |
|
35 | + */ |
|
36 | + public function getForm() { |
|
37 | + return new TemplateResponse('settings', 'settings/personal/app-passwords'); |
|
38 | + } |
|
39 | 39 | |
40 | - /** |
|
41 | - * @return string the section ID, e.g. 'sharing' |
|
42 | - * @since 9.1 |
|
43 | - */ |
|
44 | - public function getSection() { |
|
45 | - return 'app-passwords'; |
|
46 | - } |
|
40 | + /** |
|
41 | + * @return string the section ID, e.g. 'sharing' |
|
42 | + * @since 9.1 |
|
43 | + */ |
|
44 | + public function getSection() { |
|
45 | + return 'app-passwords'; |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * @return int whether the form should be rather on the top or bottom of |
|
50 | - * the admin section. The forms are arranged in ascending order of the |
|
51 | - * priority values. It is required to return a value between 0 and 100. |
|
52 | - * |
|
53 | - * E.g.: 70 |
|
54 | - * @since 9.1 |
|
55 | - */ |
|
56 | - public function getPriority() { |
|
57 | - return 5; |
|
58 | - } |
|
48 | + /** |
|
49 | + * @return int whether the form should be rather on the top or bottom of |
|
50 | + * the admin section. The forms are arranged in ascending order of the |
|
51 | + * priority values. It is required to return a value between 0 and 100. |
|
52 | + * |
|
53 | + * E.g.: 70 |
|
54 | + * @since 9.1 |
|
55 | + */ |
|
56 | + public function getPriority() { |
|
57 | + return 5; |
|
58 | + } |
|
59 | 59 | } |
@@ -29,31 +29,31 @@ |
||
29 | 29 | |
30 | 30 | class Sessions implements ISettings { |
31 | 31 | |
32 | - /** |
|
33 | - * @return TemplateResponse returns the instance with all parameters set, ready to be rendered |
|
34 | - * @since 9.1 |
|
35 | - */ |
|
36 | - public function getForm() { |
|
37 | - return new TemplateResponse('settings', 'settings/personal/sessions'); |
|
38 | - } |
|
32 | + /** |
|
33 | + * @return TemplateResponse returns the instance with all parameters set, ready to be rendered |
|
34 | + * @since 9.1 |
|
35 | + */ |
|
36 | + public function getForm() { |
|
37 | + return new TemplateResponse('settings', 'settings/personal/sessions'); |
|
38 | + } |
|
39 | 39 | |
40 | - /** |
|
41 | - * @return string the section ID, e.g. 'sharing' |
|
42 | - * @since 9.1 |
|
43 | - */ |
|
44 | - public function getSection() { |
|
45 | - return 'sessions'; |
|
46 | - } |
|
40 | + /** |
|
41 | + * @return string the section ID, e.g. 'sharing' |
|
42 | + * @since 9.1 |
|
43 | + */ |
|
44 | + public function getSection() { |
|
45 | + return 'sessions'; |
|
46 | + } |
|
47 | 47 | |
48 | - /** |
|
49 | - * @return int whether the form should be rather on the top or bottom of |
|
50 | - * the admin section. The forms are arranged in ascending order of the |
|
51 | - * priority values. It is required to return a value between 0 and 100. |
|
52 | - * |
|
53 | - * E.g.: 70 |
|
54 | - * @since 9.1 |
|
55 | - */ |
|
56 | - public function getPriority() { |
|
57 | - return 10; |
|
58 | - } |
|
48 | + /** |
|
49 | + * @return int whether the form should be rather on the top or bottom of |
|
50 | + * the admin section. The forms are arranged in ascending order of the |
|
51 | + * priority values. It is required to return a value between 0 and 100. |
|
52 | + * |
|
53 | + * E.g.: 70 |
|
54 | + * @since 9.1 |
|
55 | + */ |
|
56 | + public function getPriority() { |
|
57 | + return 10; |
|
58 | + } |
|
59 | 59 | } |
@@ -30,56 +30,56 @@ |
||
30 | 30 | |
31 | 31 | class SyncClients implements ISettings { |
32 | 32 | |
33 | - /** @var IConfig */ |
|
34 | - private $config; |
|
35 | - /** @var \OC_Defaults */ |
|
36 | - private $defaults; |
|
33 | + /** @var IConfig */ |
|
34 | + private $config; |
|
35 | + /** @var \OC_Defaults */ |
|
36 | + private $defaults; |
|
37 | 37 | |
38 | - public function __construct(IConfig $config, \OC_Defaults $defaults) { |
|
39 | - $this->config = $config; |
|
40 | - $this->defaults = $defaults; |
|
41 | - } |
|
38 | + public function __construct(IConfig $config, \OC_Defaults $defaults) { |
|
39 | + $this->config = $config; |
|
40 | + $this->defaults = $defaults; |
|
41 | + } |
|
42 | 42 | |
43 | - /** |
|
44 | - * @return TemplateResponse returns the instance with all parameters set, ready to be rendered |
|
45 | - * @since 9.1 |
|
46 | - */ |
|
47 | - public function getForm() { |
|
48 | - $parameters = [ 'clients' => $this->getClientLinks() ]; |
|
49 | - return new TemplateResponse('settings', 'settings/personal/sync-clients', $parameters); |
|
50 | - } |
|
43 | + /** |
|
44 | + * @return TemplateResponse returns the instance with all parameters set, ready to be rendered |
|
45 | + * @since 9.1 |
|
46 | + */ |
|
47 | + public function getForm() { |
|
48 | + $parameters = [ 'clients' => $this->getClientLinks() ]; |
|
49 | + return new TemplateResponse('settings', 'settings/personal/sync-clients', $parameters); |
|
50 | + } |
|
51 | 51 | |
52 | - /** |
|
53 | - * @return string the section ID, e.g. 'sharing' |
|
54 | - * @since 9.1 |
|
55 | - */ |
|
56 | - public function getSection() { |
|
57 | - return 'sync-clients'; |
|
58 | - } |
|
52 | + /** |
|
53 | + * @return string the section ID, e.g. 'sharing' |
|
54 | + * @since 9.1 |
|
55 | + */ |
|
56 | + public function getSection() { |
|
57 | + return 'sync-clients'; |
|
58 | + } |
|
59 | 59 | |
60 | - /** |
|
61 | - * @return int whether the form should be rather on the top or bottom of |
|
62 | - * the admin section. The forms are arranged in ascending order of the |
|
63 | - * priority values. It is required to return a value between 0 and 100. |
|
64 | - * |
|
65 | - * E.g.: 70 |
|
66 | - * @since 9.1 |
|
67 | - */ |
|
68 | - public function getPriority() { |
|
69 | - return 20; |
|
70 | - } |
|
60 | + /** |
|
61 | + * @return int whether the form should be rather on the top or bottom of |
|
62 | + * the admin section. The forms are arranged in ascending order of the |
|
63 | + * priority values. It is required to return a value between 0 and 100. |
|
64 | + * |
|
65 | + * E.g.: 70 |
|
66 | + * @since 9.1 |
|
67 | + */ |
|
68 | + public function getPriority() { |
|
69 | + return 20; |
|
70 | + } |
|
71 | 71 | |
72 | - /** |
|
73 | - * returns an array containing links to the various clients |
|
74 | - * |
|
75 | - * @return array |
|
76 | - */ |
|
77 | - private function getClientLinks() { |
|
78 | - $clients = [ |
|
79 | - 'desktop' => $this->config->getSystemValue('customclient_desktop', $this->defaults->getSyncClientUrl()), |
|
80 | - 'android' => $this->config->getSystemValue('customclient_android', $this->defaults->getAndroidClientUrl()), |
|
81 | - 'ios' => $this->config->getSystemValue('customclient_ios', $this->defaults->getiOSClientUrl()) |
|
82 | - ]; |
|
83 | - return $clients; |
|
84 | - } |
|
72 | + /** |
|
73 | + * returns an array containing links to the various clients |
|
74 | + * |
|
75 | + * @return array |
|
76 | + */ |
|
77 | + private function getClientLinks() { |
|
78 | + $clients = [ |
|
79 | + 'desktop' => $this->config->getSystemValue('customclient_desktop', $this->defaults->getSyncClientUrl()), |
|
80 | + 'android' => $this->config->getSystemValue('customclient_android', $this->defaults->getAndroidClientUrl()), |
|
81 | + 'ios' => $this->config->getSystemValue('customclient_ios', $this->defaults->getiOSClientUrl()) |
|
82 | + ]; |
|
83 | + return $clients; |
|
84 | + } |
|
85 | 85 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | * @since 9.1 |
46 | 46 | */ |
47 | 47 | public function getForm() { |
48 | - $parameters = [ 'clients' => $this->getClientLinks() ]; |
|
48 | + $parameters = ['clients' => $this->getClientLinks()]; |
|
49 | 49 | return new TemplateResponse('settings', 'settings/personal/sync-clients', $parameters); |
50 | 50 | } |
51 | 51 |