ksort($commonLanguages); // sort now by displayed language not the iso-code usort($languages, function ($a, $b) { if ($a['code'] === $a['name'] && $b['code'] !== $b['name']) { // If a doesn't have a name, but b does, list b before a return 1; } if ($a['code'] !== $a['name'] && $b['code'] === $b['name']) { // If a does have a name, but b doesn't, list a before b return -1; } // Otherwise compare the names return strcmp($a['name'], $b['name']); }); //links to clients $clients = array('desktop' => $config->getSystemValue('customclient_desktop', $defaults->getSyncClientUrl()), 'android' => $config->getSystemValue('customclient_android', $defaults->getAndroidClientUrl()), 'ios' => $config->getSystemValue('customclient_ios', $defaults->getiOSClientUrl())); // only show root certificate import if external storages are enabled $enableCertImport = false; $externalStorageEnabled = \OC::$server->getAppManager()->isEnabledForUser('files_external'); if ($externalStorageEnabled) { /** @var \OCA\Files_External\Service\BackendService $backendService */ $backendService = \OC_Mount_Config::$app->getContainer()->query('\\OCA\\Files_External\\Service\\BackendService'); $enableCertImport = $backendService->isUserMountingAllowed(); } // Return template $tmpl = new OC_Template('settings', 'personal', 'user'); $tmpl->assign('usage', OC_Helper::humanFileSize($storageInfo['used'])); $tmpl->assign('total_space', OC_Helper::humanFileSize($storageInfo['total'])); $tmpl->assign('usage_relative', $storageInfo['relative']); $tmpl->assign('clients', $clients); $tmpl->assign('email', $email);
} else { $languages[]=$ln; } } ksort($commonlanguages); // sort now by displayed language not the iso-code usort( $languages, function ($a, $b) { return strcmp($a['name'], $b['name']); }); //links to clients $clients = array( 'desktop' => $config->getSystemValue('customclient_desktop', $defaults->getSyncClientUrl()), 'android' => $config->getSystemValue('customclient_android', $defaults->getAndroidClientUrl()), 'ios' => $config->getSystemValue('customclient_ios', $defaults->getiOSClientUrl()) ); // Return template $tmpl = new OC_Template( 'settings', 'personal', 'user'); $tmpl->assign('usage', OC_Helper::humanFileSize($storageInfo['used'])); $tmpl->assign('total_space', OC_Helper::humanFileSize($storageInfo['total'])); $tmpl->assign('usage_relative', $storageInfo['relative']); $tmpl->assign('clients', $clients); $tmpl->assign('email', $email); $tmpl->assign('languages', $languages); $tmpl->assign('commonlanguages', $commonlanguages); $tmpl->assign('activelanguage', $userLang); $tmpl->assign('passwordChangeSupported', OC_User::canUserChangePassword(OC_User::getUser())); $tmpl->assign('displayNameChangeSupported', OC_User::canUserChangeDisplayName(OC_User::getUser()));