@@ -27,49 +27,49 @@ |
||
27 | 27 | |
28 | 28 | <?= $this->bootstrap()->nav('ul', ['class' => 'nav-tabs']) |
29 | 29 | ->menu(['text' => __('Base'), 'tab' => function() use ($form) { |
30 | - return $form->fieldset()->text('baseDomain', ['class' => 'form-control'], __('Main domain of website. Use only in console or cron tasks, if domain cannot be defined from request string')) . |
|
31 | - $form->fieldset()->radio('baseProto', ['options' => ['http', 'https']], __('Main website transfer protocol. Use only if request data is not available in console or cron tasks')) . |
|
32 | - $form->fieldset()->text('basePath', ['class' => 'form-control'], __('FFCMS installation sub-directory, used if installed not in root. Example: /subdir/')) . |
|
33 | - $form->fieldset()->select('timezone', ['class' => 'selectize-select', 'options' => DateTimeZone::listIdentifiers()], __('Define website default timezone id')) . |
|
34 | - $form->fieldset()->boolean('userCron', null, __('Initialize cron manager when user load website? Enable this option if you are not configured cron tasks in your operation system')) . |
|
35 | - $form->fieldset()->boolean('debug.all', null, __('Enable debug bar panel for all visitors? Recommended only on development environment')) . |
|
30 | + return $form->fieldset()->text('baseDomain', ['class' => 'form-control'], __('Main domain of website. Use only in console or cron tasks, if domain cannot be defined from request string')). |
|
31 | + $form->fieldset()->radio('baseProto', ['options' => ['http', 'https']], __('Main website transfer protocol. Use only if request data is not available in console or cron tasks')). |
|
32 | + $form->fieldset()->text('basePath', ['class' => 'form-control'], __('FFCMS installation sub-directory, used if installed not in root. Example: /subdir/')). |
|
33 | + $form->fieldset()->select('timezone', ['class' => 'selectize-select', 'options' => DateTimeZone::listIdentifiers()], __('Define website default timezone id')). |
|
34 | + $form->fieldset()->boolean('userCron', null, __('Initialize cron manager when user load website? Enable this option if you are not configured cron tasks in your operation system')). |
|
35 | + $form->fieldset()->boolean('debug.all', null, __('Enable debug bar panel for all visitors? Recommended only on development environment')). |
|
36 | 36 | $form->fieldset()->boolean('testSuite', null, __('Enable codeception test suite adapter? Use this option ONLY to run codeception tests! Disable this option on production')); |
37 | 37 | }, 'tabActive' => true]) |
38 | 38 | ->menu(['text' => __('Themes'), 'tab' => function() use ($form, $model) { |
39 | - return $form->fieldset()->select('theme.Front', ['class' => 'form-control', 'options' => $model->getAvailableThemes('Front')], __('Set theme for user part of website')) . |
|
39 | + return $form->fieldset()->select('theme.Front', ['class' => 'form-control', 'options' => $model->getAvailableThemes('Front')], __('Set theme for user part of website')). |
|
40 | 40 | $form->fieldset()->select('theme.Admin', ['class' => 'form-control', 'options' => $model->getAvailableThemes('Admin')], __('Set theme for admin panel')); |
41 | 41 | }]) |
42 | 42 | ->menu(['text' => __('Mail'), 'tab' => function() use ($form) { |
43 | - return '<p>' . __('Configure sendmail over smtp server. You should set host:port and auth data for your smtp server') . '</p>' . |
|
44 | - $form->fieldset()->boolean('mail.enable', ['options' => [0 => 'Disabled', 1 => 'Enabled'], 'optionsKey' => true], __('Is mailing features enabled?')) . |
|
45 | - $form->fieldset()->text('mail.host', ['class' => 'form-control'], __('Set SMTP hostname or ip')) . |
|
46 | - $form->fieldset()->text('mail.port', ['class' => 'form-control'], __('Set SMTP connection port')) . |
|
47 | - $form->fieldset()->select('mail.encrypt', ['class' => 'form-control', 'options' => ['tls', 'ssl', 'none']], __('Set encryption method for your smtp server. For remote service we are strongly recommend use tls/ssl encryption')) . |
|
48 | - $form->fieldset()->text('mail.user', ['class' => 'form-control'], __('Set auth user name if required')) . |
|
43 | + return '<p>'.__('Configure sendmail over smtp server. You should set host:port and auth data for your smtp server').'</p>'. |
|
44 | + $form->fieldset()->boolean('mail.enable', ['options' => [0 => 'Disabled', 1 => 'Enabled'], 'optionsKey' => true], __('Is mailing features enabled?')). |
|
45 | + $form->fieldset()->text('mail.host', ['class' => 'form-control'], __('Set SMTP hostname or ip')). |
|
46 | + $form->fieldset()->text('mail.port', ['class' => 'form-control'], __('Set SMTP connection port')). |
|
47 | + $form->fieldset()->select('mail.encrypt', ['class' => 'form-control', 'options' => ['tls', 'ssl', 'none']], __('Set encryption method for your smtp server. For remote service we are strongly recommend use tls/ssl encryption')). |
|
48 | + $form->fieldset()->text('mail.user', ['class' => 'form-control'], __('Set auth user name if required')). |
|
49 | 49 | $form->fieldset()->text('mail.password', ['class' => 'form-control'], __('Set auth user password if exist')); |
50 | 50 | }]) |
51 | 51 | ->menu(['text' => __('Localization'), 'tab' => function() use ($form) { |
52 | - return $form->fieldset()->select('singleLanguage', ['class' => 'form-control', 'options' => \App::$Translate->getAvailableLangs()], __('Default language of website')) . |
|
53 | - $form->fieldset()->boolean('multiLanguage', null, __('Must we use multi language system in site pathway')) . |
|
54 | - $form->fieldset()->text('baseLanguage', ['class' => 'form-control', 'disabled' => null], __('Website base script language. Do not change it')) . |
|
52 | + return $form->fieldset()->select('singleLanguage', ['class' => 'form-control', 'options' => \App::$Translate->getAvailableLangs()], __('Default language of website')). |
|
53 | + $form->fieldset()->boolean('multiLanguage', null, __('Must we use multi language system in site pathway')). |
|
54 | + $form->fieldset()->text('baseLanguage', ['class' => 'form-control', 'disabled' => null], __('Website base script language. Do not change it')). |
|
55 | 55 | $form->fieldset()->checkboxes('languages', ['options' => App::$Translate->getAvailableLangs()], __('Website available languages')); |
56 | 56 | |
57 | 57 | }]) |
58 | 58 | ->menu(['text' => __('Database'), 'tab' => function() use ($form) { |
59 | - return '<p>' . __('Do not change any information in this tab if you not sure what you do!') . '</p>' . |
|
60 | - $form->fieldset()->select('database.driver', ['class' => 'form-control', 'options' => ['mysql', 'sqlite', 'pgsql']], __('Database connection driver')) . |
|
61 | - $form->fieldset()->text('database.host', ['class' => 'form-control'], __('Database connection host name')) . |
|
62 | - $form->fieldset()->text('database.database', ['class' => 'form-control'], __('Database name or path to sqlite created file database')) . |
|
63 | - $form->fieldset()->text('database.username', ['class' => 'form-control'], __('User name for database connection')) . |
|
64 | - $form->fieldset()->text('database.password', ['class' => 'form-control'], __('Password for user of database connection')) . |
|
65 | - $form->fieldset()->text('database.charset', ['class' => 'form-control']) . |
|
66 | - $form->fieldset()->text('database.collation', ['class' => 'form-control']) . |
|
59 | + return '<p>'.__('Do not change any information in this tab if you not sure what you do!').'</p>'. |
|
60 | + $form->fieldset()->select('database.driver', ['class' => 'form-control', 'options' => ['mysql', 'sqlite', 'pgsql']], __('Database connection driver')). |
|
61 | + $form->fieldset()->text('database.host', ['class' => 'form-control'], __('Database connection host name')). |
|
62 | + $form->fieldset()->text('database.database', ['class' => 'form-control'], __('Database name or path to sqlite created file database')). |
|
63 | + $form->fieldset()->text('database.username', ['class' => 'form-control'], __('User name for database connection')). |
|
64 | + $form->fieldset()->text('database.password', ['class' => 'form-control'], __('Password for user of database connection')). |
|
65 | + $form->fieldset()->text('database.charset', ['class' => 'form-control']). |
|
66 | + $form->fieldset()->text('database.collation', ['class' => 'form-control']). |
|
67 | 67 | $form->fieldset()->text('database.prefix', ['class' => 'form-control'], __('Database tables prefix')); |
68 | 68 | }]) |
69 | 69 | ->menu(['text' => __('Debug'), 'tab' => function() use ($form){ |
70 | - return '<p>' . __('The key-value of cookie to enable debugging on website') . '. ' . __('If user got this cookie he can see debug bar') . '. ' . |
|
71 | - Url::a(['main/debugcookie'], __('Set cookie for me')) . '</p>' . |
|
72 | - $form->fieldset()->text('debug.cookie.key', ['class' => 'form-control'], __('Set cookie name(key) for enable debug bar panel')) . |
|
70 | + return '<p>'.__('The key-value of cookie to enable debugging on website').'. '.__('If user got this cookie he can see debug bar').'. '. |
|
71 | + Url::a(['main/debugcookie'], __('Set cookie for me')).'</p>'. |
|
72 | + $form->fieldset()->text('debug.cookie.key', ['class' => 'form-control'], __('Set cookie name(key) for enable debug bar panel')). |
|
73 | 73 | $form->fieldset()->text('debug.cookie.value', ['class' => 'form-control'], __('Set cookie value for enable debug bar panel')); |
74 | 74 | }]) |
75 | 75 | ->menu(['text' => __('Other'), 'tab' => function() use ($form){ |
@@ -107,13 +107,13 @@ |
||
107 | 107 | $cfg['baseDomain'] = $this->baseDomain; |
108 | 108 | $cfg['database'] = $this->db; |
109 | 109 | $cfg['singleLanguage'] = $this->singleLanguage; |
110 | - $cfg['multiLanguage'] = (bool)$this->multiLanguage; |
|
111 | - $cfg['debug']['cookie']['key'] = 'fdebug_' . Crypt::randomString(mt_rand(4, 16)); |
|
110 | + $cfg['multiLanguage'] = (bool) $this->multiLanguage; |
|
111 | + $cfg['debug']['cookie']['key'] = 'fdebug_'.Crypt::randomString(mt_rand(4, 16)); |
|
112 | 112 | $cfg['debug']['cookie']['value'] = Crypt::randomString(mt_rand(32, 128)); |
113 | 113 | $cfg['mail'] = $this->mail; |
114 | 114 | |
115 | 115 | // initialize migrations table |
116 | - App::$Database->getConnection('install')->getSchemaBuilder()->create('migrations', function ($table) { |
|
116 | + App::$Database->getConnection('install')->getSchemaBuilder()->create('migrations', function($table) { |
|
117 | 117 | $table->increments('id'); |
118 | 118 | $table->string('migration', 128)->unique(); |
119 | 119 | $table->timestamps(); |
@@ -46,8 +46,8 @@ |
||
46 | 46 | public $_name = 'formAdminConfig'; |
47 | 47 | |
48 | 48 | /** |
49 | - * Set property values from configurations |
|
50 | - */ |
|
49 | + * Set property values from configurations |
|
50 | + */ |
|
51 | 51 | public function before() |
52 | 52 | { |
53 | 53 | $properties = App::$Properties->getAll(); |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | date_default_timezone_set(App::$Properties->get('timezone')); |
13 | 13 | |
14 | 14 | return [ |
15 | - 'Database' => function () { |
|
15 | + 'Database' => function() { |
|
16 | 16 | $capsule = new Capsule; |
17 | 17 | if (env_name !== 'Install') { |
18 | 18 | try { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | try { |
40 | 40 | $capsule->connection()->getPdo(); |
41 | 41 | } catch (\Exception $e) { |
42 | - $instUri = \App::$Alias->scriptUrl . '/install'; |
|
42 | + $instUri = \App::$Alias->scriptUrl.'/install'; |
|
43 | 43 | \App::$Response->redirect($instUri, true); |
44 | 44 | } |
45 | 45 | } |
@@ -51,10 +51,10 @@ discard block |
||
51 | 51 | try { |
52 | 52 | $pdo = \App::$Database->connection()->getPdo(); |
53 | 53 | $handler = new PdoSessionHandler($pdo, [ |
54 | - 'db_table' => App::$Properties->get('database')['prefix'] . 'sessions' |
|
54 | + 'db_table' => App::$Properties->get('database')['prefix'].'sessions' |
|
55 | 55 | ]); |
56 | 56 | } catch (Exception $e) { |
57 | - $handler = new NativeFileSessionHandler(root . '/Private/Sessions'); |
|
57 | + $handler = new NativeFileSessionHandler(root.'/Private/Sessions'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | $storage = new NativeSessionStorage([ |
@@ -65,12 +65,12 @@ discard block |
||
65 | 65 | |
66 | 66 | return new Session($storage); |
67 | 67 | }, |
68 | - 'User' => function () { |
|
68 | + 'User' => function() { |
|
69 | 69 | return new Apps\ActiveRecord\User(); |
70 | 70 | }, |
71 | - 'Mailer' => function () { |
|
71 | + 'Mailer' => function() { |
|
72 | 72 | $mCfg = App::$Properties->get('mail'); |
73 | - if (!(bool)$mCfg['enable']) { |
|
73 | + if (!(bool) $mCfg['enable']) { |
|
74 | 74 | return false; |
75 | 75 | } |
76 | 76 | // initialize swiftmailer transporter |
@@ -89,12 +89,12 @@ discard block |
||
89 | 89 | $swift = (new Swift_Mailer($transport)); |
90 | 90 | return \Ffcms\Core\Helper\Mailer::factory($swift, $mCfg['user']); |
91 | 91 | }, |
92 | - 'Captcha' => function () { |
|
92 | + 'Captcha' => function() { |
|
93 | 93 | return new Extend\Core\Captcha\Gregwar(); |
94 | 94 | }, |
95 | - 'Cache' => function () { |
|
95 | + 'Cache' => function() { |
|
96 | 96 | // initialize symfony cache manager |
97 | - $cache = new \Symfony\Component\Cache\Adapter\FilesystemAdapter('web', 3600, root . '/Private/Cache'); |
|
97 | + $cache = new \Symfony\Component\Cache\Adapter\FilesystemAdapter('web', 3600, root.'/Private/Cache'); |
|
98 | 98 | return $cache; |
99 | 99 | }, |
100 | 100 | '_hybridauth' => function() { |
@@ -1,47 +1,47 @@ |
||
1 | 1 | <?php return [ |
2 | - 'baseProto' => 'http', |
|
3 | - 'baseDomain' => 'ffcms.test', |
|
4 | - 'basePath' => '/', |
|
5 | - 'timezone' => 'Europe/Moscow', |
|
6 | - 'adminEmail' => false, |
|
7 | - 'debug' => [ |
|
8 | - 'all' => false, |
|
9 | - 'cookie' => [ |
|
10 | - 'key' => 'fdebug_51cc', |
|
11 | - 'value' => '58928ebf3097fad30db28d34bfc52619efa0c5f191638563aca9f6dbcebec5b6936f89aeaea9ae7e0d6aa000455b114938b79c35d7' |
|
12 | - ] |
|
13 | - ], |
|
14 | - 'userCron' => false, |
|
15 | - 'testSuite' => false, |
|
16 | - 'theme' => [ |
|
17 | - 'Front' => 'default', |
|
18 | - 'Admin' => 'default' |
|
19 | - ], |
|
20 | - 'database' => [ |
|
21 | - 'driver' => 'mysql', |
|
22 | - 'host' => '127.0.0.1', |
|
23 | - 'username' => 'mysql', |
|
24 | - 'password' => 'mysql', |
|
25 | - 'database' => 'ffcms', |
|
26 | - 'prefix' => 'ffcms_', |
|
27 | - 'charset' => 'utf8', |
|
28 | - 'collation' => 'utf8_unicode_ci' |
|
29 | - ], |
|
30 | - 'mail' => [ |
|
31 | - 'enable' => '0', |
|
32 | - 'host' => '', |
|
33 | - 'port' => '', |
|
34 | - 'user' => '', |
|
35 | - 'password' => '', |
|
36 | - 'encrypt' => '' |
|
37 | - ], |
|
38 | - 'baseLanguage' => 'en', |
|
39 | - 'multiLanguage' => true, |
|
40 | - 'singleLanguage' => 'en', |
|
41 | - 'languages' => [ |
|
42 | - 'en', |
|
43 | - 'ru' |
|
44 | - ], |
|
45 | - 'languageDomainAlias' => false, |
|
46 | - 'trustedProxy' => false |
|
2 | + 'baseProto' => 'http', |
|
3 | + 'baseDomain' => 'ffcms.test', |
|
4 | + 'basePath' => '/', |
|
5 | + 'timezone' => 'Europe/Moscow', |
|
6 | + 'adminEmail' => false, |
|
7 | + 'debug' => [ |
|
8 | + 'all' => false, |
|
9 | + 'cookie' => [ |
|
10 | + 'key' => 'fdebug_51cc', |
|
11 | + 'value' => '58928ebf3097fad30db28d34bfc52619efa0c5f191638563aca9f6dbcebec5b6936f89aeaea9ae7e0d6aa000455b114938b79c35d7' |
|
12 | + ] |
|
13 | + ], |
|
14 | + 'userCron' => false, |
|
15 | + 'testSuite' => false, |
|
16 | + 'theme' => [ |
|
17 | + 'Front' => 'default', |
|
18 | + 'Admin' => 'default' |
|
19 | + ], |
|
20 | + 'database' => [ |
|
21 | + 'driver' => 'mysql', |
|
22 | + 'host' => '127.0.0.1', |
|
23 | + 'username' => 'mysql', |
|
24 | + 'password' => 'mysql', |
|
25 | + 'database' => 'ffcms', |
|
26 | + 'prefix' => 'ffcms_', |
|
27 | + 'charset' => 'utf8', |
|
28 | + 'collation' => 'utf8_unicode_ci' |
|
29 | + ], |
|
30 | + 'mail' => [ |
|
31 | + 'enable' => '0', |
|
32 | + 'host' => '', |
|
33 | + 'port' => '', |
|
34 | + 'user' => '', |
|
35 | + 'password' => '', |
|
36 | + 'encrypt' => '' |
|
37 | + ], |
|
38 | + 'baseLanguage' => 'en', |
|
39 | + 'multiLanguage' => true, |
|
40 | + 'singleLanguage' => 'en', |
|
41 | + 'languages' => [ |
|
42 | + 'en', |
|
43 | + 'ru' |
|
44 | + ], |
|
45 | + 'languageDomainAlias' => false, |
|
46 | + 'trustedProxy' => false |
|
47 | 47 | ]; |
48 | 48 | \ No newline at end of file |