@@ -72,7 +72,7 @@ |
||
72 | 72 | |
73 | 73 | // render view |
74 | 74 | return App::$View->render($this->tpl, [ |
75 | - 'records' => $query |
|
75 | + 'records' => $query |
|
76 | 76 | ]); |
77 | 77 | } |
78 | 78 |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | App::$Session->getFlashBag()->add('error', __('User is never exist or password is incorrect!')); |
55 | 55 | // initialize fail event |
56 | 56 | App::$Event->run(static::EVENT_USER_LOGIN_FAIL, [ |
57 | - 'model' => $loginForm |
|
57 | + 'model' => $loginForm |
|
58 | 58 | ]); |
59 | 59 | } |
60 | 60 | |
@@ -114,14 +114,14 @@ discard block |
||
114 | 114 | if ($registerForm->tryRegister($configs['registrationType'] === 1)) { |
115 | 115 | // initialize succes signup event |
116 | 116 | App::$Event->run(static::EVENT_USER_REGISTER_SUCCESS, [ |
117 | - 'model' => $registerForm |
|
117 | + 'model' => $registerForm |
|
118 | 118 | ]); |
119 | 119 | // send notification of successful registering |
120 | 120 | App::$Session->getFlashBag()->add('success', __('Your account is registered. You must confirm account via email')); |
121 | 121 | } else { |
122 | 122 | // init fail signup event |
123 | 123 | App::$Event->run(static::EVENT_USER_REGISTER_FAIL, [ |
124 | - 'model' => $registerForm |
|
124 | + 'model' => $registerForm |
|
125 | 125 | ]); |
126 | 126 | App::$Session->getFlashBag()->add('error', __('Login or email is always used on website')); |
127 | 127 | } |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
47 | - * Set default values from database record |
|
48 | - */ |
|
47 | + * Set default values from database record |
|
48 | + */ |
|
49 | 49 | public function before() |
50 | 50 | { |
51 | 51 | // set data from db record |
@@ -85,9 +85,9 @@ discard block |
||
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
88 | - * Form labels |
|
89 | - * @return array |
|
90 | - */ |
|
88 | + * Form labels |
|
89 | + * @return array |
|
90 | + */ |
|
91 | 91 | public function labels() |
92 | 92 | { |
93 | 93 | return [ |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | } |
101 | 101 | |
102 | 102 | /** |
103 | - * Content update form validation rules |
|
104 | - * @return array |
|
105 | - */ |
|
103 | + * Content update form validation rules |
|
104 | + * @return array |
|
105 | + */ |
|
106 | 106 | public function rules() |
107 | 107 | { |
108 | 108 | $r = [ |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php return [ |
2 | - 'Alias' => [ |
|
3 | - 'Front' => [ |
|
4 | - '/' => '/content/list/news' |
|
5 | - ] |
|
6 | - ] |
|
2 | + 'Alias' => [ |
|
3 | + 'Front' => [ |
|
4 | + '/' => '/content/list/news' |
|
5 | + ] |
|
6 | + ] |
|
7 | 7 | ]; |
8 | 8 | \ No newline at end of file |
@@ -42,8 +42,8 @@ |
||
42 | 42 | public $trustedProxy; |
43 | 43 | |
44 | 44 | /** |
45 | - * Set property values from configurations |
|
46 | - */ |
|
45 | + * Set property values from configurations |
|
46 | + */ |
|
47 | 47 | public function before() |
48 | 48 | { |
49 | 49 | // set default values |
@@ -10,21 +10,21 @@ discard block |
||
10 | 10 | |
11 | 11 | class Contenttag extends AbstractWidget |
12 | 12 | { |
13 | - use ClassTools; |
|
13 | + use ClassTools; |
|
14 | 14 | |
15 | - public $count; |
|
16 | - public $cache; |
|
15 | + public $count; |
|
16 | + public $cache; |
|
17 | 17 | |
18 | - public $tpl = 'widgets/contenttag/default'; |
|
18 | + public $tpl = 'widgets/contenttag/default'; |
|
19 | 19 | |
20 | - private $_lang; |
|
20 | + private $_lang; |
|
21 | 21 | private $_cacheName; |
22 | 22 | |
23 | - /** |
|
24 | - * Set default configurations if not defined |
|
25 | - * {@inheritDoc} |
|
26 | - * @see \Ffcms\Core\Arch\Widget::init() |
|
27 | - */ |
|
23 | + /** |
|
24 | + * Set default configurations if not defined |
|
25 | + * {@inheritDoc} |
|
26 | + * @see \Ffcms\Core\Arch\Widget::init() |
|
27 | + */ |
|
28 | 28 | public function init() |
29 | 29 | { |
30 | 30 | $cfg = $this->getConfigs(); |
@@ -50,27 +50,27 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function display() |
52 | 52 | { |
53 | - // get records rows from cache or directly from db |
|
54 | - $records = null; |
|
55 | - if ($this->cache === 0) { |
|
56 | - $records = $this->makeQuery(); |
|
57 | - } else { |
|
58 | - $records = App::$Cache->get($this->_cacheName); |
|
53 | + // get records rows from cache or directly from db |
|
54 | + $records = null; |
|
55 | + if ($this->cache === 0) { |
|
56 | + $records = $this->makeQuery(); |
|
57 | + } else { |
|
58 | + $records = App::$Cache->get($this->_cacheName); |
|
59 | 59 | if ($records === null) { |
60 | - $records = $this->makeQuery(); |
|
61 | - App::$Cache->set($this->_cacheName, $records, $this->cache); |
|
62 | - } |
|
63 | - } |
|
60 | + $records = $this->makeQuery(); |
|
61 | + App::$Cache->set($this->_cacheName, $records, $this->cache); |
|
62 | + } |
|
63 | + } |
|
64 | 64 | |
65 | - // check if result is not empty |
|
65 | + // check if result is not empty |
|
66 | 66 | if ($records === null || $records->count() < 1) { |
67 | 67 | return __('Content tags is not found'); |
68 | 68 | } |
69 | 69 | |
70 | 70 | // render view |
71 | - return App::$View->render($this->tpl, [ |
|
72 | - 'records' => $records |
|
73 | - ]); |
|
71 | + return App::$View->render($this->tpl, [ |
|
72 | + 'records' => $records |
|
73 | + ]); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -80,12 +80,12 @@ discard block |
||
80 | 80 | private function makeQuery() |
81 | 81 | { |
82 | 82 | return TagRecord::select([ |
83 | - App::$Database->getConnection()->raw('SQL_CALC_FOUND_ROWS tag'), |
|
84 | - App::$Database->getConnection()->raw('COUNT(*) AS count') |
|
85 | - ])->where('lang', '=', $this->_lang) |
|
83 | + App::$Database->getConnection()->raw('SQL_CALC_FOUND_ROWS tag'), |
|
84 | + App::$Database->getConnection()->raw('COUNT(*) AS count') |
|
85 | + ])->where('lang', '=', $this->_lang) |
|
86 | 86 | ->groupBy('tag') |
87 | - ->orderBy('count', 'DESC') |
|
88 | - ->take($this->count) |
|
89 | - ->get(); |
|
87 | + ->orderBy('count', 'DESC') |
|
88 | + ->take($this->count) |
|
89 | + ->get(); |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 | \ No newline at end of file |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php return [ |
2 | - 'instances' => [ |
|
3 | - 'Apps\Controller\Front\Content::buildSitemapSchedule' => 10800, |
|
4 | - 'Apps\Controller\Front\Profile::buildSitemapSchedule' => 10800, |
|
5 | - 'Apps\Controller\Front\Profile::cleanupTablesSchedule' => 86400 |
|
6 | - ] |
|
2 | + 'instances' => [ |
|
3 | + 'Apps\Controller\Front\Content::buildSitemapSchedule' => 10800, |
|
4 | + 'Apps\Controller\Front\Profile::buildSitemapSchedule' => 10800, |
|
5 | + 'Apps\Controller\Front\Profile::cleanupTablesSchedule' => 86400 |
|
6 | + ] |
|
7 | 7 | ]; |
8 | 8 | \ No newline at end of file |
@@ -1,41 +1,41 @@ |
||
1 | 1 | <?php return [ |
2 | - 'baseProto' => 'http', |
|
3 | - 'baseDomain' => 'ffcms.app', |
|
4 | - 'basePath' => '/', |
|
5 | - 'passwordSalt' => '$2a$07$2NJgci5A7NI9m2J9Ii92a1I3DiH6$', |
|
6 | - 'timezone' => 'Europe/Moscow', |
|
7 | - 'adminEmail' => '[email protected]', |
|
8 | - 'debug' => [ |
|
9 | - 'all' => false, |
|
10 | - 'cookie' => [ |
|
11 | - 'key' => 'fdebug_jepP2', |
|
12 | - 'value' => 'pOH1Kj18fHN7mk9a81F32eJbl9d3AeDjLC1g7poPGE22Ii6pI68P5B6O5hKMofnLPB0lFdpo2a2o78NhedjGA' |
|
13 | - ] |
|
14 | - ], |
|
15 | - 'userCron' => 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 | - 'baseLanguage' => 'en', |
|
31 | - 'multiLanguage' => true, |
|
32 | - 'singleLanguage' => 'en', |
|
33 | - 'languages' => [ |
|
34 | - 'en', |
|
35 | - 'ru' |
|
36 | - ], |
|
37 | - 'languageDomainAlias' => false, |
|
38 | - 'gaClientId' => '570934480862-son8fr180fr6u6tlt9iqpjpoesngro0o.apps.googleusercontent.com', |
|
39 | - 'gaTrackId' => false, |
|
40 | - 'trustedProxy' => false |
|
2 | + 'baseProto' => 'http', |
|
3 | + 'baseDomain' => 'ffcms.app', |
|
4 | + 'basePath' => '/', |
|
5 | + 'passwordSalt' => '$2a$07$2NJgci5A7NI9m2J9Ii92a1I3DiH6$', |
|
6 | + 'timezone' => 'Europe/Moscow', |
|
7 | + 'adminEmail' => '[email protected]', |
|
8 | + 'debug' => [ |
|
9 | + 'all' => false, |
|
10 | + 'cookie' => [ |
|
11 | + 'key' => 'fdebug_jepP2', |
|
12 | + 'value' => 'pOH1Kj18fHN7mk9a81F32eJbl9d3AeDjLC1g7poPGE22Ii6pI68P5B6O5hKMofnLPB0lFdpo2a2o78NhedjGA' |
|
13 | + ] |
|
14 | + ], |
|
15 | + 'userCron' => 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 | + 'baseLanguage' => 'en', |
|
31 | + 'multiLanguage' => true, |
|
32 | + 'singleLanguage' => 'en', |
|
33 | + 'languages' => [ |
|
34 | + 'en', |
|
35 | + 'ru' |
|
36 | + ], |
|
37 | + 'languageDomainAlias' => false, |
|
38 | + 'gaClientId' => '570934480862-son8fr180fr6u6tlt9iqpjpoesngro0o.apps.googleusercontent.com', |
|
39 | + 'gaTrackId' => false, |
|
40 | + 'trustedProxy' => false |
|
41 | 41 | ]; |
42 | 42 | \ No newline at end of file |
@@ -22,23 +22,23 @@ discard block |
||
22 | 22 | |
23 | 23 | private $_cacheName; |
24 | 24 | |
25 | - /** |
|
26 | - * Set default configs if not passed |
|
27 | - * {@inheritDoc} |
|
28 | - * @see \Ffcms\Core\Arch\Widget::init() |
|
29 | - */ |
|
25 | + /** |
|
26 | + * Set default configs if not passed |
|
27 | + * {@inheritDoc} |
|
28 | + * @see \Ffcms\Core\Arch\Widget::init() |
|
29 | + */ |
|
30 | 30 | public function init() |
31 | 31 | { |
32 | - $cfg = $this->getConfigs(); |
|
33 | - if ($this->snippet === null) { |
|
34 | - $this->snippet = $cfg['snippet']; |
|
35 | - } |
|
36 | - if ($this->count === null) { |
|
37 | - $this->count = $cfg['count']; |
|
38 | - } |
|
39 | - if ($this->cache === null) { |
|
40 | - $this->cache = $cfg['cache']; |
|
41 | - } |
|
32 | + $cfg = $this->getConfigs(); |
|
33 | + if ($this->snippet === null) { |
|
34 | + $this->snippet = $cfg['snippet']; |
|
35 | + } |
|
36 | + if ($this->count === null) { |
|
37 | + $this->count = $cfg['count']; |
|
38 | + } |
|
39 | + if ($this->cache === null) { |
|
40 | + $this->cache = $cfg['cache']; |
|
41 | + } |
|
42 | 42 | if ($this->lang === null) { |
43 | 43 | $this->lang = App::$Request->getLanguage(); |
44 | 44 | } |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | // render view |
77 | - return App::$View->render('widgets/newcomment/default', [ |
|
78 | - 'records' => $records, |
|
79 | - 'snippet' => $this->snippet |
|
80 | - ]); |
|
77 | + return App::$View->render('widgets/newcomment/default', [ |
|
78 | + 'records' => $records, |
|
79 | + 'snippet' => $this->snippet |
|
80 | + ]); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |