@@ -31,63 +31,63 @@ |
||
| 31 | 31 | use OCP\Settings\ISettings; |
| 32 | 32 | |
| 33 | 33 | class Encryption implements ISettings { |
| 34 | - /** @var IManager */ |
|
| 35 | - private $manager; |
|
| 34 | + /** @var IManager */ |
|
| 35 | + private $manager; |
|
| 36 | 36 | |
| 37 | - /** @var IUserManager */ |
|
| 38 | - private $userManager; |
|
| 37 | + /** @var IUserManager */ |
|
| 38 | + private $userManager; |
|
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * @param IManager $manager |
|
| 42 | - * @param IUserManager $userManager |
|
| 43 | - */ |
|
| 44 | - public function __construct(IManager $manager, IUserManager $userManager) { |
|
| 45 | - $this->manager = $manager; |
|
| 46 | - $this->userManager = $userManager; |
|
| 47 | - } |
|
| 40 | + /** |
|
| 41 | + * @param IManager $manager |
|
| 42 | + * @param IUserManager $userManager |
|
| 43 | + */ |
|
| 44 | + public function __construct(IManager $manager, IUserManager $userManager) { |
|
| 45 | + $this->manager = $manager; |
|
| 46 | + $this->userManager = $userManager; |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | - /** |
|
| 50 | - * @return TemplateResponse |
|
| 51 | - */ |
|
| 52 | - public function getForm() { |
|
| 53 | - $encryptionModules = $this->manager->getEncryptionModules(); |
|
| 54 | - $defaultEncryptionModuleId = $this->manager->getDefaultEncryptionModuleId(); |
|
| 55 | - $encryptionModuleList = []; |
|
| 56 | - foreach ($encryptionModules as $module) { |
|
| 57 | - $encryptionModuleList[$module['id']]['displayName'] = $module['displayName']; |
|
| 58 | - $encryptionModuleList[$module['id']]['default'] = false; |
|
| 59 | - if ($module['id'] === $defaultEncryptionModuleId) { |
|
| 60 | - $encryptionModuleList[$module['id']]['default'] = true; |
|
| 61 | - } |
|
| 62 | - } |
|
| 49 | + /** |
|
| 50 | + * @return TemplateResponse |
|
| 51 | + */ |
|
| 52 | + public function getForm() { |
|
| 53 | + $encryptionModules = $this->manager->getEncryptionModules(); |
|
| 54 | + $defaultEncryptionModuleId = $this->manager->getDefaultEncryptionModuleId(); |
|
| 55 | + $encryptionModuleList = []; |
|
| 56 | + foreach ($encryptionModules as $module) { |
|
| 57 | + $encryptionModuleList[$module['id']]['displayName'] = $module['displayName']; |
|
| 58 | + $encryptionModuleList[$module['id']]['default'] = false; |
|
| 59 | + if ($module['id'] === $defaultEncryptionModuleId) { |
|
| 60 | + $encryptionModuleList[$module['id']]['default'] = true; |
|
| 61 | + } |
|
| 62 | + } |
|
| 63 | 63 | |
| 64 | - $parameters = [ |
|
| 65 | - // Encryption API |
|
| 66 | - 'encryptionEnabled' => $this->manager->isEnabled(), |
|
| 67 | - 'encryptionReady' => $this->manager->isReady(), |
|
| 68 | - 'externalBackendsEnabled' => count($this->userManager->getBackends()) > 1, |
|
| 69 | - // Modules |
|
| 70 | - 'encryptionModules' => $encryptionModuleList, |
|
| 71 | - ]; |
|
| 64 | + $parameters = [ |
|
| 65 | + // Encryption API |
|
| 66 | + 'encryptionEnabled' => $this->manager->isEnabled(), |
|
| 67 | + 'encryptionReady' => $this->manager->isReady(), |
|
| 68 | + 'externalBackendsEnabled' => count($this->userManager->getBackends()) > 1, |
|
| 69 | + // Modules |
|
| 70 | + 'encryptionModules' => $encryptionModuleList, |
|
| 71 | + ]; |
|
| 72 | 72 | |
| 73 | - return new TemplateResponse('settings', 'settings/admin/encryption', $parameters, ''); |
|
| 74 | - } |
|
| 73 | + return new TemplateResponse('settings', 'settings/admin/encryption', $parameters, ''); |
|
| 74 | + } |
|
| 75 | 75 | |
| 76 | - /** |
|
| 77 | - * @return string the section ID, e.g. 'sharing' |
|
| 78 | - */ |
|
| 79 | - public function getSection() { |
|
| 80 | - return 'security'; |
|
| 81 | - } |
|
| 76 | + /** |
|
| 77 | + * @return string the section ID, e.g. 'sharing' |
|
| 78 | + */ |
|
| 79 | + public function getSection() { |
|
| 80 | + return 'security'; |
|
| 81 | + } |
|
| 82 | 82 | |
| 83 | - /** |
|
| 84 | - * @return int whether the form should be rather on the top or bottom of |
|
| 85 | - * the admin section. The forms are arranged in ascending order of the |
|
| 86 | - * priority values. It is required to return a value between 0 and 100. |
|
| 87 | - * |
|
| 88 | - * E.g.: 70 |
|
| 89 | - */ |
|
| 90 | - public function getPriority() { |
|
| 91 | - return 10; |
|
| 92 | - } |
|
| 83 | + /** |
|
| 84 | + * @return int whether the form should be rather on the top or bottom of |
|
| 85 | + * the admin section. The forms are arranged in ascending order of the |
|
| 86 | + * priority values. It is required to return a value between 0 and 100. |
|
| 87 | + * |
|
| 88 | + * E.g.: 70 |
|
| 89 | + */ |
|
| 90 | + public function getPriority() { |
|
| 91 | + return 10; |
|
| 92 | + } |
|
| 93 | 93 | } |
@@ -49,353 +49,353 @@ |
||
| 49 | 49 | use OCP\Util; |
| 50 | 50 | |
| 51 | 51 | class Manager implements IManager { |
| 52 | - /** @var ILogger */ |
|
| 53 | - private $log; |
|
| 54 | - /** @var IDBConnection */ |
|
| 55 | - private $dbc; |
|
| 56 | - /** @var IL10N */ |
|
| 57 | - private $l; |
|
| 58 | - /** @var IConfig */ |
|
| 59 | - private $config; |
|
| 60 | - /** @var EncryptionManager */ |
|
| 61 | - private $encryptionManager; |
|
| 62 | - /** @var IUserManager */ |
|
| 63 | - private $userManager; |
|
| 64 | - /** @var ILockingProvider */ |
|
| 65 | - private $lockingProvider; |
|
| 66 | - /** @var IRequest */ |
|
| 67 | - private $request; |
|
| 68 | - /** @var IURLGenerator */ |
|
| 69 | - private $url; |
|
| 70 | - /** @var AccountManager */ |
|
| 71 | - private $accountManager; |
|
| 72 | - /** @var IGroupManager */ |
|
| 73 | - private $groupManager; |
|
| 74 | - /** @var IFactory */ |
|
| 75 | - private $l10nFactory; |
|
| 76 | - /** @var IAppManager */ |
|
| 77 | - private $appManager; |
|
| 78 | - |
|
| 79 | - /** |
|
| 80 | - * @param ILogger $log |
|
| 81 | - * @param IDBConnection $dbc |
|
| 82 | - * @param IL10N $l |
|
| 83 | - * @param IConfig $config |
|
| 84 | - * @param EncryptionManager $encryptionManager |
|
| 85 | - * @param IUserManager $userManager |
|
| 86 | - * @param ILockingProvider $lockingProvider |
|
| 87 | - * @param IRequest $request |
|
| 88 | - * @param IURLGenerator $url |
|
| 89 | - * @param AccountManager $accountManager |
|
| 90 | - * @param IGroupManager $groupManager |
|
| 91 | - * @param IFactory $l10nFactory |
|
| 92 | - * @param IAppManager $appManager |
|
| 93 | - */ |
|
| 94 | - public function __construct( |
|
| 95 | - ILogger $log, |
|
| 96 | - IDBConnection $dbc, |
|
| 97 | - IL10N $l, |
|
| 98 | - IConfig $config, |
|
| 99 | - EncryptionManager $encryptionManager, |
|
| 100 | - IUserManager $userManager, |
|
| 101 | - ILockingProvider $lockingProvider, |
|
| 102 | - IRequest $request, |
|
| 103 | - IURLGenerator $url, |
|
| 104 | - AccountManager $accountManager, |
|
| 105 | - IGroupManager $groupManager, |
|
| 106 | - IFactory $l10nFactory, |
|
| 107 | - IAppManager $appManager |
|
| 108 | - ) { |
|
| 109 | - $this->log = $log; |
|
| 110 | - $this->dbc = $dbc; |
|
| 111 | - $this->l = $l; |
|
| 112 | - $this->config = $config; |
|
| 113 | - $this->encryptionManager = $encryptionManager; |
|
| 114 | - $this->userManager = $userManager; |
|
| 115 | - $this->lockingProvider = $lockingProvider; |
|
| 116 | - $this->request = $request; |
|
| 117 | - $this->url = $url; |
|
| 118 | - $this->accountManager = $accountManager; |
|
| 119 | - $this->groupManager = $groupManager; |
|
| 120 | - $this->l10nFactory = $l10nFactory; |
|
| 121 | - $this->appManager = $appManager; |
|
| 122 | - } |
|
| 123 | - |
|
| 124 | - /** @var array */ |
|
| 125 | - protected $sectionClasses = []; |
|
| 126 | - |
|
| 127 | - /** @var array */ |
|
| 128 | - protected $sections = []; |
|
| 129 | - |
|
| 130 | - /** |
|
| 131 | - * @param string $type 'admin' or 'personal' |
|
| 132 | - * @param string $section Class must implement OCP\Settings\ISection |
|
| 133 | - * @return void |
|
| 134 | - */ |
|
| 135 | - public function registerSection(string $type, string $section) { |
|
| 136 | - $this->sectionClasses[$section] = $type; |
|
| 137 | - } |
|
| 138 | - |
|
| 139 | - /** |
|
| 140 | - * @param string $type 'admin' or 'personal' |
|
| 141 | - * @return ISection[] |
|
| 142 | - */ |
|
| 143 | - protected function getSections(string $type): array { |
|
| 144 | - if (!isset($this->sections[$type])) { |
|
| 145 | - $this->sections[$type] = []; |
|
| 146 | - } |
|
| 147 | - |
|
| 148 | - foreach ($this->sectionClasses as $class => $sectionType) { |
|
| 149 | - try { |
|
| 150 | - /** @var ISection $section */ |
|
| 151 | - $section = \OC::$server->query($class); |
|
| 152 | - } catch (QueryException $e) { |
|
| 153 | - $this->log->logException($e, ['level' => ILogger::INFO]); |
|
| 154 | - continue; |
|
| 155 | - } |
|
| 156 | - |
|
| 157 | - if (!$section instanceof ISection) { |
|
| 158 | - $this->log->logException(new \InvalidArgumentException('Invalid settings section registered'), ['level' => ILogger::INFO]); |
|
| 159 | - continue; |
|
| 160 | - } |
|
| 161 | - |
|
| 162 | - $this->sections[$sectionType][$section->getID()] = $section; |
|
| 163 | - |
|
| 164 | - unset($this->sectionClasses[$class]); |
|
| 165 | - } |
|
| 166 | - |
|
| 167 | - return $this->sections[$type]; |
|
| 168 | - } |
|
| 169 | - |
|
| 170 | - /** @var array */ |
|
| 171 | - protected $settingClasses = []; |
|
| 172 | - |
|
| 173 | - /** @var array */ |
|
| 174 | - protected $settings = []; |
|
| 175 | - |
|
| 176 | - /** |
|
| 177 | - * @param string $type 'admin' or 'personal' |
|
| 178 | - * @param string $setting Class must implement OCP\Settings\ISetting |
|
| 179 | - * @return void |
|
| 180 | - */ |
|
| 181 | - public function registerSetting(string $type, string $setting) { |
|
| 182 | - $this->settingClasses[$setting] = $type; |
|
| 183 | - } |
|
| 184 | - |
|
| 185 | - /** |
|
| 186 | - * @param string $type 'admin' or 'personal' |
|
| 187 | - * @param string $section |
|
| 188 | - * @return ISettings[] |
|
| 189 | - */ |
|
| 190 | - protected function getSettings(string $type, string $section): array { |
|
| 191 | - if (!isset($this->settings[$type])) { |
|
| 192 | - $this->settings[$type] = []; |
|
| 193 | - } |
|
| 194 | - if (!isset($this->settings[$type][$section])) { |
|
| 195 | - $this->settings[$type][$section] = []; |
|
| 196 | - } |
|
| 197 | - |
|
| 198 | - foreach ($this->settingClasses as $class => $settingsType) { |
|
| 199 | - try { |
|
| 200 | - /** @var ISettings $setting */ |
|
| 201 | - $setting = \OC::$server->query($class); |
|
| 202 | - } catch (QueryException $e) { |
|
| 203 | - $this->log->logException($e, ['level' => ILogger::INFO]); |
|
| 204 | - continue; |
|
| 205 | - } |
|
| 206 | - |
|
| 207 | - if (!$setting instanceof ISettings) { |
|
| 208 | - $this->log->logException(new \InvalidArgumentException('Invalid settings setting registered'), ['level' => ILogger::INFO]); |
|
| 209 | - continue; |
|
| 210 | - } |
|
| 211 | - |
|
| 212 | - if (!isset($this->settings[$settingsType][$setting->getSection()])) { |
|
| 213 | - $this->settings[$settingsType][$setting->getSection()] = []; |
|
| 214 | - } |
|
| 215 | - $this->settings[$settingsType][$setting->getSection()][] = $setting; |
|
| 216 | - |
|
| 217 | - unset($this->settingClasses[$class]); |
|
| 218 | - } |
|
| 219 | - |
|
| 220 | - return $this->settings[$type][$section]; |
|
| 221 | - } |
|
| 222 | - |
|
| 223 | - /** |
|
| 224 | - * @inheritdoc |
|
| 225 | - */ |
|
| 226 | - public function getAdminSections(): array { |
|
| 227 | - // built-in sections |
|
| 228 | - $sections = [ |
|
| 229 | - 0 => [new Section('overview', $this->l->t('Overview'), 0, $this->url->imagePath('settings', 'admin.svg'))], |
|
| 230 | - 1 => [new Section('server', $this->l->t('Basic settings'), 0, $this->url->imagePath('core', 'actions/settings-dark.svg'))], |
|
| 231 | - 5 => [new Section('sharing', $this->l->t('Sharing'), 0, $this->url->imagePath('core', 'actions/share.svg'))], |
|
| 232 | - 10 => [new Section('security', $this->l->t('Security'), 0, $this->url->imagePath('core', 'actions/password.svg'))], |
|
| 233 | - 50 => [new Section('groupware', $this->l->t('Groupware'), 0, $this->url->imagePath('core', 'places/contacts.svg'))], |
|
| 234 | - 98 => [new Section('additional', $this->l->t('Additional settings'), 0, $this->url->imagePath('core', 'actions/settings-dark.svg'))], |
|
| 235 | - ]; |
|
| 236 | - |
|
| 237 | - $appSections = $this->getSections('admin'); |
|
| 238 | - |
|
| 239 | - foreach ($appSections as $section) { |
|
| 240 | - /** @var ISection $section */ |
|
| 241 | - if (!isset($sections[$section->getPriority()])) { |
|
| 242 | - $sections[$section->getPriority()] = []; |
|
| 243 | - } |
|
| 244 | - |
|
| 245 | - $sections[$section->getPriority()][] = $section; |
|
| 246 | - } |
|
| 247 | - |
|
| 248 | - ksort($sections); |
|
| 249 | - |
|
| 250 | - return $sections; |
|
| 251 | - } |
|
| 252 | - |
|
| 253 | - /** |
|
| 254 | - * @param string $section |
|
| 255 | - * @return ISection[] |
|
| 256 | - */ |
|
| 257 | - private function getBuiltInAdminSettings($section): array { |
|
| 258 | - $forms = []; |
|
| 259 | - |
|
| 260 | - if ($section === 'overview') { |
|
| 261 | - /** @var ISettings $form */ |
|
| 262 | - $form = new Admin\Overview($this->config); |
|
| 263 | - $forms[$form->getPriority()] = [$form]; |
|
| 264 | - } |
|
| 265 | - if ($section === 'server') { |
|
| 266 | - /** @var ISettings $form */ |
|
| 267 | - $form = new Admin\Server($this->dbc, $this->request, $this->config, $this->lockingProvider, $this->l); |
|
| 268 | - $forms[$form->getPriority()] = [$form]; |
|
| 269 | - $form = new Admin\Mail($this->config); |
|
| 270 | - $forms[$form->getPriority()] = [$form]; |
|
| 271 | - } |
|
| 272 | - if ($section === 'security') { |
|
| 273 | - /** @var ISettings $form */ |
|
| 274 | - $form = new Admin\Encryption($this->encryptionManager, $this->userManager); |
|
| 275 | - $forms[$form->getPriority()] = [$form]; |
|
| 276 | - } |
|
| 277 | - if ($section === 'sharing') { |
|
| 278 | - /** @var ISettings $form */ |
|
| 279 | - $form = new Admin\Sharing($this->config, $this->l); |
|
| 280 | - $forms[$form->getPriority()] = [$form]; |
|
| 281 | - } |
|
| 282 | - |
|
| 283 | - return $forms; |
|
| 284 | - } |
|
| 285 | - |
|
| 286 | - /** |
|
| 287 | - * @param string $section |
|
| 288 | - * @return ISection[] |
|
| 289 | - */ |
|
| 290 | - private function getBuiltInPersonalSettings($section): array { |
|
| 291 | - $forms = []; |
|
| 292 | - |
|
| 293 | - if ($section === 'personal-info') { |
|
| 294 | - /** @var ISettings $form */ |
|
| 295 | - $form = new Personal\PersonalInfo( |
|
| 296 | - $this->config, |
|
| 297 | - $this->userManager, |
|
| 298 | - $this->groupManager, |
|
| 299 | - $this->accountManager, |
|
| 300 | - $this->appManager, |
|
| 301 | - $this->l10nFactory, |
|
| 302 | - $this->l |
|
| 303 | - ); |
|
| 304 | - $forms[$form->getPriority()] = [$form]; |
|
| 305 | - $form = new Personal\ServerDevNotice(); |
|
| 306 | - $forms[$form->getPriority()] = [$form]; |
|
| 307 | - } |
|
| 308 | - if($section === 'security') { |
|
| 309 | - /** @var ISettings $form */ |
|
| 310 | - $form = new Personal\Security($this->userManager); |
|
| 311 | - $forms[$form->getPriority()] = [$form]; |
|
| 312 | - } |
|
| 313 | - if ($section === 'additional') { |
|
| 314 | - /** @var ISettings $form */ |
|
| 315 | - $form = new Personal\Additional(); |
|
| 316 | - $forms[$form->getPriority()] = [$form]; |
|
| 317 | - } |
|
| 318 | - |
|
| 319 | - return $forms; |
|
| 320 | - } |
|
| 321 | - |
|
| 322 | - /** |
|
| 323 | - * @inheritdoc |
|
| 324 | - */ |
|
| 325 | - public function getAdminSettings($section): array { |
|
| 326 | - $settings = $this->getBuiltInAdminSettings($section); |
|
| 327 | - $appSettings = $this->getSettings('admin', $section); |
|
| 328 | - |
|
| 329 | - foreach ($appSettings as $setting) { |
|
| 330 | - if (!isset($settings[$setting->getPriority()])) { |
|
| 331 | - $settings[$setting->getPriority()] = []; |
|
| 332 | - } |
|
| 333 | - $settings[$setting->getPriority()][] = $setting; |
|
| 334 | - } |
|
| 335 | - |
|
| 336 | - ksort($settings); |
|
| 337 | - return $settings; |
|
| 338 | - } |
|
| 339 | - |
|
| 340 | - /** |
|
| 341 | - * @inheritdoc |
|
| 342 | - */ |
|
| 343 | - public function getPersonalSections(): array { |
|
| 344 | - $sections = [ |
|
| 345 | - 0 => [new Section('personal-info', $this->l->t('Personal info'), 0, $this->url->imagePath('core', 'actions/info.svg'))], |
|
| 346 | - 5 => [new Section('security', $this->l->t('Security'), 0, $this->url->imagePath('settings', 'password.svg'))], |
|
| 347 | - 15 => [new Section('sync-clients', $this->l->t('Mobile & desktop'), 0, $this->url->imagePath('core', 'clients/phone.svg'))], |
|
| 348 | - ]; |
|
| 349 | - |
|
| 350 | - $legacyForms = \OC_App::getForms('personal'); |
|
| 351 | - if(!empty($legacyForms) && $this->hasLegacyPersonalSettingsToRender($legacyForms)) { |
|
| 352 | - $sections[98] = [new Section('additional', $this->l->t('Additional settings'), 0, $this->url->imagePath('core', 'actions/settings-dark.svg'))]; |
|
| 353 | - } |
|
| 354 | - |
|
| 355 | - $appSections = $this->getSections('personal'); |
|
| 356 | - |
|
| 357 | - foreach ($appSections as $section) { |
|
| 358 | - /** @var ISection $section */ |
|
| 359 | - if (!isset($sections[$section->getPriority()])) { |
|
| 360 | - $sections[$section->getPriority()] = []; |
|
| 361 | - } |
|
| 362 | - |
|
| 363 | - $sections[$section->getPriority()][] = $section; |
|
| 364 | - } |
|
| 365 | - |
|
| 366 | - ksort($sections); |
|
| 367 | - |
|
| 368 | - return $sections; |
|
| 369 | - } |
|
| 370 | - |
|
| 371 | - /** |
|
| 372 | - * @param string[] $forms |
|
| 373 | - * @return bool |
|
| 374 | - */ |
|
| 375 | - private function hasLegacyPersonalSettingsToRender(array $forms): bool { |
|
| 376 | - foreach ($forms as $form) { |
|
| 377 | - if(trim($form) !== '') { |
|
| 378 | - return true; |
|
| 379 | - } |
|
| 380 | - } |
|
| 381 | - return false; |
|
| 382 | - } |
|
| 383 | - |
|
| 384 | - /** |
|
| 385 | - * @inheritdoc |
|
| 386 | - */ |
|
| 387 | - public function getPersonalSettings($section): array { |
|
| 388 | - $settings = $this->getBuiltInPersonalSettings($section); |
|
| 389 | - $appSettings = $this->getSettings('personal', $section); |
|
| 390 | - |
|
| 391 | - foreach ($appSettings as $setting) { |
|
| 392 | - if (!isset($settings[$setting->getPriority()])) { |
|
| 393 | - $settings[$setting->getPriority()] = []; |
|
| 394 | - } |
|
| 395 | - $settings[$setting->getPriority()][] = $setting; |
|
| 396 | - } |
|
| 397 | - |
|
| 398 | - ksort($settings); |
|
| 399 | - return $settings; |
|
| 400 | - } |
|
| 52 | + /** @var ILogger */ |
|
| 53 | + private $log; |
|
| 54 | + /** @var IDBConnection */ |
|
| 55 | + private $dbc; |
|
| 56 | + /** @var IL10N */ |
|
| 57 | + private $l; |
|
| 58 | + /** @var IConfig */ |
|
| 59 | + private $config; |
|
| 60 | + /** @var EncryptionManager */ |
|
| 61 | + private $encryptionManager; |
|
| 62 | + /** @var IUserManager */ |
|
| 63 | + private $userManager; |
|
| 64 | + /** @var ILockingProvider */ |
|
| 65 | + private $lockingProvider; |
|
| 66 | + /** @var IRequest */ |
|
| 67 | + private $request; |
|
| 68 | + /** @var IURLGenerator */ |
|
| 69 | + private $url; |
|
| 70 | + /** @var AccountManager */ |
|
| 71 | + private $accountManager; |
|
| 72 | + /** @var IGroupManager */ |
|
| 73 | + private $groupManager; |
|
| 74 | + /** @var IFactory */ |
|
| 75 | + private $l10nFactory; |
|
| 76 | + /** @var IAppManager */ |
|
| 77 | + private $appManager; |
|
| 78 | + |
|
| 79 | + /** |
|
| 80 | + * @param ILogger $log |
|
| 81 | + * @param IDBConnection $dbc |
|
| 82 | + * @param IL10N $l |
|
| 83 | + * @param IConfig $config |
|
| 84 | + * @param EncryptionManager $encryptionManager |
|
| 85 | + * @param IUserManager $userManager |
|
| 86 | + * @param ILockingProvider $lockingProvider |
|
| 87 | + * @param IRequest $request |
|
| 88 | + * @param IURLGenerator $url |
|
| 89 | + * @param AccountManager $accountManager |
|
| 90 | + * @param IGroupManager $groupManager |
|
| 91 | + * @param IFactory $l10nFactory |
|
| 92 | + * @param IAppManager $appManager |
|
| 93 | + */ |
|
| 94 | + public function __construct( |
|
| 95 | + ILogger $log, |
|
| 96 | + IDBConnection $dbc, |
|
| 97 | + IL10N $l, |
|
| 98 | + IConfig $config, |
|
| 99 | + EncryptionManager $encryptionManager, |
|
| 100 | + IUserManager $userManager, |
|
| 101 | + ILockingProvider $lockingProvider, |
|
| 102 | + IRequest $request, |
|
| 103 | + IURLGenerator $url, |
|
| 104 | + AccountManager $accountManager, |
|
| 105 | + IGroupManager $groupManager, |
|
| 106 | + IFactory $l10nFactory, |
|
| 107 | + IAppManager $appManager |
|
| 108 | + ) { |
|
| 109 | + $this->log = $log; |
|
| 110 | + $this->dbc = $dbc; |
|
| 111 | + $this->l = $l; |
|
| 112 | + $this->config = $config; |
|
| 113 | + $this->encryptionManager = $encryptionManager; |
|
| 114 | + $this->userManager = $userManager; |
|
| 115 | + $this->lockingProvider = $lockingProvider; |
|
| 116 | + $this->request = $request; |
|
| 117 | + $this->url = $url; |
|
| 118 | + $this->accountManager = $accountManager; |
|
| 119 | + $this->groupManager = $groupManager; |
|
| 120 | + $this->l10nFactory = $l10nFactory; |
|
| 121 | + $this->appManager = $appManager; |
|
| 122 | + } |
|
| 123 | + |
|
| 124 | + /** @var array */ |
|
| 125 | + protected $sectionClasses = []; |
|
| 126 | + |
|
| 127 | + /** @var array */ |
|
| 128 | + protected $sections = []; |
|
| 129 | + |
|
| 130 | + /** |
|
| 131 | + * @param string $type 'admin' or 'personal' |
|
| 132 | + * @param string $section Class must implement OCP\Settings\ISection |
|
| 133 | + * @return void |
|
| 134 | + */ |
|
| 135 | + public function registerSection(string $type, string $section) { |
|
| 136 | + $this->sectionClasses[$section] = $type; |
|
| 137 | + } |
|
| 138 | + |
|
| 139 | + /** |
|
| 140 | + * @param string $type 'admin' or 'personal' |
|
| 141 | + * @return ISection[] |
|
| 142 | + */ |
|
| 143 | + protected function getSections(string $type): array { |
|
| 144 | + if (!isset($this->sections[$type])) { |
|
| 145 | + $this->sections[$type] = []; |
|
| 146 | + } |
|
| 147 | + |
|
| 148 | + foreach ($this->sectionClasses as $class => $sectionType) { |
|
| 149 | + try { |
|
| 150 | + /** @var ISection $section */ |
|
| 151 | + $section = \OC::$server->query($class); |
|
| 152 | + } catch (QueryException $e) { |
|
| 153 | + $this->log->logException($e, ['level' => ILogger::INFO]); |
|
| 154 | + continue; |
|
| 155 | + } |
|
| 156 | + |
|
| 157 | + if (!$section instanceof ISection) { |
|
| 158 | + $this->log->logException(new \InvalidArgumentException('Invalid settings section registered'), ['level' => ILogger::INFO]); |
|
| 159 | + continue; |
|
| 160 | + } |
|
| 161 | + |
|
| 162 | + $this->sections[$sectionType][$section->getID()] = $section; |
|
| 163 | + |
|
| 164 | + unset($this->sectionClasses[$class]); |
|
| 165 | + } |
|
| 166 | + |
|
| 167 | + return $this->sections[$type]; |
|
| 168 | + } |
|
| 169 | + |
|
| 170 | + /** @var array */ |
|
| 171 | + protected $settingClasses = []; |
|
| 172 | + |
|
| 173 | + /** @var array */ |
|
| 174 | + protected $settings = []; |
|
| 175 | + |
|
| 176 | + /** |
|
| 177 | + * @param string $type 'admin' or 'personal' |
|
| 178 | + * @param string $setting Class must implement OCP\Settings\ISetting |
|
| 179 | + * @return void |
|
| 180 | + */ |
|
| 181 | + public function registerSetting(string $type, string $setting) { |
|
| 182 | + $this->settingClasses[$setting] = $type; |
|
| 183 | + } |
|
| 184 | + |
|
| 185 | + /** |
|
| 186 | + * @param string $type 'admin' or 'personal' |
|
| 187 | + * @param string $section |
|
| 188 | + * @return ISettings[] |
|
| 189 | + */ |
|
| 190 | + protected function getSettings(string $type, string $section): array { |
|
| 191 | + if (!isset($this->settings[$type])) { |
|
| 192 | + $this->settings[$type] = []; |
|
| 193 | + } |
|
| 194 | + if (!isset($this->settings[$type][$section])) { |
|
| 195 | + $this->settings[$type][$section] = []; |
|
| 196 | + } |
|
| 197 | + |
|
| 198 | + foreach ($this->settingClasses as $class => $settingsType) { |
|
| 199 | + try { |
|
| 200 | + /** @var ISettings $setting */ |
|
| 201 | + $setting = \OC::$server->query($class); |
|
| 202 | + } catch (QueryException $e) { |
|
| 203 | + $this->log->logException($e, ['level' => ILogger::INFO]); |
|
| 204 | + continue; |
|
| 205 | + } |
|
| 206 | + |
|
| 207 | + if (!$setting instanceof ISettings) { |
|
| 208 | + $this->log->logException(new \InvalidArgumentException('Invalid settings setting registered'), ['level' => ILogger::INFO]); |
|
| 209 | + continue; |
|
| 210 | + } |
|
| 211 | + |
|
| 212 | + if (!isset($this->settings[$settingsType][$setting->getSection()])) { |
|
| 213 | + $this->settings[$settingsType][$setting->getSection()] = []; |
|
| 214 | + } |
|
| 215 | + $this->settings[$settingsType][$setting->getSection()][] = $setting; |
|
| 216 | + |
|
| 217 | + unset($this->settingClasses[$class]); |
|
| 218 | + } |
|
| 219 | + |
|
| 220 | + return $this->settings[$type][$section]; |
|
| 221 | + } |
|
| 222 | + |
|
| 223 | + /** |
|
| 224 | + * @inheritdoc |
|
| 225 | + */ |
|
| 226 | + public function getAdminSections(): array { |
|
| 227 | + // built-in sections |
|
| 228 | + $sections = [ |
|
| 229 | + 0 => [new Section('overview', $this->l->t('Overview'), 0, $this->url->imagePath('settings', 'admin.svg'))], |
|
| 230 | + 1 => [new Section('server', $this->l->t('Basic settings'), 0, $this->url->imagePath('core', 'actions/settings-dark.svg'))], |
|
| 231 | + 5 => [new Section('sharing', $this->l->t('Sharing'), 0, $this->url->imagePath('core', 'actions/share.svg'))], |
|
| 232 | + 10 => [new Section('security', $this->l->t('Security'), 0, $this->url->imagePath('core', 'actions/password.svg'))], |
|
| 233 | + 50 => [new Section('groupware', $this->l->t('Groupware'), 0, $this->url->imagePath('core', 'places/contacts.svg'))], |
|
| 234 | + 98 => [new Section('additional', $this->l->t('Additional settings'), 0, $this->url->imagePath('core', 'actions/settings-dark.svg'))], |
|
| 235 | + ]; |
|
| 236 | + |
|
| 237 | + $appSections = $this->getSections('admin'); |
|
| 238 | + |
|
| 239 | + foreach ($appSections as $section) { |
|
| 240 | + /** @var ISection $section */ |
|
| 241 | + if (!isset($sections[$section->getPriority()])) { |
|
| 242 | + $sections[$section->getPriority()] = []; |
|
| 243 | + } |
|
| 244 | + |
|
| 245 | + $sections[$section->getPriority()][] = $section; |
|
| 246 | + } |
|
| 247 | + |
|
| 248 | + ksort($sections); |
|
| 249 | + |
|
| 250 | + return $sections; |
|
| 251 | + } |
|
| 252 | + |
|
| 253 | + /** |
|
| 254 | + * @param string $section |
|
| 255 | + * @return ISection[] |
|
| 256 | + */ |
|
| 257 | + private function getBuiltInAdminSettings($section): array { |
|
| 258 | + $forms = []; |
|
| 259 | + |
|
| 260 | + if ($section === 'overview') { |
|
| 261 | + /** @var ISettings $form */ |
|
| 262 | + $form = new Admin\Overview($this->config); |
|
| 263 | + $forms[$form->getPriority()] = [$form]; |
|
| 264 | + } |
|
| 265 | + if ($section === 'server') { |
|
| 266 | + /** @var ISettings $form */ |
|
| 267 | + $form = new Admin\Server($this->dbc, $this->request, $this->config, $this->lockingProvider, $this->l); |
|
| 268 | + $forms[$form->getPriority()] = [$form]; |
|
| 269 | + $form = new Admin\Mail($this->config); |
|
| 270 | + $forms[$form->getPriority()] = [$form]; |
|
| 271 | + } |
|
| 272 | + if ($section === 'security') { |
|
| 273 | + /** @var ISettings $form */ |
|
| 274 | + $form = new Admin\Encryption($this->encryptionManager, $this->userManager); |
|
| 275 | + $forms[$form->getPriority()] = [$form]; |
|
| 276 | + } |
|
| 277 | + if ($section === 'sharing') { |
|
| 278 | + /** @var ISettings $form */ |
|
| 279 | + $form = new Admin\Sharing($this->config, $this->l); |
|
| 280 | + $forms[$form->getPriority()] = [$form]; |
|
| 281 | + } |
|
| 282 | + |
|
| 283 | + return $forms; |
|
| 284 | + } |
|
| 285 | + |
|
| 286 | + /** |
|
| 287 | + * @param string $section |
|
| 288 | + * @return ISection[] |
|
| 289 | + */ |
|
| 290 | + private function getBuiltInPersonalSettings($section): array { |
|
| 291 | + $forms = []; |
|
| 292 | + |
|
| 293 | + if ($section === 'personal-info') { |
|
| 294 | + /** @var ISettings $form */ |
|
| 295 | + $form = new Personal\PersonalInfo( |
|
| 296 | + $this->config, |
|
| 297 | + $this->userManager, |
|
| 298 | + $this->groupManager, |
|
| 299 | + $this->accountManager, |
|
| 300 | + $this->appManager, |
|
| 301 | + $this->l10nFactory, |
|
| 302 | + $this->l |
|
| 303 | + ); |
|
| 304 | + $forms[$form->getPriority()] = [$form]; |
|
| 305 | + $form = new Personal\ServerDevNotice(); |
|
| 306 | + $forms[$form->getPriority()] = [$form]; |
|
| 307 | + } |
|
| 308 | + if($section === 'security') { |
|
| 309 | + /** @var ISettings $form */ |
|
| 310 | + $form = new Personal\Security($this->userManager); |
|
| 311 | + $forms[$form->getPriority()] = [$form]; |
|
| 312 | + } |
|
| 313 | + if ($section === 'additional') { |
|
| 314 | + /** @var ISettings $form */ |
|
| 315 | + $form = new Personal\Additional(); |
|
| 316 | + $forms[$form->getPriority()] = [$form]; |
|
| 317 | + } |
|
| 318 | + |
|
| 319 | + return $forms; |
|
| 320 | + } |
|
| 321 | + |
|
| 322 | + /** |
|
| 323 | + * @inheritdoc |
|
| 324 | + */ |
|
| 325 | + public function getAdminSettings($section): array { |
|
| 326 | + $settings = $this->getBuiltInAdminSettings($section); |
|
| 327 | + $appSettings = $this->getSettings('admin', $section); |
|
| 328 | + |
|
| 329 | + foreach ($appSettings as $setting) { |
|
| 330 | + if (!isset($settings[$setting->getPriority()])) { |
|
| 331 | + $settings[$setting->getPriority()] = []; |
|
| 332 | + } |
|
| 333 | + $settings[$setting->getPriority()][] = $setting; |
|
| 334 | + } |
|
| 335 | + |
|
| 336 | + ksort($settings); |
|
| 337 | + return $settings; |
|
| 338 | + } |
|
| 339 | + |
|
| 340 | + /** |
|
| 341 | + * @inheritdoc |
|
| 342 | + */ |
|
| 343 | + public function getPersonalSections(): array { |
|
| 344 | + $sections = [ |
|
| 345 | + 0 => [new Section('personal-info', $this->l->t('Personal info'), 0, $this->url->imagePath('core', 'actions/info.svg'))], |
|
| 346 | + 5 => [new Section('security', $this->l->t('Security'), 0, $this->url->imagePath('settings', 'password.svg'))], |
|
| 347 | + 15 => [new Section('sync-clients', $this->l->t('Mobile & desktop'), 0, $this->url->imagePath('core', 'clients/phone.svg'))], |
|
| 348 | + ]; |
|
| 349 | + |
|
| 350 | + $legacyForms = \OC_App::getForms('personal'); |
|
| 351 | + if(!empty($legacyForms) && $this->hasLegacyPersonalSettingsToRender($legacyForms)) { |
|
| 352 | + $sections[98] = [new Section('additional', $this->l->t('Additional settings'), 0, $this->url->imagePath('core', 'actions/settings-dark.svg'))]; |
|
| 353 | + } |
|
| 354 | + |
|
| 355 | + $appSections = $this->getSections('personal'); |
|
| 356 | + |
|
| 357 | + foreach ($appSections as $section) { |
|
| 358 | + /** @var ISection $section */ |
|
| 359 | + if (!isset($sections[$section->getPriority()])) { |
|
| 360 | + $sections[$section->getPriority()] = []; |
|
| 361 | + } |
|
| 362 | + |
|
| 363 | + $sections[$section->getPriority()][] = $section; |
|
| 364 | + } |
|
| 365 | + |
|
| 366 | + ksort($sections); |
|
| 367 | + |
|
| 368 | + return $sections; |
|
| 369 | + } |
|
| 370 | + |
|
| 371 | + /** |
|
| 372 | + * @param string[] $forms |
|
| 373 | + * @return bool |
|
| 374 | + */ |
|
| 375 | + private function hasLegacyPersonalSettingsToRender(array $forms): bool { |
|
| 376 | + foreach ($forms as $form) { |
|
| 377 | + if(trim($form) !== '') { |
|
| 378 | + return true; |
|
| 379 | + } |
|
| 380 | + } |
|
| 381 | + return false; |
|
| 382 | + } |
|
| 383 | + |
|
| 384 | + /** |
|
| 385 | + * @inheritdoc |
|
| 386 | + */ |
|
| 387 | + public function getPersonalSettings($section): array { |
|
| 388 | + $settings = $this->getBuiltInPersonalSettings($section); |
|
| 389 | + $appSettings = $this->getSettings('personal', $section); |
|
| 390 | + |
|
| 391 | + foreach ($appSettings as $setting) { |
|
| 392 | + if (!isset($settings[$setting->getPriority()])) { |
|
| 393 | + $settings[$setting->getPriority()] = []; |
|
| 394 | + } |
|
| 395 | + $settings[$setting->getPriority()][] = $setting; |
|
| 396 | + } |
|
| 397 | + |
|
| 398 | + ksort($settings); |
|
| 399 | + return $settings; |
|
| 400 | + } |
|
| 401 | 401 | } |
@@ -38,90 +38,90 @@ |
||
| 38 | 38 | |
| 39 | 39 | class Admin implements ISettings { |
| 40 | 40 | |
| 41 | - /** @var IL10N */ |
|
| 42 | - private $l; |
|
| 43 | - |
|
| 44 | - /** @var ILogger */ |
|
| 45 | - private $logger; |
|
| 46 | - |
|
| 47 | - /** @var IUserSession */ |
|
| 48 | - private $userSession; |
|
| 49 | - |
|
| 50 | - /** @var IConfig */ |
|
| 51 | - private $config; |
|
| 52 | - |
|
| 53 | - /** @var IUserManager */ |
|
| 54 | - private $userManager; |
|
| 55 | - |
|
| 56 | - /** @var ISession */ |
|
| 57 | - private $session; |
|
| 58 | - |
|
| 59 | - public function __construct( |
|
| 60 | - IL10N $l, |
|
| 61 | - ILogger $logger, |
|
| 62 | - IUserSession $userSession, |
|
| 63 | - IConfig $config, |
|
| 64 | - IUserManager $userManager, |
|
| 65 | - ISession $session |
|
| 66 | - ) { |
|
| 67 | - $this->l = $l; |
|
| 68 | - $this->logger = $logger; |
|
| 69 | - $this->userSession = $userSession; |
|
| 70 | - $this->config = $config; |
|
| 71 | - $this->userManager = $userManager; |
|
| 72 | - $this->session = $session; |
|
| 73 | - } |
|
| 74 | - |
|
| 75 | - /** |
|
| 76 | - * @return TemplateResponse |
|
| 77 | - */ |
|
| 78 | - public function getForm() { |
|
| 79 | - $crypt = new Crypt( |
|
| 80 | - $this->logger, |
|
| 81 | - $this->userSession, |
|
| 82 | - $this->config, |
|
| 83 | - $this->l); |
|
| 84 | - |
|
| 85 | - $util = new Util( |
|
| 86 | - new View(), |
|
| 87 | - $crypt, |
|
| 88 | - $this->logger, |
|
| 89 | - $this->userSession, |
|
| 90 | - $this->config, |
|
| 91 | - $this->userManager); |
|
| 92 | - |
|
| 93 | - // Check if an adminRecovery account is enabled for recovering files after lost pwd |
|
| 94 | - $recoveryAdminEnabled = $this->config->getAppValue('encryption', 'recoveryAdminEnabled', '0'); |
|
| 95 | - $session = new Session($this->session); |
|
| 96 | - |
|
| 97 | - $encryptHomeStorage = $util->shouldEncryptHomeStorage(); |
|
| 98 | - |
|
| 99 | - $parameters = [ |
|
| 100 | - 'recoveryEnabled' => $recoveryAdminEnabled, |
|
| 101 | - 'initStatus' => $session->getStatus(), |
|
| 102 | - 'encryptHomeStorage' => $encryptHomeStorage, |
|
| 103 | - 'masterKeyEnabled' => $util->isMasterKeyEnabled(), |
|
| 104 | - ]; |
|
| 105 | - |
|
| 106 | - return new TemplateResponse('encryption', 'settings-admin', $parameters, ''); |
|
| 107 | - } |
|
| 108 | - |
|
| 109 | - /** |
|
| 110 | - * @return string the section ID, e.g. 'sharing' |
|
| 111 | - */ |
|
| 112 | - public function getSection() { |
|
| 113 | - return 'security'; |
|
| 114 | - } |
|
| 115 | - |
|
| 116 | - /** |
|
| 117 | - * @return int whether the form should be rather on the top or bottom of |
|
| 118 | - * the admin section. The forms are arranged in ascending order of the |
|
| 119 | - * priority values. It is required to return a value between 0 and 100. |
|
| 120 | - * |
|
| 121 | - * E.g.: 70 |
|
| 122 | - */ |
|
| 123 | - public function getPriority() { |
|
| 124 | - return 11; |
|
| 125 | - } |
|
| 41 | + /** @var IL10N */ |
|
| 42 | + private $l; |
|
| 43 | + |
|
| 44 | + /** @var ILogger */ |
|
| 45 | + private $logger; |
|
| 46 | + |
|
| 47 | + /** @var IUserSession */ |
|
| 48 | + private $userSession; |
|
| 49 | + |
|
| 50 | + /** @var IConfig */ |
|
| 51 | + private $config; |
|
| 52 | + |
|
| 53 | + /** @var IUserManager */ |
|
| 54 | + private $userManager; |
|
| 55 | + |
|
| 56 | + /** @var ISession */ |
|
| 57 | + private $session; |
|
| 58 | + |
|
| 59 | + public function __construct( |
|
| 60 | + IL10N $l, |
|
| 61 | + ILogger $logger, |
|
| 62 | + IUserSession $userSession, |
|
| 63 | + IConfig $config, |
|
| 64 | + IUserManager $userManager, |
|
| 65 | + ISession $session |
|
| 66 | + ) { |
|
| 67 | + $this->l = $l; |
|
| 68 | + $this->logger = $logger; |
|
| 69 | + $this->userSession = $userSession; |
|
| 70 | + $this->config = $config; |
|
| 71 | + $this->userManager = $userManager; |
|
| 72 | + $this->session = $session; |
|
| 73 | + } |
|
| 74 | + |
|
| 75 | + /** |
|
| 76 | + * @return TemplateResponse |
|
| 77 | + */ |
|
| 78 | + public function getForm() { |
|
| 79 | + $crypt = new Crypt( |
|
| 80 | + $this->logger, |
|
| 81 | + $this->userSession, |
|
| 82 | + $this->config, |
|
| 83 | + $this->l); |
|
| 84 | + |
|
| 85 | + $util = new Util( |
|
| 86 | + new View(), |
|
| 87 | + $crypt, |
|
| 88 | + $this->logger, |
|
| 89 | + $this->userSession, |
|
| 90 | + $this->config, |
|
| 91 | + $this->userManager); |
|
| 92 | + |
|
| 93 | + // Check if an adminRecovery account is enabled for recovering files after lost pwd |
|
| 94 | + $recoveryAdminEnabled = $this->config->getAppValue('encryption', 'recoveryAdminEnabled', '0'); |
|
| 95 | + $session = new Session($this->session); |
|
| 96 | + |
|
| 97 | + $encryptHomeStorage = $util->shouldEncryptHomeStorage(); |
|
| 98 | + |
|
| 99 | + $parameters = [ |
|
| 100 | + 'recoveryEnabled' => $recoveryAdminEnabled, |
|
| 101 | + 'initStatus' => $session->getStatus(), |
|
| 102 | + 'encryptHomeStorage' => $encryptHomeStorage, |
|
| 103 | + 'masterKeyEnabled' => $util->isMasterKeyEnabled(), |
|
| 104 | + ]; |
|
| 105 | + |
|
| 106 | + return new TemplateResponse('encryption', 'settings-admin', $parameters, ''); |
|
| 107 | + } |
|
| 108 | + |
|
| 109 | + /** |
|
| 110 | + * @return string the section ID, e.g. 'sharing' |
|
| 111 | + */ |
|
| 112 | + public function getSection() { |
|
| 113 | + return 'security'; |
|
| 114 | + } |
|
| 115 | + |
|
| 116 | + /** |
|
| 117 | + * @return int whether the form should be rather on the top or bottom of |
|
| 118 | + * the admin section. The forms are arranged in ascending order of the |
|
| 119 | + * priority values. It is required to return a value between 0 and 100. |
|
| 120 | + * |
|
| 121 | + * E.g.: 70 |
|
| 122 | + */ |
|
| 123 | + public function getPriority() { |
|
| 124 | + return 11; |
|
| 125 | + } |
|
| 126 | 126 | |
| 127 | 127 | } |
@@ -93,7 +93,7 @@ |
||
| 93 | 93 | <h2><?php p($l->t('No external storage configured or you don\'t have the permission to configure them')); ?></h2> |
| 94 | 94 | </div> |
| 95 | 95 | |
| 96 | -<form data-can-create="<?php echo $canCreateMounts?'true':'false' ?>" id="files_external" class="section" data-encryption-enabled="<?php echo $_['encryptionEnabled']?'true': 'false'; ?>"> |
|
| 96 | +<form data-can-create="<?php echo $canCreateMounts ? 'true' : 'false' ?>" id="files_external" class="section" data-encryption-enabled="<?php echo $_['encryptionEnabled'] ? 'true' : 'false'; ?>"> |
|
| 97 | 97 | <h2 data-anchor-name="external-storage"><?php p($l->t('External storages')); ?></h2> |
| 98 | 98 | <p class="settings-hint"><?php p($l->t('External storage enables you to mount external storage services and devices as secondary Nextcloud storage devices. You may also allow users to mount their own external storage services.')); ?></p> |
| 99 | 99 | <?php if (isset($_['dependencies']) and ($_['dependencies'] !== '') and $canCreateMounts) print_unescaped(''.$_['dependencies'].''); ?> |
@@ -96,7 +96,10 @@ discard block |
||
| 96 | 96 | <form data-can-create="<?php echo $canCreateMounts?'true':'false' ?>" id="files_external" class="section" data-encryption-enabled="<?php echo $_['encryptionEnabled']?'true': 'false'; ?>"> |
| 97 | 97 | <h2 data-anchor-name="external-storage"><?php p($l->t('External storages')); ?></h2> |
| 98 | 98 | <p class="settings-hint"><?php p($l->t('External storage enables you to mount external storage services and devices as secondary Nextcloud storage devices. You may also allow users to mount their own external storage services.')); ?></p> |
| 99 | - <?php if (isset($_['dependencies']) and ($_['dependencies'] !== '') and $canCreateMounts) print_unescaped(''.$_['dependencies'].''); ?> |
|
| 99 | + <?php if (isset($_['dependencies']) and ($_['dependencies'] !== '') and $canCreateMounts) { |
|
| 100 | + print_unescaped(''.$_['dependencies'].''); |
|
| 101 | +} |
|
| 102 | +?> |
|
| 100 | 103 | <table id="externalStorage" class="grid" data-admin='<?php print_unescaped(json_encode($_['visibilityType'] === BackendService::VISIBILITY_ADMIN)); ?>'> |
| 101 | 104 | <thead> |
| 102 | 105 | <tr> |
@@ -105,7 +108,10 @@ discard block |
||
| 105 | 108 | <th><?php p($l->t('External storage')); ?></th> |
| 106 | 109 | <th><?php p($l->t('Authentication')); ?></th> |
| 107 | 110 | <th><?php p($l->t('Configuration')); ?></th> |
| 108 | - <?php if ($_['visibilityType'] === BackendService::VISIBILITY_ADMIN) print_unescaped('<th>'.$l->t('Available for').'</th>'); ?> |
|
| 111 | + <?php if ($_['visibilityType'] === BackendService::VISIBILITY_ADMIN) { |
|
| 112 | + print_unescaped('<th>'.$l->t('Available for').'</th>'); |
|
| 113 | +} |
|
| 114 | +?> |
|
| 109 | 115 | <th> </th> |
| 110 | 116 | <th> </th> |
| 111 | 117 | <th> </th> |
@@ -138,7 +144,10 @@ discard block |
||
| 138 | 144 | }); |
| 139 | 145 | ?> |
| 140 | 146 | <?php foreach ($sortedBackends as $backend): ?> |
| 141 | - <?php if ($backend->getDeprecateTo()) continue; // ignore deprecated backends ?> |
|
| 147 | + <?php if ($backend->getDeprecateTo()) { |
|
| 148 | + continue; |
|
| 149 | +} |
|
| 150 | +// ignore deprecated backends ?> |
|
| 142 | 151 | <option value="<?php p($backend->getIdentifier()); ?>"><?php p($backend->getText()); ?></option> |
| 143 | 152 | <?php endforeach; ?> |
| 144 | 153 | </select> |
@@ -163,7 +172,10 @@ discard block |
||
| 163 | 172 | |
| 164 | 173 | <?php if ($_['visibilityType'] === BackendService::VISIBILITY_ADMIN): ?> |
| 165 | 174 | <input type="checkbox" name="allowUserMounting" id="allowUserMounting" class="checkbox" |
| 166 | - value="1" <?php if ($_['allowUserMounting']) print_unescaped(' checked="checked"'); ?> /> |
|
| 175 | + value="1" <?php if ($_['allowUserMounting']) { |
|
| 176 | + print_unescaped(' checked="checked"'); |
|
| 177 | +} |
|
| 178 | +?> /> |
|
| 167 | 179 | <label for="allowUserMounting"><?php p($l->t('Allow users to mount external storage')); ?></label> <span id="userMountingMsg" class="msg"></span> |
| 168 | 180 | |
| 169 | 181 | <p id="userMountingBackends"<?php if (!$_['allowUserMounting']): ?> class="hidden"<?php endif; ?>> |
@@ -175,8 +187,14 @@ discard block |
||
| 175 | 187 | <?php $i = 0; foreach ($userBackends as $backend): ?> |
| 176 | 188 | <?php if ($deprecateTo = $backend->getDeprecateTo()): ?> |
| 177 | 189 | <input type="hidden" id="allowUserMountingBackends<?php p($i); ?>" name="allowUserMountingBackends[]" value="<?php p($backend->getIdentifier()); ?>" data-deprecate-to="<?php p($deprecateTo->getIdentifier()); ?>" /> |
| 178 | - <?php else: ?> |
|
| 179 | - <input type="checkbox" id="allowUserMountingBackends<?php p($i); ?>" class="checkbox" name="allowUserMountingBackends[]" value="<?php p($backend->getIdentifier()); ?>" <?php if ($backend->isVisibleFor(BackendService::VISIBILITY_PERSONAL)) print_unescaped(' checked="checked"'); ?> /> |
|
| 190 | + <?php else { |
|
| 191 | + : ?> |
|
| 192 | + <input type="checkbox" id="allowUserMountingBackends<?php p($i); |
|
| 193 | +} |
|
| 194 | +?>" class="checkbox" name="allowUserMountingBackends[]" value="<?php p($backend->getIdentifier()); ?>" <?php if ($backend->isVisibleFor(BackendService::VISIBILITY_PERSONAL)) { |
|
| 195 | + print_unescaped(' checked="checked"'); |
|
| 196 | +} |
|
| 197 | +?> /> |
|
| 180 | 198 | <label for="allowUserMountingBackends<?php p($i); ?>"><?php p($backend->getText()); ?></label> <br /> |
| 181 | 199 | <?php endif; ?> |
| 182 | 200 | <?php $i++; ?> |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | </div> |
| 70 | 70 | </div> |
| 71 | 71 | <span class="icon-checkmark hidden"></span> |
| 72 | - <?php if($_['lookupServerUploadEnabled']) { ?> |
|
| 72 | + <?php if ($_['lookupServerUploadEnabled']) { ?> |
|
| 73 | 73 | <input type="hidden" id="avatarscope" value="<?php p($_['avatarScope']) ?>"> |
| 74 | 74 | <?php } ?> |
| 75 | 75 | </form> |
@@ -87,14 +87,14 @@ discard block |
||
| 87 | 87 | <p class="quotatext"> |
| 88 | 88 | <?php if ($_['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED): ?> |
| 89 | 89 | <?php print_unescaped($l->t('You are using <strong>%s</strong>', |
| 90 | - [$_['usage']]));?> |
|
| 90 | + [$_['usage']])); ?> |
|
| 91 | 91 | <?php else: ?> |
| 92 | 92 | <?php print_unescaped($l->t('You are using <strong>%s</strong> of <strong>%s</strong> (<strong>%s %%</strong>)', |
| 93 | - [$_['usage'], $_['total_space'], $_['usage_relative']]));?> |
|
| 93 | + [$_['usage'], $_['total_space'], $_['usage_relative']])); ?> |
|
| 94 | 94 | <?php endif ?> |
| 95 | 95 | </p> |
| 96 | 96 | </div> |
| 97 | - <progress value="<?php p($_['usage_relative']); ?>" max="100"<?php if($_['usage_relative'] > 80): ?> class="warn" <?php endif; ?>></progress> |
|
| 97 | + <progress value="<?php p($_['usage_relative']); ?>" max="100"<?php if ($_['usage_relative'] > 80): ?> class="warn" <?php endif; ?>></progress> |
|
| 98 | 98 | </div> |
| 99 | 99 | </div> |
| 100 | 100 | </div> |
@@ -111,15 +111,15 @@ discard block |
||
| 111 | 111 | </div> |
| 112 | 112 | </h2> |
| 113 | 113 | <input type="text" id="displayname" name="displayname" |
| 114 | - <?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?> |
|
| 114 | + <?php if (!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?> |
|
| 115 | 115 | value="<?php p($_['displayName']) ?>" |
| 116 | 116 | autocomplete="on" autocapitalize="none" autocorrect="off" /> |
| 117 | - <?php if(!$_['displayNameChangeSupported']) { ?> |
|
| 118 | - <span><?php if(isset($_['displayName']) && !empty($_['displayName'])) { p($_['displayName']); } else { p($l->t('No display name set')); } ?></span> |
|
| 117 | + <?php if (!$_['displayNameChangeSupported']) { ?> |
|
| 118 | + <span><?php if (isset($_['displayName']) && !empty($_['displayName'])) { p($_['displayName']); } else { p($l->t('No display name set')); } ?></span> |
|
| 119 | 119 | <?php } ?> |
| 120 | 120 | <span class="icon-checkmark hidden"></span> |
| 121 | 121 | <span class="icon-error hidden" ></span> |
| 122 | - <?php if($_['lookupServerUploadEnabled']) { ?> |
|
| 122 | + <?php if ($_['lookupServerUploadEnabled']) { ?> |
|
| 123 | 123 | <input type="hidden" id="displaynamescope" value="<?php p($_['displayNameScope']) ?>"> |
| 124 | 124 | <?php } ?> |
| 125 | 125 | </form> |
@@ -134,10 +134,10 @@ discard block |
||
| 134 | 134 | </span> |
| 135 | 135 | </div> |
| 136 | 136 | </h2> |
| 137 | - <div class="verify <?php if ($_['email'] === '' || $_['emailScope'] !== 'public') p('hidden'); ?>"> |
|
| 137 | + <div class="verify <?php if ($_['email'] === '' || $_['emailScope'] !== 'public') p('hidden'); ?>"> |
|
| 138 | 138 | <img id="verify-email" title="<?php p($_['emailMessage']); ?>" data-status="<?php p($_['emailVerification']) ?>" src=" |
| 139 | 139 | <?php |
| 140 | - switch($_['emailVerification']) { |
|
| 140 | + switch ($_['emailVerification']) { |
|
| 141 | 141 | case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS: |
| 142 | 142 | p(image_path('core', 'actions/verifying.svg')); |
| 143 | 143 | break; |
@@ -150,18 +150,18 @@ discard block |
||
| 150 | 150 | ?>"> |
| 151 | 151 | </div> |
| 152 | 152 | <input type="email" name="email" id="email" value="<?php p($_['email']); ?>" |
| 153 | - <?php if(!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?> |
|
| 153 | + <?php if (!$_['displayNameChangeSupported']) { print_unescaped('class="hidden"'); } ?> |
|
| 154 | 154 | placeholder="<?php p($l->t('Your email address')); ?>" |
| 155 | 155 | autocomplete="on" autocapitalize="none" autocorrect="off" /> |
| 156 | 156 | <span class="icon-checkmark hidden"></span> |
| 157 | 157 | <span class="icon-error hidden" ></span> |
| 158 | - <?php if(!$_['displayNameChangeSupported']) { ?> |
|
| 159 | - <span><?php if(isset($_['email']) && !empty($_['email'])) { p($_['email']); } else { p($l->t('No email address set')); }?></span> |
|
| 158 | + <?php if (!$_['displayNameChangeSupported']) { ?> |
|
| 159 | + <span><?php if (isset($_['email']) && !empty($_['email'])) { p($_['email']); } else { p($l->t('No email address set')); }?></span> |
|
| 160 | 160 | <?php } ?> |
| 161 | - <?php if($_['displayNameChangeSupported']) { ?> |
|
| 161 | + <?php if ($_['displayNameChangeSupported']) { ?> |
|
| 162 | 162 | <em><?php p($l->t('For password reset and notifications')); ?></em> |
| 163 | 163 | <?php } ?> |
| 164 | - <?php if($_['lookupServerUploadEnabled']) { ?> |
|
| 164 | + <?php if ($_['lookupServerUploadEnabled']) { ?> |
|
| 165 | 165 | <input type="hidden" id="emailscope" value="<?php p($_['emailScope']) ?>"> |
| 166 | 166 | <?php } ?> |
| 167 | 167 | </form> |
@@ -177,12 +177,12 @@ discard block |
||
| 177 | 177 | </span> |
| 178 | 178 | </div> |
| 179 | 179 | </h2> |
| 180 | - <input type="tel" id="phone" name="phone" <?php if(!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?> |
|
| 180 | + <input type="tel" id="phone" name="phone" <?php if (!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?> |
|
| 181 | 181 | value="<?php p($_['phone']) ?>" |
| 182 | 182 | placeholder="<?php p($l->t('Your phone number')); ?>" |
| 183 | 183 | autocomplete="on" autocapitalize="none" autocorrect="off" /> |
| 184 | 184 | <span class="icon-checkmark hidden"></span> |
| 185 | - <?php if($_['lookupServerUploadEnabled']) { ?> |
|
| 185 | + <?php if ($_['lookupServerUploadEnabled']) { ?> |
|
| 186 | 186 | <input type="hidden" id="phonescope" value="<?php p($_['phoneScope']) ?>"> |
| 187 | 187 | <?php } ?> |
| 188 | 188 | </form> |
@@ -199,12 +199,12 @@ discard block |
||
| 199 | 199 | </span> |
| 200 | 200 | </div> |
| 201 | 201 | </h2> |
| 202 | - <input type="text" id="address" name="address" <?php if(!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?> |
|
| 202 | + <input type="text" id="address" name="address" <?php if (!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?> |
|
| 203 | 203 | placeholder="<?php p($l->t('Your postal address')); ?>" |
| 204 | 204 | value="<?php p($_['address']) ?>" |
| 205 | 205 | autocomplete="on" autocapitalize="none" autocorrect="off" /> |
| 206 | 206 | <span class="icon-checkmark hidden"></span> |
| 207 | - <?php if($_['lookupServerUploadEnabled']) { ?> |
|
| 207 | + <?php if ($_['lookupServerUploadEnabled']) { ?> |
|
| 208 | 208 | <input type="hidden" id="addressscope" value="<?php p($_['addressScope']) ?>"> |
| 209 | 209 | <?php } ?> |
| 210 | 210 | </form> |
@@ -221,11 +221,11 @@ discard block |
||
| 221 | 221 | </span> |
| 222 | 222 | </div> |
| 223 | 223 | </h2> |
| 224 | - <?php if($_['lookupServerUploadEnabled']) { ?> |
|
| 225 | - <div class="verify <?php if ($_['website'] === '' || $_['websiteScope'] !== 'public') p('hidden'); ?>"> |
|
| 224 | + <?php if ($_['lookupServerUploadEnabled']) { ?> |
|
| 225 | + <div class="verify <?php if ($_['website'] === '' || $_['websiteScope'] !== 'public') p('hidden'); ?>"> |
|
| 226 | 226 | <img id="verify-website" title="<?php p($_['websiteMessage']); ?>" data-status="<?php p($_['websiteVerification']) ?>" src=" |
| 227 | 227 | <?php |
| 228 | - switch($_['websiteVerification']) { |
|
| 228 | + switch ($_['websiteVerification']) { |
|
| 229 | 229 | case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS: |
| 230 | 230 | p(image_path('core', 'actions/verifying.svg')); |
| 231 | 231 | break; |
@@ -236,13 +236,13 @@ discard block |
||
| 236 | 236 | p(image_path('core', 'actions/verify.svg')); |
| 237 | 237 | } |
| 238 | 238 | ?>" |
| 239 | - <?php if($_['websiteVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['websiteVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?> |
|
| 239 | + <?php if ($_['websiteVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['websiteVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?> |
|
| 240 | 240 | > |
| 241 | 241 | <div class="verification-dialog popovermenu bubble menu"> |
| 242 | 242 | <div class="verification-dialog-content"> |
| 243 | 243 | <p class="explainVerification"></p> |
| 244 | 244 | <p class="verificationCode"></p> |
| 245 | - <p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.'));?></p> |
|
| 245 | + <p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.')); ?></p> |
|
| 246 | 246 | </div> |
| 247 | 247 | </div> |
| 248 | 248 | </div> |
@@ -250,10 +250,10 @@ discard block |
||
| 250 | 250 | <input type="url" name="website" id="website" value="<?php p($_['website']); ?>" |
| 251 | 251 | placeholder="<?php p($l->t('Link https://…')); ?>" |
| 252 | 252 | autocomplete="on" autocapitalize="none" autocorrect="off" |
| 253 | - <?php if(!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?> |
|
| 253 | + <?php if (!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?> |
|
| 254 | 254 | /> |
| 255 | 255 | <span class="icon-checkmark hidden"></span> |
| 256 | - <?php if($_['lookupServerUploadEnabled']) { ?> |
|
| 256 | + <?php if ($_['lookupServerUploadEnabled']) { ?> |
|
| 257 | 257 | <input type="hidden" id="websitescope" value="<?php p($_['websiteScope']) ?>"> |
| 258 | 258 | <?php } ?> |
| 259 | 259 | </form> |
@@ -270,11 +270,11 @@ discard block |
||
| 270 | 270 | </span> |
| 271 | 271 | </div> |
| 272 | 272 | </h2> |
| 273 | - <?php if($_['lookupServerUploadEnabled']) { ?> |
|
| 274 | - <div class="verify <?php if ($_['twitter'] === '' || $_['twitterScope'] !== 'public') p('hidden'); ?>"> |
|
| 273 | + <?php if ($_['lookupServerUploadEnabled']) { ?> |
|
| 274 | + <div class="verify <?php if ($_['twitter'] === '' || $_['twitterScope'] !== 'public') p('hidden'); ?>"> |
|
| 275 | 275 | <img id="verify-twitter" title="<?php p($_['twitterMessage']); ?>" data-status="<?php p($_['twitterVerification']) ?>" src=" |
| 276 | 276 | <?php |
| 277 | - switch($_['twitterVerification']) { |
|
| 277 | + switch ($_['twitterVerification']) { |
|
| 278 | 278 | case \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS: |
| 279 | 279 | p(image_path('core', 'actions/verifying.svg')); |
| 280 | 280 | break; |
@@ -285,13 +285,13 @@ discard block |
||
| 285 | 285 | p(image_path('core', 'actions/verify.svg')); |
| 286 | 286 | } |
| 287 | 287 | ?>" |
| 288 | - <?php if($_['twitterVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['twitterVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?> |
|
| 288 | + <?php if ($_['twitterVerification'] === \OC\Accounts\AccountManager::VERIFICATION_IN_PROGRESS || $_['twitterVerification'] === \OC\Accounts\AccountManager::NOT_VERIFIED) print_unescaped(' class="verify-action"') ?> |
|
| 289 | 289 | > |
| 290 | 290 | <div class="verification-dialog popovermenu bubble menu"> |
| 291 | 291 | <div class="verification-dialog-content"> |
| 292 | 292 | <p class="explainVerification"></p> |
| 293 | 293 | <p class="verificationCode"></p> |
| 294 | - <p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.'));?></p> |
|
| 294 | + <p><?php p($l->t('It can take up to 24 hours before the account is displayed as verified.')); ?></p> |
|
| 295 | 295 | </div> |
| 296 | 296 | </div> |
| 297 | 297 | </div> |
@@ -299,10 +299,10 @@ discard block |
||
| 299 | 299 | <input type="text" name="twitter" id="twitter" value="<?php p($_['twitter']); ?>" |
| 300 | 300 | placeholder="<?php p($l->t('Twitter handle @…')); ?>" |
| 301 | 301 | autocomplete="on" autocapitalize="none" autocorrect="off" |
| 302 | - <?php if(!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?> |
|
| 302 | + <?php if (!$_['lookupServerUploadEnabled']) print_unescaped('disabled="1"'); ?> |
|
| 303 | 303 | /> |
| 304 | 304 | <span class="icon-checkmark hidden"></span> |
| 305 | - <?php if($_['lookupServerUploadEnabled']) { ?> |
|
| 305 | + <?php if ($_['lookupServerUploadEnabled']) { ?> |
|
| 306 | 306 | <input type="hidden" id="twitterscope" value="<?php p($_['twitterScope']) ?>"> |
| 307 | 307 | <?php } ?> |
| 308 | 308 | </form> |
@@ -315,27 +315,27 @@ discard block |
||
| 315 | 315 | <?php if (isset($_['activelanguage'])) { ?> |
| 316 | 316 | <form id="language" class="section"> |
| 317 | 317 | <h2> |
| 318 | - <label for="languageinput"><?php p($l->t('Language'));?></label> |
|
| 318 | + <label for="languageinput"><?php p($l->t('Language')); ?></label> |
|
| 319 | 319 | </h2> |
| 320 | - <select id="languageinput" name="lang" data-placeholder="<?php p($l->t('Language'));?>"> |
|
| 321 | - <option value="<?php p($_['activelanguage']['code']);?>"> |
|
| 322 | - <?php p($_['activelanguage']['name']);?> |
|
| 320 | + <select id="languageinput" name="lang" data-placeholder="<?php p($l->t('Language')); ?>"> |
|
| 321 | + <option value="<?php p($_['activelanguage']['code']); ?>"> |
|
| 322 | + <?php p($_['activelanguage']['name']); ?> |
|
| 323 | 323 | </option> |
| 324 | - <?php foreach($_['commonlanguages'] as $language):?> |
|
| 325 | - <option value="<?php p($language['code']);?>"> |
|
| 326 | - <?php p($language['name']);?> |
|
| 324 | + <?php foreach ($_['commonlanguages'] as $language):?> |
|
| 325 | + <option value="<?php p($language['code']); ?>"> |
|
| 326 | + <?php p($language['name']); ?> |
|
| 327 | 327 | </option> |
| 328 | - <?php endforeach;?> |
|
| 328 | + <?php endforeach; ?> |
|
| 329 | 329 | <optgroup label="––––––––––"></optgroup> |
| 330 | - <?php foreach($_['languages'] as $language):?> |
|
| 331 | - <option value="<?php p($language['code']);?>"> |
|
| 332 | - <?php p($language['name']);?> |
|
| 330 | + <?php foreach ($_['languages'] as $language):?> |
|
| 331 | + <option value="<?php p($language['code']); ?>"> |
|
| 332 | + <?php p($language['name']); ?> |
|
| 333 | 333 | </option> |
| 334 | - <?php endforeach;?> |
|
| 334 | + <?php endforeach; ?> |
|
| 335 | 335 | </select> |
| 336 | 336 | <a href="https://www.transifex.com/nextcloud/nextcloud/" |
| 337 | 337 | target="_blank" rel="noreferrer noopener"> |
| 338 | - <em><?php p($l->t('Help translate'));?></em> |
|
| 338 | + <em><?php p($l->t('Help translate')); ?></em> |
|
| 339 | 339 | </a> |
| 340 | 340 | </form> |
| 341 | 341 | <?php } ?> |
@@ -344,27 +344,27 @@ discard block |
||
| 344 | 344 | <?php if (isset($_['activelocale'])) { ?> |
| 345 | 345 | <form id="locale" class="section"> |
| 346 | 346 | <h2> |
| 347 | - <label for="localeinput"><?php p($l->t('Locale'));?></label> |
|
| 347 | + <label for="localeinput"><?php p($l->t('Locale')); ?></label> |
|
| 348 | 348 | </h2> |
| 349 | - <select id="localeinput" name="lang" data-placeholder="<?php p($l->t('Locale'));?>"> |
|
| 350 | - <option value="<?php p($_['activelocale']['code']);?>"> |
|
| 351 | - <?php p($_['activelocale']['name']);?> |
|
| 349 | + <select id="localeinput" name="lang" data-placeholder="<?php p($l->t('Locale')); ?>"> |
|
| 350 | + <option value="<?php p($_['activelocale']['code']); ?>"> |
|
| 351 | + <?php p($_['activelocale']['name']); ?> |
|
| 352 | 352 | </option> |
| 353 | 353 | <optgroup label="––––––––––"></optgroup> |
| 354 | - <?php foreach($_['localesForLanguage'] as $locale):?> |
|
| 355 | - <option value="<?php p($locale['code']);?>"> |
|
| 356 | - <?php p($locale['name']);?> |
|
| 354 | + <?php foreach ($_['localesForLanguage'] as $locale):?> |
|
| 355 | + <option value="<?php p($locale['code']); ?>"> |
|
| 356 | + <?php p($locale['name']); ?> |
|
| 357 | 357 | </option> |
| 358 | - <?php endforeach;?> |
|
| 358 | + <?php endforeach; ?> |
|
| 359 | 359 | <optgroup label="––––––––––"></optgroup> |
| 360 | - <option value="<?php p($_['activelocale']['code']);?>"> |
|
| 361 | - <?php p($_['activelocale']['name']);?> |
|
| 360 | + <option value="<?php p($_['activelocale']['code']); ?>"> |
|
| 361 | + <?php p($_['activelocale']['name']); ?> |
|
| 362 | 362 | </option> |
| 363 | - <?php foreach($_['locales'] as $locale):?> |
|
| 364 | - <option value="<?php p($locale['code']);?>"> |
|
| 365 | - <?php p($locale['name']);?> |
|
| 363 | + <?php foreach ($_['locales'] as $locale):?> |
|
| 364 | + <option value="<?php p($locale['code']); ?>"> |
|
| 365 | + <?php p($locale['name']); ?> |
|
| 366 | 366 | </option> |
| 367 | - <?php endforeach;?> |
|
| 367 | + <?php endforeach; ?> |
|
| 368 | 368 | </select> |
| 369 | 369 | <div id="localeexample" class="personal-info icon-timezone"> |
| 370 | 370 | <p> |