diff --git a/install/core/Installer.php b/install/core/Installer.php
index 8f636f8462..803315155b 100644
--- a/install/core/Installer.php
+++ b/install/core/Installer.php
@@ -83,6 +83,7 @@ class Installer
'outboundEmailFromName',
'outboundEmailFromAddress',
'outboundEmailIsShared',
+ 'theme',
];
public function __construct()
@@ -237,7 +238,15 @@ class Installer
return $this->app->isInstalled();
}
- private function getLanguage(): Language
+ public function createLanguage(string $language): Language
+ {
+ return $this->app
+ ->getContainer()
+ ->get('injectableFactory')
+ ->createWith(Language::class, ['language' => $language]);
+ }
+
+ public function getLanguage(): Language
{
if (!isset($this->language)) {
try {
@@ -255,6 +264,14 @@ class Installer
return $this->language;
}
+ public function getThemeList(): array
+ {
+ return [
+ 'HazyblueVertical',
+ 'DarkVertical',
+ ];
+ }
+
public function getLanguageList($isTranslated = true): array
{
$languageList = $this->getMetadata()->get(['app', 'language', 'list']);
@@ -349,6 +366,7 @@ class Installer
'passwordSalt' => $this->getPasswordHash()->generateSalt(),
'cryptKey' => $this->getContainer()->get('crypt')->generateKey(),
'hashSecretKey' => Util::generateSecretKey(),
+ 'theme' => $saveData['theme'] ?? 'HazyblueVertical',
];
if (empty($saveData['defaultPermissions']['user'])) {
@@ -528,6 +546,7 @@ class Installer
'thousandSeparator',
'decimalMark',
'language',
+ 'theme',
];
$data = array_intersect_key($preferences, array_flip($permittedSettingList));
@@ -605,6 +624,11 @@ class Installer
case 'language':
$settingDefs['language']['options'] = $this->getLanguageList(false);
+ break;
+
+ case 'theme':
+ $settingDefs['theme']['options'] = $this->getThemeList();
+
break;
}
diff --git a/install/core/actions/checkPermission.php b/install/core/actions/checkPermission.php
index ec7d6e4db9..c35a0f0562 100644
--- a/install/core/actions/checkPermission.php
+++ b/install/core/actions/checkPermission.php
@@ -28,31 +28,48 @@
************************************************************************/
ob_start();
-$result = array('success' => true, 'errorMsg' => '');
+
+$result = ['success' => true, 'errorMsg' => ''];
if (!$installer->checkPermission()) {
$result['success'] = false;
$error = $installer->getLastPermissionError();
+
$urls = array_keys($error);
- $group = array();
- foreach($error as $folder => $permission) {
+
+ $group = [];
+
+ foreach ($error as $folder => $permission) {
$group[implode('-', $permission)][] = $folder;
}
+
ksort($group);
+
$instruction = '';
$instructionSU = '';
$changeOwner = true;
+
foreach($group as $permission => $folders) {
- if ($permission == '0644-0755') $folders = '';
- $instruction .= $systemHelper->getPermissionCommands(array($folders, ''), explode('-', $permission), false, null, $changeOwner) . "
";
- $instructionSU .= $systemHelper->getPermissionCommands(array($folders, ''), explode('-', $permission), true, null, $changeOwner) . "
";
+ if ($permission == '0644-0755') {
+ $folders = '';
+ }
+
+ $instruction .= $systemHelper
+ ->getPermissionCommands([$folders, ''], explode('-', $permission), false, null, $changeOwner) . "
";
+
+ $instructionSU .= $systemHelper
+ ->getPermissionCommands([$folders, ''], explode('-', $permission), true, null, $changeOwner) . "
";
+
if ($changeOwner) {
$changeOwner = false;
}
}
+
$result['errorMsg'] = $langs['messages']['Permission denied to'] . ':
'.implode('
', $urls).'';
- $result['errorFixInstruction'] = str_replace( '"{C}"' , $instruction, $langs['messages']['permissionInstruction']) . "