Guillermo - add supported languages[skip ci]

This commit is contained in:
AntonyAntonio 2016-12-20 23:29:19 -03:00
parent abea0bbb97
commit b26db547dc
2 changed files with 41 additions and 0 deletions

View File

@ -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 = [

View File

@ -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'
];
}
}