@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | /** @var AbstractSearchResult $item */ |
61 | 61 | // build unique relevance. Problem: returned relevance from query is integer |
62 | 62 | // and can be duplicated. So, we add random complex float value and make it string to sort in feature |
63 | - $uniqueRelevance = (string)($item->getRelevance() + (mt_rand(0, 999) / 10000)); |
|
63 | + $uniqueRelevance = (string) ($item->getRelevance() + (mt_rand(0, 999) / 10000)); |
|
64 | 64 | // build response |
65 | 65 | $result[$uniqueRelevance] = $item; |
66 | 66 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $queries = explode(' ', $this->query); |
85 | 85 | $dom = new Dom(); |
86 | 86 | foreach ($queries as $query) { |
87 | - $highlight = $dom->{$tag}(function () use ($query) { |
|
87 | + $highlight = $dom->{$tag}(function() use ($query) { |
|
88 | 88 | return $query; |
89 | 89 | }, $properties); |
90 | 90 | $text = Str::ireplace($query, $highlight, $text); |
@@ -40,7 +40,7 @@ |
||
40 | 40 | |
41 | 41 | <?php if ($model->appid && !\Ffcms\Core\Helper\Type\Any::isEmpty($model->appid)): ?> |
42 | 42 | <?= $this->bootstrap()->button('a', __('Get Yandex.Metrika token'), [ |
43 | - 'href' => 'https://oauth.yandex.ru/authorize?response_type=token&client_id=' . $model->appid . '&redirect_uri=' . Url::to('main/yandextoken'), |
|
43 | + 'href' => 'https://oauth.yandex.ru/authorize?response_type=token&client_id='.$model->appid.'&redirect_uri='.Url::to('main/yandextoken'), |
|
44 | 44 | 'class' => 'btn-success' |
45 | 45 | ]) ?> |
46 | 46 | <?php else: ?> |
@@ -43,9 +43,12 @@ |
||
43 | 43 | 'href' => 'https://oauth.yandex.ru/authorize?response_type=token&client_id=' . $model->appid . '&redirect_uri=' . Url::to('main/yandextoken'), |
44 | 44 | 'class' => 'btn-success' |
45 | 45 | ]) ?> |
46 | -<?php else: ?> |
|
46 | +<?php else { |
|
47 | + : ?> |
|
47 | 48 | <?= $this->bootstrap()->alert('warning', __('Create oauth application before get token')) ?> |
48 | -<?php endif; ?> |
|
49 | +<?php endif; |
|
50 | +} |
|
51 | +?> |
|
49 | 52 | |
50 | 53 | <?= $form->stop() ?> |
51 | 54 |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | <h3><?= __('Directories and files') ?></h3> |
57 | 57 | <?php |
58 | 58 | foreach ($check->chmodCheck as $dir => $status) { |
59 | - echo $this->bootstrap()->badge(($status ? 'success' : 'danger'), $dir) . " "; |
|
59 | + echo $this->bootstrap()->badge(($status ? 'success' : 'danger'), $dir)." "; |
|
60 | 60 | } |
61 | 61 | ?> |
62 | 62 | <hr /> |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | var visitChart = new Chart(visitElement, { |
135 | 135 | type: 'line', |
136 | 136 | data: { |
137 | - labels: [<?php foreach ($dates as $date){ echo '"' . $date . '", '; } ?>], |
|
137 | + labels: [<?php foreach ($dates as $date) { echo '"'.$date.'", '; } ?>], |
|
138 | 138 | datasets: [{ |
139 | 139 | yAxisID: 'units', |
140 | 140 | label: '<?= __('Views') ?>', |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | var sourceChart = new Chart(sourcesElement, { |
182 | 182 | type: 'pie', |
183 | 183 | data: { |
184 | - labels: [<?php foreach ($sourceTypes as $type){ echo '"' . $type . '", '; } ?>], |
|
184 | + labels: [<?php foreach ($sourceTypes as $type) { echo '"'.$type.'", '; } ?>], |
|
185 | 185 | datasets: [{ |
186 | 186 | data: [<?= implode(',', $sourceUsers) ?>], |
187 | 187 | label: 'Users', |
@@ -82,7 +82,8 @@ discard block |
||
82 | 82 | 'href' => Url::to('main/yandexconnect'), |
83 | 83 | 'class' => 'btn-danger' |
84 | 84 | ]) ?> |
85 | - <?php else: ?> |
|
85 | + <?php else { |
|
86 | + : ?> |
|
86 | 87 | <div class="row"> |
87 | 88 | <div class="col-md-8"> |
88 | 89 | <canvas id="visitChart" width="100%" height="50"></canvas> |
@@ -91,7 +92,9 @@ discard block |
||
91 | 92 | <canvas id="sourcesChart" width="100%" height="90"></canvas> |
92 | 93 | </div> |
93 | 94 | </div> |
94 | - <?php endif; ?> |
|
95 | + <?php endif; |
|
96 | +} |
|
97 | +?> |
|
95 | 98 | </div> |
96 | 99 | </div> |
97 | 100 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | <div class="row object-lightborder ml-1" id="wall-post-<?= $post->id ?>"> |
29 | 29 | <div class="col-xs-4 col-md-2"> |
30 | 30 | <div class="text-center"> |
31 | - <?= Url::a(['profile/show', [$post->sender_id]], $post->senderUser->profile->getNickname(), ['style' => 'color: ' . $post->senderUser->role->color]) ?> |
|
31 | + <?= Url::a(['profile/show', [$post->sender_id]], $post->senderUser->profile->getNickname(), ['style' => 'color: '.$post->senderUser->role->color]) ?> |
|
32 | 32 | <img class="img-fluid img-rounded" alt="Avatar of <?= $post->senderUser->profile->getNickname() ?>" src="<?= $post->senderUser->profile->getAvatarUrl('small') ?>" /> |
33 | 33 | <div class="text-muted"><?= Date::humanize($post->updated_at); ?></div> |
34 | 34 | </div> |
@@ -58,7 +58,7 @@ |
||
58 | 58 | $cfg = $this->_cfg; |
59 | 59 | |
60 | 60 | $cfg['oauth']['token'] = $this->token; |
61 | - $cfg['oauth']['expires'] = time() + (int)$this->expires; |
|
61 | + $cfg['oauth']['expires'] = time() + (int) $this->expires; |
|
62 | 62 | |
63 | 63 | App::$Properties->writeConfig('Yandex', $cfg); |
64 | 64 | } |
@@ -44,7 +44,7 @@ |
||
44 | 44 | public function make() |
45 | 45 | { |
46 | 46 | $cfg = App::$Properties->getAll('Yandex'); |
47 | - $cfg['metrika']['id'] = (int)$this->counter; |
|
47 | + $cfg['metrika']['id'] = (int) $this->counter; |
|
48 | 48 | |
49 | 49 | App::$Properties->writeConfig('Yandex', $cfg); |
50 | 50 | } |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php return [ |
2 | - 'oauth' => [ |
|
3 | - 'app_id' => null, |
|
4 | - 'token' => null, |
|
5 | - 'expires' => null |
|
6 | - ], |
|
7 | - 'metrika' => [ |
|
8 | - 'id' => null |
|
9 | - ] |
|
2 | + 'oauth' => [ |
|
3 | + 'app_id' => null, |
|
4 | + 'token' => null, |
|
5 | + 'expires' => null |
|
6 | + ], |
|
7 | + 'metrika' => [ |
|
8 | + 'id' => null |
|
9 | + ] |
|
10 | 10 | ]; |
11 | 11 | \ No newline at end of file |
@@ -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(); |