@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php namespace EvolutionCMS\Controllers\Resources; |
2 | 2 | |
3 | -use EvolutionCMS\Models; |
|
4 | 3 | use EvolutionCMS\Controllers\AbstractResources; |
5 | 4 | use EvolutionCMS\Interfaces\ManagerTheme\TabControllerInterface; |
6 | -use Illuminate\Support\Collection; |
|
5 | +use EvolutionCMS\Models; |
|
7 | 6 | use Illuminate\Database\Eloquent; |
7 | +use Illuminate\Support\Collection; |
|
8 | 8 | |
9 | 9 | //'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')), |
10 | 10 | class Plugins extends AbstractResources implements TabControllerInterface |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | */ |
17 | 17 | public function getTabName($withIndex = true): string |
18 | 18 | { |
19 | - return 'tabPlugins' . ($withIndex ? '-' . $this->getIndex() : ''); |
|
19 | + return 'tabPlugins'.($withIndex ? '-'.$this->getIndex() : ''); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | protected function parameterCategories(): Collection |
67 | 67 | { |
68 | 68 | return Models\Category::with('plugins') |
69 | - ->whereHas('plugins', function (Eloquent\Builder $builder) { |
|
69 | + ->whereHas('plugins', function(Eloquent\Builder $builder){ |
|
70 | 70 | return $builder->lockedView(); |
71 | 71 | })->orderBy('rank', 'ASC') |
72 | 72 | ->get(); |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | protected function checkOldPlugins(): bool |
76 | 76 | { |
77 | 77 | $p = Models\SitePlugin::disabledAlternative()->get(); |
78 | - return (bool)$p->count(function($alternative){ |
|
79 | - return (int)($alternative->count() > 0); |
|
78 | + return (bool) $p->count(function($alternative){ |
|
79 | + return (int) ($alternative->count() > 0); |
|
80 | 80 | }); |
81 | 81 | } |
82 | 82 | } |
@@ -66,7 +66,7 @@ |
||
66 | 66 | protected function parameterCategories(): Collection |
67 | 67 | { |
68 | 68 | return Models\Category::with('plugins') |
69 | - ->whereHas('plugins', function (Eloquent\Builder $builder) { |
|
69 | + ->whereHas('plugins', function (Eloquent\Builder $builder){ |
|
70 | 70 | return $builder->lockedView(); |
71 | 71 | })->orderBy('rank', 'ASC') |
72 | 72 | ->get(); |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php namespace EvolutionCMS\Controllers\Resources; |
2 | 2 | |
3 | -use EvolutionCMS\Models; |
|
4 | 3 | use EvolutionCMS\Controllers\AbstractResources; |
5 | 4 | use EvolutionCMS\Interfaces\ManagerTheme\TabControllerInterface; |
6 | -use Illuminate\Support\Collection; |
|
5 | +use EvolutionCMS\Models; |
|
7 | 6 | use Illuminate\Database\Eloquent; |
7 | +use Illuminate\Support\Collection; |
|
8 | 8 | |
9 | 9 | //'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')), |
10 | 10 | class Snippets extends AbstractResources implements TabControllerInterface |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | */ |
17 | 17 | public function getTabName($withIndex = true): string |
18 | 18 | { |
19 | - return 'tabSnippets' . ($withIndex ? '-' . $this->getIndex() : ''); |
|
19 | + return 'tabSnippets'.($withIndex ? '-'.$this->getIndex() : ''); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | protected function parameterCategories() : Collection |
66 | 66 | { |
67 | 67 | return Models\Category::with('snippets') |
68 | - ->whereHas('snippets', function (Eloquent\Builder $builder) { |
|
68 | + ->whereHas('snippets', function(Eloquent\Builder $builder){ |
|
69 | 69 | return $builder->lockedView(); |
70 | 70 | })->orderBy('rank', 'ASC') |
71 | 71 | ->get(); |
@@ -65,7 +65,7 @@ |
||
65 | 65 | protected function parameterCategories() : Collection |
66 | 66 | { |
67 | 67 | return Models\Category::with('snippets') |
68 | - ->whereHas('snippets', function (Eloquent\Builder $builder) { |
|
68 | + ->whereHas('snippets', function (Eloquent\Builder $builder){ |
|
69 | 69 | return $builder->lockedView(); |
70 | 70 | })->orderBy('rank', 'ASC') |
71 | 71 | ->get(); |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php namespace EvolutionCMS\Controllers\Resources; |
2 | 2 | |
3 | -use EvolutionCMS\Models; |
|
4 | 3 | use EvolutionCMS\Controllers\AbstractResources; |
5 | 4 | use EvolutionCMS\Interfaces\ManagerTheme\TabControllerInterface; |
6 | -use Illuminate\Support\Collection; |
|
5 | +use EvolutionCMS\Models; |
|
7 | 6 | use Illuminate\Database\Eloquent; |
7 | +use Illuminate\Support\Collection; |
|
8 | 8 | |
9 | 9 | //'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ), |
10 | 10 | class Templates extends AbstractResources implements TabControllerInterface |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | */ |
17 | 17 | public function getTabName($withIndex = true): string |
18 | 18 | { |
19 | - return 'tabTemplates' . ($withIndex ? '-' . $this->getIndex() : ''); |
|
19 | + return 'tabTemplates'.($withIndex ? '-'.$this->getIndex() : ''); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | protected function parameterCategories() : Collection |
66 | 66 | { |
67 | 67 | return Models\Category::with('templates') |
68 | - ->whereHas('templates', function (Eloquent\Builder $builder) { |
|
68 | + ->whereHas('templates', function(Eloquent\Builder $builder){ |
|
69 | 69 | return $builder->lockedView(); |
70 | 70 | })->orderBy('rank', 'ASC') |
71 | 71 | ->get(); |
@@ -65,7 +65,7 @@ |
||
65 | 65 | protected function parameterCategories() : Collection |
66 | 66 | { |
67 | 67 | return Models\Category::with('templates') |
68 | - ->whereHas('templates', function (Eloquent\Builder $builder) { |
|
68 | + ->whereHas('templates', function (Eloquent\Builder $builder){ |
|
69 | 69 | return $builder->lockedView(); |
70 | 70 | })->orderBy('rank', 'ASC') |
71 | 71 | ->get(); |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php namespace EvolutionCMS\Controllers\Resources; |
2 | 2 | |
3 | -use EvolutionCMS\Models; |
|
4 | 3 | use EvolutionCMS\Controllers\AbstractResources; |
5 | 4 | use EvolutionCMS\Interfaces\ManagerTheme\TabControllerInterface; |
6 | -use Illuminate\Support\Collection; |
|
5 | +use EvolutionCMS\Models; |
|
7 | 6 | use Illuminate\Database\Eloquent; |
7 | +use Illuminate\Support\Collection; |
|
8 | 8 | |
9 | 9 | //'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')), |
10 | 10 | class Tv extends AbstractResources implements TabControllerInterface |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | */ |
17 | 17 | public function getTabName($withIndex = true): string |
18 | 18 | { |
19 | - return 'tabVariables' . ($withIndex ? '-' . $this->getIndex() : ''); |
|
19 | + return 'tabVariables'.($withIndex ? '-'.$this->getIndex() : ''); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | protected function parameterCategories(): Collection |
67 | 67 | { |
68 | 68 | return Models\Category::with('tvs.templates') |
69 | - ->whereHas('tvs', function (Eloquent\Builder $builder) { |
|
69 | + ->whereHas('tvs', function(Eloquent\Builder $builder){ |
|
70 | 70 | return $builder->lockedView(); |
71 | 71 | })->orderBy('rank', 'ASC') |
72 | 72 | ->get(); |
@@ -66,7 +66,7 @@ |
||
66 | 66 | protected function parameterCategories(): Collection |
67 | 67 | { |
68 | 68 | return Models\Category::with('tvs.templates') |
69 | - ->whereHas('tvs', function (Eloquent\Builder $builder) { |
|
69 | + ->whereHas('tvs', function (Eloquent\Builder $builder){ |
|
70 | 70 | return $builder->lockedView(); |
71 | 71 | })->orderBy('rank', 'ASC') |
72 | 72 | ->get(); |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php namespace EvolutionCMS\Controllers; |
2 | 2 | |
3 | -use EvolutionCMS\Models; |
|
4 | 3 | use EvolutionCMS\Interfaces\ManagerTheme; |
4 | +use EvolutionCMS\Models; |
|
5 | 5 | |
6 | 6 | class SiteSchedule extends AbstractController implements ManagerTheme\PageControllerInterface |
7 | 7 | { |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php namespace EvolutionCMS\Controllers; |
2 | 2 | |
3 | -use EvolutionCMS\Models; |
|
4 | 3 | use EvolutionCMS\Interfaces\ManagerTheme; |
4 | +use EvolutionCMS\Models; |
|
5 | 5 | use Illuminate\Support\Collection; |
6 | 6 | |
7 | 7 | class Snippet extends AbstractController implements ManagerTheme\PageControllerInterface |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | if ($data->exists) { |
85 | 85 | if (empty($data->count())) { |
86 | - $this->managerTheme->alertAndQuit('Snippet not found for id ' . $id . '.', false); |
|
86 | + $this->managerTheme->alertAndQuit('Snippet not found for id '.$id.'.', false); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | $_SESSION['itemname'] = $data->name; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $out = implode('', $out); |
179 | 179 | } |
180 | 180 | |
181 | - return (string)$out; |
|
181 | + return (string) $out; |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | protected function parameterActionButtons() |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php namespace EvolutionCMS\Controllers; |
2 | 2 | |
3 | -use EvolutionCMS\Interfaces\ManagerThemeInterface; |
|
4 | 3 | use EvolutionCMS\Interfaces\ManagerTheme; |
4 | +use EvolutionCMS\Interfaces\ManagerThemeInterface; |
|
5 | 5 | use Illuminate\Support\Collection; |
6 | 6 | |
7 | 7 | class SystemInfo extends AbstractController implements ManagerTheme\PageControllerInterface |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | protected function parameterTablesInfo() : array |
59 | 59 | { |
60 | 60 | $prefix = $this->database->escape($this->database->getConfig('prefix')); |
61 | - $sql = 'SHOW TABLE STATUS FROM `' . $this->database->getConfig('database') . '` LIKE "' . $prefix . '%"'; |
|
61 | + $sql = 'SHOW TABLE STATUS FROM `'.$this->database->getConfig('database').'` LIKE "'.$prefix.'%"'; |
|
62 | 62 | |
63 | 63 | return $this->database->makeArray( |
64 | 64 | $this->database->query($sql) |
@@ -97,12 +97,12 @@ discard block |
||
97 | 97 | ], |
98 | 98 | 'PHP Version' => [ |
99 | 99 | 'data' => phpversion(), |
100 | - 'render' => 'manager::' . $this->getView() . '.phpversion' |
|
100 | + 'render' => 'manager::'.$this->getView().'.phpversion' |
|
101 | 101 | ], |
102 | 102 | 'access_permissions' => [ |
103 | 103 | 'is_lexicon' => true, |
104 | 104 | 'data' => $this->managerTheme->getLexicon( |
105 | - (bool)$this->managerTheme->getCore()->getConfig('use_udperms') ? 'enabled' : 'disabled' |
|
105 | + (bool) $this->managerTheme->getCore()->getConfig('use_udperms') ? 'enabled' : 'disabled' |
|
106 | 106 | ) |
107 | 107 | ], |
108 | 108 | 'servertime' => [ |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | ], |
116 | 116 | 'serveroffset' => [ |
117 | 117 | 'is_lexicon' => true, |
118 | - 'data' => $this->managerTheme->getCore()->getConfig('server_offset_time') / (60 * 60) . ' h' |
|
118 | + 'data' => $this->managerTheme->getCore()->getConfig('server_offset_time') / (60 * 60).' h' |
|
119 | 119 | ], |
120 | 120 | 'database_name' => [ |
121 | 121 | 'is_lexicon' => true, |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php namespace EvolutionCMS\Controllers; |
2 | 2 | |
3 | -use EvolutionCMS\Models; |
|
4 | 3 | use EvolutionCMS\Interfaces\ManagerTheme; |
4 | +use EvolutionCMS\Models; |
|
5 | 5 | |
6 | 6 | class SystemSettings extends AbstractController implements ManagerTheme\PageControllerInterface |
7 | 7 | { |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | // load templates |
68 | 68 | $rs = $database->query(' |
69 | 69 | SELECT t.templatename, t.id, c.category |
70 | - FROM ' . $database->getFullTableName('site_templates') . ' AS t |
|
71 | - LEFT JOIN ' . $database->getFullTableName('categories') . ' AS c ON t.category=c.id |
|
70 | + FROM ' . $database->getFullTableName('site_templates').' AS t |
|
71 | + LEFT JOIN ' . $database->getFullTableName('categories').' AS c ON t.category=c.id |
|
72 | 72 | ORDER BY c.category, t.templatename ASC |
73 | 73 | '); |
74 | 74 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | protected function parameterLang() |
114 | 114 | { |
115 | 115 | $lang_keys_select = []; |
116 | - $dir = dir(MODX_MANAGER_PATH . 'includes/lang'); |
|
116 | + $dir = dir(MODX_MANAGER_PATH.'includes/lang'); |
|
117 | 117 | while ($file = $dir->read()) { |
118 | 118 | if (strpos($file, '.inc.php') > 0) { |
119 | 119 | $endpos = strpos($file, '.'); |
@@ -143,9 +143,9 @@ discard block |
||
143 | 143 | protected function parameterThemes() |
144 | 144 | { |
145 | 145 | $themes = []; |
146 | - $dir = dir(MODX_MANAGER_PATH . 'media/style/'); |
|
146 | + $dir = dir(MODX_MANAGER_PATH.'media/style/'); |
|
147 | 147 | while ($file = $dir->read()) { |
148 | - if ($file !== "." && $file !== ".." && is_dir(MODX_MANAGER_PATH . 'media/style/' . $file) && substr($file, |
|
148 | + if ($file !== "." && $file !== ".." && is_dir(MODX_MANAGER_PATH.'media/style/'.$file) && substr($file, |
|
149 | 149 | 0, 1) != '.') { |
150 | 150 | if ($file === 'common') { |
151 | 151 | continue; |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | protected function parameterFileBrowsers() |
162 | 162 | { |
163 | 163 | $out = []; |
164 | - foreach (glob(MODX_MANAGER_PATH . 'media/browser/*', GLOB_ONLYDIR) as $dir) { |
|
164 | + foreach (glob(MODX_MANAGER_PATH.'media/browser/*', GLOB_ONLYDIR) as $dir) { |
|
165 | 165 | $dir = str_replace('\\', '/', $dir); |
166 | 166 | $out[] = substr($dir, strrpos($dir, '/') + 1); |
167 | 167 | } |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $this->managerTheme->getCore()->config |
182 | 182 | ); |
183 | 183 | |
184 | - $out['filemanager_path'] = str_replace( |
|
184 | + $out['filemanager_path'] = str_replace( |
|
185 | 185 | MODX_BASE_PATH, |
186 | 186 | '[(base_path)]', |
187 | 187 | get_by_key($out, 'filemanager_path') |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | get_by_key($out, 'rb_base_dir') |
194 | 194 | ); |
195 | 195 | |
196 | - if (! $this->parameterCheckGD()) { |
|
196 | + if (!$this->parameterCheckGD()) { |
|
197 | 197 | $out['use_captcha'] = 0; |
198 | 198 | } |
199 | 199 |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php namespace EvolutionCMS\Controllers; |
2 | 2 | |
3 | -use EvolutionCMS\Models; |
|
4 | 3 | use EvolutionCMS\Interfaces\ManagerTheme; |
5 | -use Illuminate\Support\Collection; |
|
4 | +use EvolutionCMS\Models; |
|
6 | 5 | use Illuminate\Database\Eloquent; |
6 | +use Illuminate\Support\Collection; |
|
7 | 7 | |
8 | 8 | class Template extends AbstractController implements ManagerTheme\PageControllerInterface |
9 | 9 | { |
@@ -63,12 +63,12 @@ discard block |
||
63 | 63 | 'categories' => $this->parameterCategories(), |
64 | 64 | 'tvSelected' => $this->parameterTvSelected(), |
65 | 65 | 'categoriesWithTv' => $this->parameterCategoriesWithTv( |
66 | - $this->object->tvs->reject(function (Models\SiteTmplvar $item) { |
|
66 | + $this->object->tvs->reject(function(Models\SiteTmplvar $item){ |
|
67 | 67 | return $item->category === 0; |
68 | 68 | })->pluck('id')->toArray() |
69 | 69 | ), |
70 | 70 | 'tvOutCategory' => $this->parameterTvOutCategory( |
71 | - $this->object->tvs->reject(function (Models\SiteTmplvar $item) { |
|
71 | + $this->object->tvs->reject(function(Models\SiteTmplvar $item){ |
|
72 | 72 | return $item->category !== 0; |
73 | 73 | })->pluck('id')->toArray() |
74 | 74 | ), |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | /** @var Models\SiteTemplate $data */ |
91 | 91 | $data = Models\SiteTemplate::with('tvs') |
92 | 92 | ->firstOrNew(['id' => $id], [ |
93 | - 'category' => (int)get_by_key($_REQUEST, 'catid', 0), |
|
93 | + 'category' => (int) get_by_key($_REQUEST, 'catid', 0), |
|
94 | 94 | 'selectable' => 1 |
95 | 95 | ]); |
96 | 96 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $ignore |
150 | 150 | ) { |
151 | 151 | if (!empty($ignore)) { |
152 | - $builder = $builder->whereNotIn((new Models\SiteTmplvar)->getTable() . '.id', $ignore); |
|
152 | + $builder = $builder->whereNotIn((new Models\SiteTmplvar)->getTable().'.id', $ignore); |
|
153 | 153 | } |
154 | 154 | return $builder; |
155 | 155 | }) |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $out = implode('', $out); |
180 | 180 | } |
181 | 181 | |
182 | - return (string)$out; |
|
182 | + return (string) $out; |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | protected function parameterActionButtons() |
@@ -63,12 +63,12 @@ discard block |
||
63 | 63 | 'categories' => $this->parameterCategories(), |
64 | 64 | 'tvSelected' => $this->parameterTvSelected(), |
65 | 65 | 'categoriesWithTv' => $this->parameterCategoriesWithTv( |
66 | - $this->object->tvs->reject(function (Models\SiteTmplvar $item) { |
|
66 | + $this->object->tvs->reject(function (Models\SiteTmplvar $item){ |
|
67 | 67 | return $item->category === 0; |
68 | 68 | })->pluck('id')->toArray() |
69 | 69 | ), |
70 | 70 | 'tvOutCategory' => $this->parameterTvOutCategory( |
71 | - $this->object->tvs->reject(function (Models\SiteTmplvar $item) { |
|
71 | + $this->object->tvs->reject(function (Models\SiteTmplvar $item){ |
|
72 | 72 | return $item->category !== 0; |
73 | 73 | })->pluck('id')->toArray() |
74 | 74 | ), |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | ->whereHas('tvs', function(Eloquent\Builder $builder) use |
148 | 148 | ( |
149 | 149 | $ignore |
150 | - ) { |
|
150 | + ){ |
|
151 | 151 | if (!empty($ignore)) { |
152 | 152 | $builder = $builder->whereNotIn((new Models\SiteTmplvar)->getTable() . '.id', $ignore); |
153 | 153 | } |