Guillermo - add supported languages[skip ci]
This commit is contained in:
parent
abea0bbb97
commit
b26db547dc
|
@ -14,6 +14,7 @@ class InitSettingsController extends Controller {
|
|||
if (Setting::isTableEmpty()) {
|
||||
$this->storeGlobalSettings();
|
||||
$this->storeMailTemplates();
|
||||
$this->storeLanguages();
|
||||
$this->storeMockedDepartments();
|
||||
$this->createMockedStaff();
|
||||
|
||||
|
@ -73,6 +74,18 @@ class InitSettingsController extends Controller {
|
|||
$setting->store();
|
||||
}
|
||||
}
|
||||
private function storeLanguages() {
|
||||
foreach(Language::LANGUAGES as $languageCode) {
|
||||
$language = new Language();
|
||||
$language->setProperties([
|
||||
'code' => $languageCode,
|
||||
'allowed' => 1,
|
||||
'supported' => ($languageCode === 'en')
|
||||
]);
|
||||
|
||||
$language->store();
|
||||
}
|
||||
}
|
||||
|
||||
private function storeMockedDepartments() {
|
||||
$departments = [
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
use RedBeanPHP\Facade as RedBean;
|
||||
|
||||
class Language extends DataStore {
|
||||
const TABLE = 'language';
|
||||
const LANGUAGES = [
|
||||
'en',
|
||||
'es',
|
||||
'de',
|
||||
'fr',
|
||||
'pr',
|
||||
'jp',
|
||||
'ru',
|
||||
'cn',
|
||||
'in',
|
||||
'tr'
|
||||
];
|
||||
|
||||
public static function getProps() {
|
||||
return [
|
||||
'code',
|
||||
'allowed',
|
||||
'supported'
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue