@@ -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 | /** |
@@ -1,69 +1,69 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return array ( |
4 | - 0 => 'global/write', |
|
5 | - 1 => 'global/modify', |
|
6 | - 2 => 'global/file', |
|
7 | - 3 => 'global/all', |
|
8 | - 4 => 'Admin/Application/Index', |
|
9 | - 5 => 'Admin/Application/Install', |
|
10 | - 6 => 'Admin/Application/Update', |
|
11 | - 7 => 'Admin/Application/Turn', |
|
12 | - 8 => 'Admin/Comments/Index', |
|
13 | - 9 => 'Admin/Comments/Read', |
|
14 | - 10 => 'Admin/Comments/Edit', |
|
15 | - 11 => 'Admin/Comments/Delete', |
|
16 | - 12 => 'Admin/Comments/Publish', |
|
17 | - 13 => 'Admin/Comments/Answerlist', |
|
18 | - 14 => 'Admin/Comments/Settings', |
|
19 | - 15 => 'Admin/Content/Index', |
|
20 | - 16 => 'Admin/Content/Update', |
|
21 | - 17 => 'Admin/Content/Delete', |
|
22 | - 18 => 'Admin/Content/Restore', |
|
23 | - 19 => 'Admin/Content/Clear', |
|
24 | - 20 => 'Admin/Content/Categories', |
|
25 | - 21 => 'Admin/Content/Categorydelete', |
|
26 | - 22 => 'Admin/Content/Categoryupdate', |
|
27 | - 23 => 'Admin/Content/Globdelete', |
|
28 | - 24 => 'Admin/Content/Publish', |
|
29 | - 25 => 'Admin/Content/Settings', |
|
30 | - 26 => 'Admin/Contenttag/Index', |
|
31 | - 27 => 'Admin/Feedback/Index', |
|
32 | - 28 => 'Admin/Feedback/Read', |
|
33 | - 29 => 'Admin/Feedback/Update', |
|
34 | - 30 => 'Admin/Feedback/Turn', |
|
35 | - 31 => 'Admin/Feedback/Delete', |
|
36 | - 32 => 'Admin/Feedback/Settings', |
|
37 | - 33 => 'Admin/Main/Index', |
|
38 | - 34 => 'Admin/Main/Settings', |
|
39 | - 35 => 'Admin/Main/Files', |
|
40 | - 36 => 'Admin/Main/Antivirus', |
|
41 | - 37 => 'Admin/Main/Debugcookie', |
|
42 | - 38 => 'Admin/Main/Routing', |
|
43 | - 39 => 'Admin/Main/Addroute', |
|
44 | - 40 => 'Admin/Main/Deleteroute', |
|
45 | - 41 => 'Admin/Main/Cache', |
|
46 | - 42 => 'Admin/Main/Sessions', |
|
47 | - 43 => 'Admin/Newcomment/Index', |
|
48 | - 44 => 'Admin/Newcontent/Index', |
|
49 | - 45 => 'Admin/Profile/Index', |
|
50 | - 46 => 'Admin/Profile/Delete', |
|
51 | - 47 => 'Admin/Profile/Update', |
|
52 | - 48 => 'Admin/Profile/Fieldlist', |
|
53 | - 49 => 'Admin/Profile/Fieldupdate', |
|
54 | - 50 => 'Admin/Profile/Fielddelete', |
|
55 | - 51 => 'Admin/Profile/Settings', |
|
56 | - 52 => 'Admin/Search/Index', |
|
57 | - 53 => 'Admin/Sitemap/Index', |
|
58 | - 54 => 'Admin/User/Index', |
|
59 | - 55 => 'Admin/User/Update', |
|
60 | - 56 => 'Admin/User/Delete', |
|
61 | - 57 => 'Admin/User/Grouplist', |
|
62 | - 58 => 'Admin/User/GroupUpdate', |
|
63 | - 59 => 'Admin/User/Settings', |
|
64 | - 60 => 'Admin/User/Invite', |
|
65 | - 61 => 'Admin/Widget/Index', |
|
66 | - 62 => 'Admin/Widget/Install', |
|
67 | - 63 => 'Admin/Widget/Update', |
|
68 | - 64 => 'Admin/Widget/Turn', |
|
4 | + 0 => 'global/write', |
|
5 | + 1 => 'global/modify', |
|
6 | + 2 => 'global/file', |
|
7 | + 3 => 'global/all', |
|
8 | + 4 => 'Admin/Application/Index', |
|
9 | + 5 => 'Admin/Application/Install', |
|
10 | + 6 => 'Admin/Application/Update', |
|
11 | + 7 => 'Admin/Application/Turn', |
|
12 | + 8 => 'Admin/Comments/Index', |
|
13 | + 9 => 'Admin/Comments/Read', |
|
14 | + 10 => 'Admin/Comments/Edit', |
|
15 | + 11 => 'Admin/Comments/Delete', |
|
16 | + 12 => 'Admin/Comments/Publish', |
|
17 | + 13 => 'Admin/Comments/Answerlist', |
|
18 | + 14 => 'Admin/Comments/Settings', |
|
19 | + 15 => 'Admin/Content/Index', |
|
20 | + 16 => 'Admin/Content/Update', |
|
21 | + 17 => 'Admin/Content/Delete', |
|
22 | + 18 => 'Admin/Content/Restore', |
|
23 | + 19 => 'Admin/Content/Clear', |
|
24 | + 20 => 'Admin/Content/Categories', |
|
25 | + 21 => 'Admin/Content/Categorydelete', |
|
26 | + 22 => 'Admin/Content/Categoryupdate', |
|
27 | + 23 => 'Admin/Content/Globdelete', |
|
28 | + 24 => 'Admin/Content/Publish', |
|
29 | + 25 => 'Admin/Content/Settings', |
|
30 | + 26 => 'Admin/Contenttag/Index', |
|
31 | + 27 => 'Admin/Feedback/Index', |
|
32 | + 28 => 'Admin/Feedback/Read', |
|
33 | + 29 => 'Admin/Feedback/Update', |
|
34 | + 30 => 'Admin/Feedback/Turn', |
|
35 | + 31 => 'Admin/Feedback/Delete', |
|
36 | + 32 => 'Admin/Feedback/Settings', |
|
37 | + 33 => 'Admin/Main/Index', |
|
38 | + 34 => 'Admin/Main/Settings', |
|
39 | + 35 => 'Admin/Main/Files', |
|
40 | + 36 => 'Admin/Main/Antivirus', |
|
41 | + 37 => 'Admin/Main/Debugcookie', |
|
42 | + 38 => 'Admin/Main/Routing', |
|
43 | + 39 => 'Admin/Main/Addroute', |
|
44 | + 40 => 'Admin/Main/Deleteroute', |
|
45 | + 41 => 'Admin/Main/Cache', |
|
46 | + 42 => 'Admin/Main/Sessions', |
|
47 | + 43 => 'Admin/Newcomment/Index', |
|
48 | + 44 => 'Admin/Newcontent/Index', |
|
49 | + 45 => 'Admin/Profile/Index', |
|
50 | + 46 => 'Admin/Profile/Delete', |
|
51 | + 47 => 'Admin/Profile/Update', |
|
52 | + 48 => 'Admin/Profile/Fieldlist', |
|
53 | + 49 => 'Admin/Profile/Fieldupdate', |
|
54 | + 50 => 'Admin/Profile/Fielddelete', |
|
55 | + 51 => 'Admin/Profile/Settings', |
|
56 | + 52 => 'Admin/Search/Index', |
|
57 | + 53 => 'Admin/Sitemap/Index', |
|
58 | + 54 => 'Admin/User/Index', |
|
59 | + 55 => 'Admin/User/Update', |
|
60 | + 56 => 'Admin/User/Delete', |
|
61 | + 57 => 'Admin/User/Grouplist', |
|
62 | + 58 => 'Admin/User/GroupUpdate', |
|
63 | + 59 => 'Admin/User/Settings', |
|
64 | + 60 => 'Admin/User/Invite', |
|
65 | + 61 => 'Admin/Widget/Index', |
|
66 | + 62 => 'Admin/Widget/Install', |
|
67 | + 63 => 'Admin/Widget/Update', |
|
68 | + 64 => 'Admin/Widget/Turn', |
|
69 | 69 | ); |
70 | 70 | \ No newline at end of file |
@@ -35,7 +35,7 @@ |
||
35 | 35 | |
36 | 36 | // render view output |
37 | 37 | return $this->view->render('index', [ |
38 | - 'model' => $model |
|
38 | + 'model' => $model |
|
39 | 39 | ]); |
40 | 40 | } |
41 | 41 | } |
42 | 42 | \ No newline at end of file |
@@ -27,8 +27,8 @@ |
||
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
30 | - * Load configs from app data |
|
31 | - */ |
|
30 | + * Load configs from app data |
|
31 | + */ |
|
32 | 32 | public function before() |
33 | 33 | { |
34 | 34 | if ($this->_config === null) { |