@@ -31,7 +31,7 @@ |
||
| 31 | 31 | ->withTrashed() |
| 32 | 32 | ->findOrNew($id); |
| 33 | 33 | $isNew = $record->id === null; |
| 34 | - $cloneId = (int)$this->request->query->get('from', 0); |
|
| 34 | + $cloneId = (int) $this->request->query->get('from', 0); |
|
| 35 | 35 | |
| 36 | 36 | // init model |
| 37 | 37 | $model = new FormContentUpdate($record, $cloneId); |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | public function up() |
| 18 | 18 | { |
| 19 | 19 | // set nullable varchar type for token column |
| 20 | - $this->getSchema()->table('users', function($table){ |
|
| 20 | + $this->getSchema()->table('users', function($table) { |
|
| 21 | 21 | $table->string('approve_token', 128)->nullable()->default(null)->change(); |
| 22 | 22 | }); |
| 23 | 23 | // set approve_token = null where it like '0' str or '' |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | }); |
| 32 | 32 | } |
| 33 | 33 | if (!$this->getSchema()->hasColumn('comment_answers', 'app_relation_id')) { |
| 34 | - $this->getSchema()->table('comment_answers', function ($table){ |
|
| 34 | + $this->getSchema()->table('comment_answers', function($table) { |
|
| 35 | 35 | $table->integer('app_relation_id')->unsigned()->default(0)->after('app_name'); |
| 36 | 36 | }); |
| 37 | 37 | } |
@@ -41,13 +41,13 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | // @todo: add algo to find app_name & app_id for oldest comments |
| 43 | 43 | if ($this->getSchema()->hasColumn('comment_posts', 'pathway')) { |
| 44 | - $this->getSchema()->table('comment_posts', function ($table){ |
|
| 44 | + $this->getSchema()->table('comment_posts', function($table) { |
|
| 45 | 45 | $table->dropColumn('pathway'); |
| 46 | 46 | }); |
| 47 | 47 | } |
| 48 | 48 | // remove comment_hash column from content |
| 49 | 49 | if ($this->getSchema()->hasColumn('contents', 'comment_hash')) { |
| 50 | - $this->getSchema()->table('contents', function ($table){ |
|
| 50 | + $this->getSchema()->table('contents', function($table) { |
|
| 51 | 51 | $table->dropColumn('comment_hash'); |
| 52 | 52 | }); |
| 53 | 53 | } |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | <?php if (\App::$Debug): ?> |
| 31 | 31 | <?= \App::$Debug->renderHead() ?> |
| 32 | 32 | <?php endif; ?> |
| 33 | - <?php if (!isset($fullgrid)){ $fullgrid = false; } ?> |
|
| 33 | + <?php if (!isset($fullgrid)) { $fullgrid = false; } ?> |
|
| 34 | 34 | </head> |
| 35 | 35 | <body class="bg-light"> |
| 36 | 36 | |
@@ -45,23 +45,23 @@ discard block |
||
| 45 | 45 | if (\App::$Properties->get('multiLanguage') && count(\App::$Properties->get('languages')) > 1) { |
| 46 | 46 | foreach (\App::$Properties->get('languages') as $lang) { |
| 47 | 47 | $navbar->menu('left', [ |
| 48 | - 'text' => '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="flag flag-' . $lang . '" alt="' . $lang . '">', |
|
| 49 | - 'link' => App::$Alias->baseUrlNoLang . '/' . $lang . App::$Request->getPathInfo(), |
|
| 48 | + 'text' => '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="flag flag-'.$lang.'" alt="'.$lang.'">', |
|
| 49 | + 'link' => App::$Alias->baseUrlNoLang.'/'.$lang.App::$Request->getPathInfo(), |
|
| 50 | 50 | 'html' => true |
| 51 | 51 | ]); |
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | if (\App::$User->isAuth()) { |
| 55 | 55 | $userId = \App::$User->identity()->getId(); |
| 56 | - $navbar->menu('right', ['text' => __('Account') . ' <span class="badge" id="summary-count-block">0</span>', 'dropdown' => [ |
|
| 56 | + $navbar->menu('right', ['text' => __('Account').' <span class="badge" id="summary-count-block">0</span>', 'dropdown' => [ |
|
| 57 | 57 | ['text' => __('My profile'), 'link' => ['profile/show', [$userId]]], |
| 58 | - ['text' => __('Messages') . ' <span class="badge" id="pm-count-block">0</span>', 'link' => ['profile/messages'], 'class' => 'dropdown-item', 'html' => true], |
|
| 58 | + ['text' => __('Messages').' <span class="badge" id="pm-count-block">0</span>', 'link' => ['profile/messages'], 'class' => 'dropdown-item', 'html' => true], |
|
| 59 | 59 | ['text' => __('Feed'), 'link' => ['profile/feed'], 'class' => 'dropdown-item'], |
| 60 | - ['text' => __('Notifications') . ' <span class="badge" id="notify-count-block">0</span>', 'link' => ['profile/notifications'], 'class' => 'dropdown-item', 'html' => true], |
|
| 60 | + ['text' => __('Notifications').' <span class="badge" id="notify-count-block">0</span>', 'link' => ['profile/notifications'], 'class' => 'dropdown-item', 'html' => true], |
|
| 61 | 61 | ['text' => __('Settings'), 'link' => ['profile/settings'], 'class' => 'dropdown-item'], |
| 62 | 62 | ], 'properties' => ['html' => true]]); |
| 63 | 63 | if (\App::$User->identity()->role->can('Admin/Main/Index')) { |
| 64 | - $navbar->menu('right', ['text' => __('Admin'), 'link' => \App::$Alias->scriptUrl . '/admin']); |
|
| 64 | + $navbar->menu('right', ['text' => __('Admin'), 'link' => \App::$Alias->scriptUrl.'/admin']); |
|
| 65 | 65 | } |
| 66 | 66 | $navbar->menu('right', ['text' => __('Logout'), 'link' => ['user/logout']]); |
| 67 | 67 | } else { |
@@ -27,54 +27,54 @@ |
||
| 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()->text('mail.host', ['class' => 'form-control'], __('Set SMTP hostname or ip')) . |
|
| 45 | - $form->fieldset()->text('mail.port', ['class' => 'form-control'], __('Set SMTP connection port')) . |
|
| 46 | - $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')) . |
|
| 47 | - $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()->text('mail.host', ['class' => 'form-control'], __('Set SMTP hostname or ip')). |
|
| 45 | + $form->fieldset()->text('mail.port', ['class' => 'form-control'], __('Set SMTP connection port')). |
|
| 46 | + $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')). |
|
| 47 | + $form->fieldset()->text('mail.user', ['class' => 'form-control'], __('Set auth user name if required')). |
|
| 48 | 48 | $form->fieldset()->text('mail.password', ['class' => 'form-control'], __('Set auth user password if exist')); |
| 49 | 49 | }]) |
| 50 | 50 | ->menu(['text' => __('Localization'), 'tab' => function() use ($form) { |
| 51 | - return $form->fieldset()->select('singleLanguage', ['class' => 'form-control', 'options' => \App::$Translate->getAvailableLangs()], __('Default language of website')) . |
|
| 52 | - $form->fieldset()->boolean('multiLanguage', null, __('Must we use multi language system in site pathway')) . |
|
| 53 | - $form->fieldset()->text('baseLanguage', ['class' => 'form-control', 'disabled' => null], __('Website base script language. Do not change it')) . |
|
| 51 | + return $form->fieldset()->select('singleLanguage', ['class' => 'form-control', 'options' => \App::$Translate->getAvailableLangs()], __('Default language of website')). |
|
| 52 | + $form->fieldset()->boolean('multiLanguage', null, __('Must we use multi language system in site pathway')). |
|
| 53 | + $form->fieldset()->text('baseLanguage', ['class' => 'form-control', 'disabled' => null], __('Website base script language. Do not change it')). |
|
| 54 | 54 | $form->fieldset()->checkboxes('languages', ['options' => App::$Translate->getAvailableLangs()], __('Website available languages')); |
| 55 | 55 | |
| 56 | 56 | }]) |
| 57 | 57 | ->menu(['text' => __('Database'), 'tab' => function() use ($form) { |
| 58 | - return '<p>' . __('Do not change any information in this tab if you not sure what you do!') . '</p>' . |
|
| 59 | - $form->fieldset()->select('database.driver', ['class' => 'form-control', 'options' => ['mysql', 'sqlite', 'pgsql']], __('Database connection driver')) . |
|
| 60 | - $form->fieldset()->text('database.host', ['class' => 'form-control'], __('Database connection host name')) . |
|
| 61 | - $form->fieldset()->text('database.database', ['class' => 'form-control'], __('Database name or path to sqlite created file database')) . |
|
| 62 | - $form->fieldset()->text('database.username', ['class' => 'form-control'], __('User name for database connection')) . |
|
| 63 | - $form->fieldset()->text('database.password', ['class' => 'form-control'], __('Password for user of database connection')) . |
|
| 64 | - $form->fieldset()->text('database.charset', ['class' => 'form-control']) . |
|
| 65 | - $form->fieldset()->text('database.collation', ['class' => 'form-control']) . |
|
| 58 | + return '<p>'.__('Do not change any information in this tab if you not sure what you do!').'</p>'. |
|
| 59 | + $form->fieldset()->select('database.driver', ['class' => 'form-control', 'options' => ['mysql', 'sqlite', 'pgsql']], __('Database connection driver')). |
|
| 60 | + $form->fieldset()->text('database.host', ['class' => 'form-control'], __('Database connection host name')). |
|
| 61 | + $form->fieldset()->text('database.database', ['class' => 'form-control'], __('Database name or path to sqlite created file database')). |
|
| 62 | + $form->fieldset()->text('database.username', ['class' => 'form-control'], __('User name for database connection')). |
|
| 63 | + $form->fieldset()->text('database.password', ['class' => 'form-control'], __('Password for user of database connection')). |
|
| 64 | + $form->fieldset()->text('database.charset', ['class' => 'form-control']). |
|
| 65 | + $form->fieldset()->text('database.collation', ['class' => 'form-control']). |
|
| 66 | 66 | $form->fieldset()->text('database.prefix', ['class' => 'form-control'], __('Database tables prefix')); |
| 67 | 67 | }]) |
| 68 | 68 | ->menu(['text' => __('Debug'), 'tab' => function() use ($form){ |
| 69 | - return '<p>' . __('The key-value of cookie to enable debugging on website') . '. ' . __('If user got this cookie he can see debug bar') . '. ' . |
|
| 70 | - Url::a(['main/debugcookie'], __('Set cookie for me')) . '</p>' . |
|
| 71 | - $form->fieldset()->text('debug.cookie.key', ['class' => 'form-control'], __('Set cookie name(key) for enable debug bar panel')) . |
|
| 69 | + return '<p>'.__('The key-value of cookie to enable debugging on website').'. '.__('If user got this cookie he can see debug bar').'. '. |
|
| 70 | + Url::a(['main/debugcookie'], __('Set cookie for me')).'</p>'. |
|
| 71 | + $form->fieldset()->text('debug.cookie.key', ['class' => 'form-control'], __('Set cookie name(key) for enable debug bar panel')). |
|
| 72 | 72 | $form->fieldset()->text('debug.cookie.value', ['class' => 'form-control'], __('Set cookie value for enable debug bar panel')); |
| 73 | 73 | }]) |
| 74 | 74 | ->menu(['text' => __('Other'), 'tab' => function() use ($form){ |
| 75 | - return '<p>' . __('There you can change specified configs depends of other platforms. GA = google analytics.') . '</p>' . |
|
| 76 | - $form->fieldset()->text('gaClientId', ['class' => 'form-control'], __('Google oAuth2 client id. This id will be used to display google.analytics info. Client ID looks like: xxxxxx.apps.googleusercontent.com')) . |
|
| 77 | - $form->fieldset()->text('gaTrackId', ['class' => 'form-control'], __('Set google analytics tracking id for your website. Track id looks like: UA-XXXXXX-Y')) . |
|
| 75 | + return '<p>'.__('There you can change specified configs depends of other platforms. GA = google analytics.').'</p>'. |
|
| 76 | + $form->fieldset()->text('gaClientId', ['class' => 'form-control'], __('Google oAuth2 client id. This id will be used to display google.analytics info. Client ID looks like: xxxxxx.apps.googleusercontent.com')). |
|
| 77 | + $form->fieldset()->text('gaTrackId', ['class' => 'form-control'], __('Set google analytics tracking id for your website. Track id looks like: UA-XXXXXX-Y')). |
|
| 78 | 78 | $form->fieldset()->text('trustedProxy', ['class' => 'form-control'], __('Set trusted proxy list to accept X-FORWARDED data. Example: 103.21.244.15,103.22.200.0/22')); |
| 79 | 79 | }]) |
| 80 | 80 | ->display(); ?> |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | var script_lang = '<?= \App::$Request->getLanguage() ?>'; |
| 28 | 28 | var site_url = '<?= \App::$Alias->baseUrl ?>'; |
| 29 | 29 | </script> |
| 30 | - <?php if (!isset($fullgrid)){ $fullgrid = false; } ?> |
|
| 30 | + <?php if (!isset($fullgrid)) { $fullgrid = false; } ?> |
|
| 31 | 31 | </head> |
| 32 | 32 | |
| 33 | 33 | <body> |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | $list = $this->listing('ul', ['class' => 'list-inline']); |
| 45 | 45 | foreach (\App::$Properties->get('languages') as $lang) { |
| 46 | 46 | $list->li([ |
| 47 | - 'text' => '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="flag flag-' . $lang . '" alt="' . $lang . '">', |
|
| 48 | - 'link' => App::$Alias->baseUrlNoLang . '/' . $lang . App::$Request->getPathInfo(), |
|
| 47 | + 'text' => '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="flag flag-'.$lang.'" alt="'.$lang.'">', |
|
| 48 | + 'link' => App::$Alias->baseUrlNoLang.'/'.$lang.App::$Request->getPathInfo(), |
|
| 49 | 49 | 'html' => true |
| 50 | 50 | ], ['class' => 'list-inline-item']); |
| 51 | 51 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | public function __construct(ContentCategory $record, $dependId = null) |
| 37 | 37 | { |
| 38 | 38 | $this->_record = $record; |
| 39 | - $this->_tmpDependId = (int)$dependId; |
|
| 39 | + $this->_tmpDependId = (int) $dependId; |
|
| 40 | 40 | parent::__construct(); |
| 41 | 41 | } |
| 42 | 42 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | ]; |
| 114 | 114 | |
| 115 | 115 | // general category |
| 116 | - if (!$this->_new && (int)$this->_record->id === 1) { |
|
| 116 | + if (!$this->_new && (int) $this->_record->id === 1) { |
|
| 117 | 117 | $rules[] = ['path', 'used']; |
| 118 | 118 | } else { |
| 119 | 119 | $rules[] = ['path', 'required']; |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | $rules[] = ['path', 'reverse_match', '/[\/\'~`\!@#\$%\^&\*\(\)+=\{\}\[\]\|;:"\<\>,\?\\\]/']; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - $rules[] = ['title.' . App::$Request->getLanguage(), 'required']; |
|
| 125 | + $rules[] = ['title.'.App::$Request->getLanguage(), 'required']; |
|
| 126 | 126 | |
| 127 | 127 | |
| 128 | 128 | return $rules; |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | { |
| 136 | 136 | $this->_record->title = $this->title; |
| 137 | 137 | $this->_record->description = $this->description; |
| 138 | - $savePath = trim($this->_pathNested . '/' . $this->path, '/'); |
|
| 138 | + $savePath = trim($this->_pathNested.'/'.$this->path, '/'); |
|
| 139 | 139 | $this->_record->path = $savePath; |
| 140 | 140 | $this->_record->configs = $this->configs; |
| 141 | 141 | $this->_record->save(); |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | // build path with owner category |
| 171 | 171 | $this->_pathNested = $owner->path; |
| 172 | 172 | if (Str::length($this->_pathNested) > 0) { |
| 173 | - $path = $this->_pathNested . '/' . $path; |
|
| 173 | + $path = $this->_pathNested.'/'.$path; |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | // make select for check |