@@ -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 EventLog extends AbstractController implements ManagerTheme\PageControllerInterface |
7 | 7 | { |
@@ -1,8 +1,7 @@ |
||
1 | 1 | <?php namespace EvolutionCMS\Controllers; |
2 | 2 | |
3 | -use EvolutionCMS\Interfaces\ManagerTheme; |
|
3 | +use EvolutionCMS\Interfaces\ManagerTheme; |
|
4 | 4 | use EvolutionCMS\Interfaces\ManagerThemeInterface; |
5 | -use EvolutionCMS\Models; |
|
6 | 5 | |
7 | 6 | class ExportSite extends AbstractController implements ManagerTheme\PageControllerInterface |
8 | 7 | { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $output = sprintf($this->managerTheme->getLang('export_site_numberdocs'), $exportSite->total); |
49 | 49 | $output .= $exportSite->run(); |
50 | 50 | $output .= sprintf( |
51 | - '<p>' . $this->managerTheme->getLang("export_site_time") . '</p>', |
|
51 | + '<p>'.$this->managerTheme->getLang("export_site_time").'</p>', |
|
52 | 52 | round($exportSite->get_mtime() - $exportSite->exportstart, 3) |
53 | 53 | ); |
54 | 54 | } |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | |
61 | 61 | protected function setMaxTime() : int |
62 | 62 | { |
63 | - $maxTime = (int)get_by_key($_POST, 'maxtime', 30, function ($val) { |
|
64 | - return (int)$val > 0; |
|
63 | + $maxTime = (int) get_by_key($_POST, 'maxtime', 30, function($val){ |
|
64 | + return (int) $val > 0; |
|
65 | 65 | }); |
66 | 66 | @set_time_limit($maxTime); |
67 | 67 | |
@@ -70,10 +70,10 @@ discard block |
||
70 | 70 | |
71 | 71 | protected function getExportDir() : string |
72 | 72 | { |
73 | - if (is_dir(MODX_BASE_PATH . 'temp')) { |
|
74 | - $exportDir = MODX_BASE_PATH . 'temp/export'; |
|
73 | + if (is_dir(MODX_BASE_PATH.'temp')) { |
|
74 | + $exportDir = MODX_BASE_PATH.'temp/export'; |
|
75 | 75 | } else { |
76 | - $exportDir = MODX_BASE_PATH . 'assets/export'; |
|
76 | + $exportDir = MODX_BASE_PATH.'assets/export'; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | return $exportDir; |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | 0 <= \strlen(str_replace("{$exportDir}/", '', MODX_BASE_PATH)) |
91 | 91 | ) { |
92 | 92 | $out = $this->managerTheme->getLang('export_site.static.php6'); |
93 | - } elseif ($this->managerTheme->getCore()->getConfig('rb_base_dir') === $exportDir . '/') { |
|
93 | + } elseif ($this->managerTheme->getCore()->getConfig('rb_base_dir') === $exportDir.'/') { |
|
94 | 94 | $out = $this->managerTheme->getCore()->parsePlaceholder( |
95 | 95 | $this->managerTheme->getLang('export_site.static.php7'), |
96 | - 'rb_base_url=' . MODX_BASE_URL . $this->managerTheme->getCore()->getConfig('rb_base_url') |
|
96 | + 'rb_base_url='.MODX_BASE_URL.$this->managerTheme->getCore()->getConfig('rb_base_url') |
|
97 | 97 | ); |
98 | 98 | } elseif (!is_writable($exportDir)) { |
99 | 99 | $out = $this->managerTheme->getLang('export_site_target_unwritable'); |
@@ -4,8 +4,8 @@ discard block |
||
4 | 4 | use EvolutionCMS\Interfaces\ManagerThemeInterface; |
5 | 5 | use EvolutionCMS\Models; |
6 | 6 | |
7 | -class ExportSite extends AbstractController implements ManagerTheme\PageControllerInterface |
|
8 | -{ |
|
7 | +class ExportSite extends AbstractController implements ManagerTheme\PageControllerInterface |
|
8 | +{ |
|
9 | 9 | protected $view = 'page.export_site'; |
10 | 10 | |
11 | 11 | /** |
@@ -13,8 +13,8 @@ discard block |
||
13 | 13 | */ |
14 | 14 | protected $database; |
15 | 15 | |
16 | - public function __construct(ManagerThemeInterface $managerTheme, array $data = []) |
|
17 | - { |
|
16 | + public function __construct(ManagerThemeInterface $managerTheme, array $data = []) |
|
17 | + { |
|
18 | 18 | parent::__construct($managerTheme, $data); |
19 | 19 | $this->database = $this->managerTheme->getCore()->getDatabase(); |
20 | 20 | } |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | { |
40 | 40 | $this->parameters['output'] = ''; |
41 | 41 | |
42 | - if (isset($_POST['export'])) { |
|
42 | + if (isset($_POST['export'])) { |
|
43 | 43 | $this->setMaxTime(); |
44 | 44 | $exportDir = $this->getExportDir(); |
45 | - if (($output = $this->validateExportDir($exportDir)) === null) { |
|
45 | + if (($output = $this->validateExportDir($exportDir)) === null) { |
|
46 | 46 | $exportSite = $this->objectExportSite($exportDir); |
47 | 47 | |
48 | 48 | $output = sprintf($this->managerTheme->getLang('export_site_numberdocs'), $exportSite->total); |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | protected function setMaxTime() : int |
62 | 62 | { |
63 | - $maxTime = (int)get_by_key($_POST, 'maxtime', 30, function ($val) { |
|
63 | + $maxTime = (int)get_by_key($_POST, 'maxtime', 30, function ($val){ |
|
64 | 64 | return (int)$val > 0; |
65 | 65 | }); |
66 | 66 | @set_time_limit($maxTime); |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | |
71 | 71 | protected function getExportDir() : string |
72 | 72 | { |
73 | - if (is_dir(MODX_BASE_PATH . 'temp')) { |
|
73 | + if (is_dir(MODX_BASE_PATH . 'temp')) { |
|
74 | 74 | $exportDir = MODX_BASE_PATH . 'temp/export'; |
75 | - } else { |
|
75 | + } else { |
|
76 | 76 | $exportDir = MODX_BASE_PATH . 'assets/export'; |
77 | 77 | } |
78 | 78 | |
@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | $out = null; |
89 | 89 | if (strpos(MODX_BASE_PATH, "{$exportDir}/") === 0 && |
90 | 90 | 0 <= \strlen(str_replace("{$exportDir}/", '', MODX_BASE_PATH)) |
91 | - ) { |
|
91 | + ) { |
|
92 | 92 | $out = $this->managerTheme->getLang('export_site.static.php6'); |
93 | - } elseif ($this->managerTheme->getCore()->getConfig('rb_base_dir') === $exportDir . '/') { |
|
93 | + } elseif ($this->managerTheme->getCore()->getConfig('rb_base_dir') === $exportDir . '/') { |
|
94 | 94 | $out = $this->managerTheme->getCore()->parsePlaceholder( |
95 | 95 | $this->managerTheme->getLang('export_site.static.php7'), |
96 | 96 | 'rb_base_url=' . MODX_BASE_URL . $this->managerTheme->getCore()->getConfig('rb_base_url') |
97 | 97 | ); |
98 | - } elseif (!is_writable($exportDir)) { |
|
98 | + } elseif (!is_writable($exportDir)) { |
|
99 | 99 | $out = $this->managerTheme->getLang('export_site_target_unwritable'); |
100 | 100 | } |
101 | 101 |
@@ -399,6 +399,9 @@ |
||
399 | 399 | return $this; |
400 | 400 | } |
401 | 401 | |
402 | + /** |
|
403 | + * @param integer $tab |
|
404 | + */ |
|
402 | 405 | protected function menuElementTemplates($tab) |
403 | 406 | { |
404 | 407 | if ($this->managerTheme->getCore()->hasPermission('edit_template')) { |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php namespace EvolutionCMS\Controllers; |
2 | 2 | |
3 | -use EvolutionCMS\Interfaces\ManagerTheme; |
|
3 | +use EvolutionCMS\Interfaces\ManagerTheme; |
|
4 | 4 | use EvolutionCMS\Interfaces\ManagerThemeInterface; |
5 | 5 | |
6 | 6 | class Frame extends AbstractController implements ManagerTheme\PageControllerInterface |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $this->managerTheme->getCore()->setConfig('enable_debug', false); |
23 | 23 | } |
24 | 24 | if (!empty($this->frame)) { |
25 | - $this->setView('frame.' . $this->frame); |
|
25 | + $this->setView('frame.'.$this->frame); |
|
26 | 26 | } |
27 | 27 | } |
28 | 28 | |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | |
85 | 85 | $theme_modes = ['', 'lightness', 'light', 'dark', 'darkness']; |
86 | 86 | if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) { |
87 | - $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']]; |
|
87 | + $body_class .= ' '.$theme_modes[$_COOKIE['MODX_themeMode']]; |
|
88 | 88 | } elseif (!empty($theme_modes[$this->managerTheme->getCore()->getConfig('manager_theme_mode')])) { |
89 | - $body_class .= ' ' . $theme_modes[$this->managerTheme->getCore()->getConfig('manager_theme_mode')]; |
|
89 | + $body_class .= ' '.$theme_modes[$this->managerTheme->getCore()->getConfig('manager_theme_mode')]; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | $navbar_position = $this->managerTheme->getCore()->getConfig('manager_menu_position'); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | |
139 | 139 | $this->managerTheme->getCore()->setConfig( |
140 | 140 | 'global_tabs', |
141 | - (int)($this->managerTheme->getCore()->getConfig('global_tabs') && $flag) |
|
141 | + (int) ($this->managerTheme->getCore()->getConfig('global_tabs') && $flag) |
|
142 | 142 | ); |
143 | 143 | |
144 | 144 | $this->makeMenu(); |
@@ -173,29 +173,29 @@ discard block |
||
173 | 173 | |
174 | 174 | protected function registerCss(): string |
175 | 175 | { |
176 | - $this->parameters['css'] = $this->managerTheme->getThemeDir(false) . 'css/page.css?v=' . EVO_INSTALL_TIME; |
|
176 | + $this->parameters['css'] = $this->managerTheme->getThemeDir(false).'css/page.css?v='.EVO_INSTALL_TIME; |
|
177 | 177 | |
178 | 178 | if ($this->managerTheme->getTheme() === 'default') { |
179 | 179 | $themeDir = $this->managerTheme->getThemeDir(); |
180 | 180 | |
181 | - if (!file_exists($themeDir . 'css/styles.min.css') && is_writable($themeDir . 'css')) { |
|
182 | - require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php'; |
|
181 | + if (!file_exists($themeDir.'css/styles.min.css') && is_writable($themeDir.'css')) { |
|
182 | + require_once MODX_BASE_PATH.'assets/lib/Formatter/CSSMinify.php'; |
|
183 | 183 | $minifier = new \Formatter\CSSMinify(); |
184 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css'); |
|
185 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css'); |
|
186 | - $minifier->addFile($themeDir . 'css/fonts.css'); |
|
187 | - $minifier->addFile($themeDir . 'css/forms.css'); |
|
188 | - $minifier->addFile($themeDir . 'css/mainmenu.css'); |
|
189 | - $minifier->addFile($themeDir . 'css/tree.css'); |
|
190 | - $minifier->addFile($themeDir . 'css/custom.css'); |
|
191 | - $minifier->addFile($themeDir . 'css/tabpane.css'); |
|
192 | - $minifier->addFile($themeDir . 'css/contextmenu.css'); |
|
193 | - $minifier->addFile($themeDir . 'css/index.css'); |
|
194 | - $minifier->addFile($themeDir . 'css/main.css'); |
|
195 | - file_put_contents($themeDir . 'css/styles.min.css', $minifier->minify()); |
|
184 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/bootstrap/css/bootstrap.min.css'); |
|
185 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/font-awesome/css/font-awesome.min.css'); |
|
186 | + $minifier->addFile($themeDir.'css/fonts.css'); |
|
187 | + $minifier->addFile($themeDir.'css/forms.css'); |
|
188 | + $minifier->addFile($themeDir.'css/mainmenu.css'); |
|
189 | + $minifier->addFile($themeDir.'css/tree.css'); |
|
190 | + $minifier->addFile($themeDir.'css/custom.css'); |
|
191 | + $minifier->addFile($themeDir.'css/tabpane.css'); |
|
192 | + $minifier->addFile($themeDir.'css/contextmenu.css'); |
|
193 | + $minifier->addFile($themeDir.'css/index.css'); |
|
194 | + $minifier->addFile($themeDir.'css/main.css'); |
|
195 | + file_put_contents($themeDir.'css/styles.min.css', $minifier->minify()); |
|
196 | 196 | } |
197 | - if (file_exists($themeDir . 'css/styles.min.css')) { |
|
198 | - $this->parameters['css'] = $this->managerTheme->getThemeDir(false) . 'css/styles.min.css?v=' . EVO_INSTALL_TIME; |
|
197 | + if (file_exists($themeDir.'css/styles.min.css')) { |
|
198 | + $this->parameters['css'] = $this->managerTheme->getThemeDir(false).'css/styles.min.css?v='.EVO_INSTALL_TIME; |
|
199 | 199 | } |
200 | 200 | } |
201 | 201 | |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | $this->sitemenu['site'] = [ |
281 | 281 | 'site', |
282 | 282 | 'main', |
283 | - '<i class="fa fa-tachometer"></i><span class="menu-item-text">' . $this->managerTheme->getLexicon('home') . '</span>', |
|
283 | + '<i class="fa fa-tachometer"></i><span class="menu-item-text">'.$this->managerTheme->getLexicon('home').'</span>', |
|
284 | 284 | 'index.php?a=2', |
285 | 285 | $this->managerTheme->getLexicon('home'), |
286 | 286 | '', |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | $this->sitemenu['elements'] = [ |
305 | 305 | 'elements', |
306 | 306 | 'main', |
307 | - '<i class="fa fa-th"></i><span class="menu-item-text">' . $this->managerTheme->getLexicon('elements') . '</span>', |
|
307 | + '<i class="fa fa-th"></i><span class="menu-item-text">'.$this->managerTheme->getLexicon('elements').'</span>', |
|
308 | 308 | 'javascript:;', |
309 | 309 | $this->managerTheme->getLexicon('elements'), |
310 | 310 | ' return false;', |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | $this->sitemenu['modules'] = [ |
326 | 326 | 'modules', |
327 | 327 | 'main', |
328 | - '<i class="' . $this->managerTheme->getStyle('icons_modules') . '"></i><span class="menu-item-text">' . $this->managerTheme->getLexicon('modules') . '</span>', |
|
328 | + '<i class="'.$this->managerTheme->getStyle('icons_modules').'"></i><span class="menu-item-text">'.$this->managerTheme->getLexicon('modules').'</span>', |
|
329 | 329 | 'javascript:;', |
330 | 330 | $this->managerTheme->getLexicon('modules'), |
331 | 331 | ' return false;', |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | $this->sitemenu['users'] = [ |
350 | 350 | 'users', |
351 | 351 | 'main', |
352 | - '<i class="fa fa-users"></i><span class="menu-item-text">' . $this->managerTheme->getLexicon('users') . '</span>', |
|
352 | + '<i class="fa fa-users"></i><span class="menu-item-text">'.$this->managerTheme->getLexicon('users').'</span>', |
|
353 | 353 | 'javascript:;', |
354 | 354 | $this->managerTheme->getLexicon('users'), |
355 | 355 | ' return false;', |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | $this->sitemenu['tools'] = [ |
374 | 374 | 'tools', |
375 | 375 | 'main', |
376 | - '<i class="fa fa-wrench"></i><span class="menu-item-text">' . $this->managerTheme->getLexicon('tools') . '</span>', |
|
376 | + '<i class="fa fa-wrench"></i><span class="menu-item-text">'.$this->managerTheme->getLexicon('tools').'</span>', |
|
377 | 377 | 'javascript:;', |
378 | 378 | $this->managerTheme->getLexicon('tools'), |
379 | 379 | ' return false;', |
@@ -405,8 +405,8 @@ discard block |
||
405 | 405 | $this->sitemenu['element_templates'] = [ |
406 | 406 | 'element_templates', |
407 | 407 | 'elements', |
408 | - '<i class="fa fa-newspaper-o"></i>' . $this->managerTheme->getLexicon('manage_templates') . '<i class="fa fa-angle-right toggle"></i>', |
|
409 | - 'index.php?a=76&tab=' . $tab++, |
|
408 | + '<i class="fa fa-newspaper-o"></i>'.$this->managerTheme->getLexicon('manage_templates').'<i class="fa fa-angle-right toggle"></i>', |
|
409 | + 'index.php?a=76&tab='.$tab++, |
|
410 | 410 | $this->managerTheme->getLexicon('manage_templates'), |
411 | 411 | '', |
412 | 412 | 'new_template,edit_template', |
@@ -426,8 +426,8 @@ discard block |
||
426 | 426 | $this->sitemenu['element_tplvars'] = [ |
427 | 427 | 'element_tplvars', |
428 | 428 | 'elements', |
429 | - '<i class="fa fa-list-alt"></i>' . $this->managerTheme->getLexicon('tmplvars') . '<i class="fa fa-angle-right toggle"></i>', |
|
430 | - 'index.php?a=76&tab=' . $tab, |
|
429 | + '<i class="fa fa-list-alt"></i>'.$this->managerTheme->getLexicon('tmplvars').'<i class="fa fa-angle-right toggle"></i>', |
|
430 | + 'index.php?a=76&tab='.$tab, |
|
431 | 431 | $this->managerTheme->getLexicon('tmplvars'), |
432 | 432 | '', |
433 | 433 | 'new_template,edit_template', |
@@ -447,8 +447,8 @@ discard block |
||
447 | 447 | $this->sitemenu['element_htmlsnippets'] = [ |
448 | 448 | 'element_htmlsnippets', |
449 | 449 | 'elements', |
450 | - '<i class="fa fa-th-large"></i>' . $this->managerTheme->getLexicon('manage_htmlsnippets') . '<i class="fa fa-angle-right toggle"></i>', |
|
451 | - 'index.php?a=76&tab=' . $tab++, |
|
450 | + '<i class="fa fa-th-large"></i>'.$this->managerTheme->getLexicon('manage_htmlsnippets').'<i class="fa fa-angle-right toggle"></i>', |
|
451 | + 'index.php?a=76&tab='.$tab++, |
|
452 | 452 | $this->managerTheme->getLexicon('manage_htmlsnippets'), |
453 | 453 | '', |
454 | 454 | 'new_chunk,edit_chunk', |
@@ -468,8 +468,8 @@ discard block |
||
468 | 468 | $this->sitemenu['element_snippets'] = [ |
469 | 469 | 'element_snippets', |
470 | 470 | 'elements', |
471 | - '<i class="fa fa-code"></i>' . $this->managerTheme->getLexicon('manage_snippets') . '<i class="fa fa-angle-right toggle"></i>', |
|
472 | - 'index.php?a=76&tab=' . $tab++, |
|
471 | + '<i class="fa fa-code"></i>'.$this->managerTheme->getLexicon('manage_snippets').'<i class="fa fa-angle-right toggle"></i>', |
|
472 | + 'index.php?a=76&tab='.$tab++, |
|
473 | 473 | $this->managerTheme->getLexicon('manage_snippets'), |
474 | 474 | '', |
475 | 475 | 'new_snippet,edit_snippet', |
@@ -489,8 +489,8 @@ discard block |
||
489 | 489 | $this->sitemenu['element_plugins'] = [ |
490 | 490 | 'element_plugins', |
491 | 491 | 'elements', |
492 | - '<i class="fa fa-plug"></i>' . $this->managerTheme->getLexicon('manage_plugins') . '<i class="fa fa-angle-right toggle"></i>', |
|
493 | - 'index.php?a=76&tab=' . $tab++, |
|
492 | + '<i class="fa fa-plug"></i>'.$this->managerTheme->getLexicon('manage_plugins').'<i class="fa fa-angle-right toggle"></i>', |
|
493 | + 'index.php?a=76&tab='.$tab++, |
|
494 | 494 | $this->managerTheme->getLexicon('manage_plugins'), |
495 | 495 | '', |
496 | 496 | 'new_plugin,edit_plugin', |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | $this->sitemenu['manage_files'] = [ |
511 | 511 | 'manage_files', |
512 | 512 | 'elements', |
513 | - '<i class="fa fa-folder-open-o"></i>' . $this->managerTheme->getLexicon('manage_files'), |
|
513 | + '<i class="fa fa-folder-open-o"></i>'.$this->managerTheme->getLexicon('manage_files'), |
|
514 | 514 | 'index.php?a=31', |
515 | 515 | $this->managerTheme->getLexicon('manage_files'), |
516 | 516 | '', |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | $this->sitemenu['manage_categories'] = [ |
532 | 532 | 'manage_categories', |
533 | 533 | 'elements', |
534 | - '<i class="fa fa-object-group"></i>' . $this->managerTheme->getLexicon('manage_categories'), |
|
534 | + '<i class="fa fa-object-group"></i>'.$this->managerTheme->getLexicon('manage_categories'), |
|
535 | 535 | 'index.php?a=120', |
536 | 536 | $this->managerTheme->getLexicon('manage_categories'), |
537 | 537 | '', |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | $this->sitemenu['new_module'] = [ |
557 | 557 | 'new_module', |
558 | 558 | 'modules', |
559 | - '<i class="' . $this->managerTheme->getStyle('icons_modules') . '"></i>' . $this->managerTheme->getLexicon('module_management'), |
|
559 | + '<i class="'.$this->managerTheme->getStyle('icons_modules').'"></i>'.$this->managerTheme->getLexicon('module_management'), |
|
560 | 560 | 'index.php?a=106', |
561 | 561 | $this->managerTheme->getLexicon('module_management'), |
562 | 562 | '', |
@@ -576,10 +576,10 @@ discard block |
||
576 | 576 | if ($this->managerTheme->getCore()->hasPermission('exec_module')) { |
577 | 577 | if ($_SESSION['mgrRole'] != 1 && $this->managerTheme->getCore()->getConfig('use_udperms') === true) { |
578 | 578 | $rs = $this->managerTheme->getCore()->getDatabase()->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member |
579 | - FROM ' . $this->managerTheme->getCore()->getDatabase()->getFullTableName('site_modules') . ' AS sm |
|
580 | - LEFT JOIN ' . $this->managerTheme->getCore()->getDatabase()->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id |
|
581 | - LEFT JOIN ' . $this->managerTheme->getCore()->getDatabase()->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group |
|
582 | - WHERE (mg.member IS NULL OR mg.member = ' . $this->managerTheme->getCore()->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
|
579 | + FROM ' . $this->managerTheme->getCore()->getDatabase()->getFullTableName('site_modules').' AS sm |
|
580 | + LEFT JOIN ' . $this->managerTheme->getCore()->getDatabase()->getFullTableName('site_module_access').' AS sma ON sma.module = sm.id |
|
581 | + LEFT JOIN ' . $this->managerTheme->getCore()->getDatabase()->getFullTableName('member_groups').' AS mg ON sma.usergroup = mg.user_group |
|
582 | + WHERE (mg.member IS NULL OR mg.member = ' . $this->managerTheme->getCore()->getLoginUserID().') AND sm.disabled != 1 AND sm.locked != 1 |
|
583 | 583 | ORDER BY sm.name'); |
584 | 584 | } else { |
585 | 585 | $rs = $this->managerTheme->getCore()->getDatabase()->select( |
@@ -591,11 +591,11 @@ discard block |
||
591 | 591 | } |
592 | 592 | if ($this->managerTheme->getCore()->getDatabase()->getRecordCount($rs)) { |
593 | 593 | while ($row = $this->managerTheme->getCore()->getDatabase()->getRow($rs)) { |
594 | - $this->sitemenu['module' . $row['id']] = [ |
|
595 | - 'module' . $row['id'], |
|
594 | + $this->sitemenu['module'.$row['id']] = [ |
|
595 | + 'module'.$row['id'], |
|
596 | 596 | 'modules', |
597 | - ($row['icon'] != '' ? '<i class="' . $row['icon'] . '"></i>' : '<i class="' . $this->managerTheme->getStyle('icons_module') . '"></i>') . $row['name'], |
|
598 | - 'index.php?a=112&id=' . $row['id'], |
|
597 | + ($row['icon'] != '' ? '<i class="'.$row['icon'].'"></i>' : '<i class="'.$this->managerTheme->getStyle('icons_module').'"></i>').$row['name'], |
|
598 | + 'index.php?a=112&id='.$row['id'], |
|
599 | 599 | $row['name'], |
600 | 600 | '', |
601 | 601 | '', |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | $this->sitemenu['user_management_title'] = [ |
618 | 618 | 'user_management_title', |
619 | 619 | 'users', |
620 | - '<i class="fa fa fa-user"></i>' . $this->managerTheme->getLexicon('user_management_title') . '<i class="fa fa-angle-right toggle"></i>', |
|
620 | + '<i class="fa fa fa-user"></i>'.$this->managerTheme->getLexicon('user_management_title').'<i class="fa fa-angle-right toggle"></i>', |
|
621 | 621 | 'index.php?a=75', |
622 | 622 | $this->managerTheme->getLexicon('user_management_title'), |
623 | 623 | '', |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | $this->sitemenu['web_user_management_title'] = [ |
639 | 639 | 'web_user_management_title', |
640 | 640 | 'users', |
641 | - '<i class="fa fa-users"></i>' . $this->managerTheme->getLexicon('web_user_management_title') . '<i class="fa fa-angle-right toggle"></i>', |
|
641 | + '<i class="fa fa-users"></i>'.$this->managerTheme->getLexicon('web_user_management_title').'<i class="fa fa-angle-right toggle"></i>', |
|
642 | 642 | 'index.php?a=99', |
643 | 643 | $this->managerTheme->getLexicon('web_user_management_title'), |
644 | 644 | '', |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | $this->sitemenu['role_management_title'] = [ |
660 | 660 | 'role_management_title', |
661 | 661 | 'users', |
662 | - '<i class="fa fa-legal"></i>' . $this->managerTheme->getLexicon('role_management_title'), |
|
662 | + '<i class="fa fa-legal"></i>'.$this->managerTheme->getLexicon('role_management_title'), |
|
663 | 663 | 'index.php?a=86', |
664 | 664 | $this->managerTheme->getLexicon('role_management_title'), |
665 | 665 | '', |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | $this->sitemenu['manager_permissions'] = [ |
681 | 681 | 'manager_permissions', |
682 | 682 | 'users', |
683 | - '<i class="fa fa-male"></i>' . $this->managerTheme->getLexicon('manager_permissions'), |
|
683 | + '<i class="fa fa-male"></i>'.$this->managerTheme->getLexicon('manager_permissions'), |
|
684 | 684 | 'index.php?a=40', |
685 | 685 | $this->managerTheme->getLexicon('manager_permissions'), |
686 | 686 | '', |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | $this->sitemenu['web_permissions'] = [ |
702 | 702 | 'web_permissions', |
703 | 703 | 'users', |
704 | - '<i class="fa fa-universal-access"></i>' . $this->managerTheme->getLexicon('web_permissions'), |
|
704 | + '<i class="fa fa-universal-access"></i>'.$this->managerTheme->getLexicon('web_permissions'), |
|
705 | 705 | 'index.php?a=91', |
706 | 706 | $this->managerTheme->getLexicon('web_permissions'), |
707 | 707 | '', |
@@ -721,7 +721,7 @@ discard block |
||
721 | 721 | $this->sitemenu['refresh_site'] = [ |
722 | 722 | 'refresh_site', |
723 | 723 | 'tools', |
724 | - '<i class="fa fa-recycle"></i>' . $this->managerTheme->getLexicon('refresh_site'), |
|
724 | + '<i class="fa fa-recycle"></i>'.$this->managerTheme->getLexicon('refresh_site'), |
|
725 | 725 | 'index.php?a=26', |
726 | 726 | $this->managerTheme->getLexicon('refresh_site'), |
727 | 727 | '', |
@@ -738,7 +738,7 @@ discard block |
||
738 | 738 | // href |
739 | 739 | 'btn btn-secondary', |
740 | 740 | // class or btn-success |
741 | - 'modx.popup({url:\'index.php?a=26\', title:\'' . $this->managerTheme->getLexicon('refresh_site') . '\', icon: \'fa-recycle\', iframe: \'ajax\', selector: \'.tab-page>.container\', position: \'right top\', width: \'auto\', maxheight: \'50%\', wrap: \'body\' })', |
|
741 | + 'modx.popup({url:\'index.php?a=26\', title:\''.$this->managerTheme->getLexicon('refresh_site').'\', icon: \'fa-recycle\', iframe: \'ajax\', selector: \'.tab-page>.container\', position: \'right top\', width: \'auto\', maxheight: \'50%\', wrap: \'body\' })', |
|
742 | 742 | // onclick |
743 | 743 | $this->managerTheme->getLexicon('refresh_site'), |
744 | 744 | // title |
@@ -756,7 +756,7 @@ discard block |
||
756 | 756 | $this->sitemenu['search'] = [ |
757 | 757 | 'search', |
758 | 758 | 'tools', |
759 | - '<i class="fa fa-search"></i>' . $this->managerTheme->getLexicon('search'), |
|
759 | + '<i class="fa fa-search"></i>'.$this->managerTheme->getLexicon('search'), |
|
760 | 760 | 'index.php?a=71', |
761 | 761 | $this->managerTheme->getLexicon('search'), |
762 | 762 | '', |
@@ -776,7 +776,7 @@ discard block |
||
776 | 776 | $this->sitemenu['bk_manager'] = [ |
777 | 777 | 'bk_manager', |
778 | 778 | 'tools', |
779 | - '<i class="fa fa-database"></i>' . $this->managerTheme->getLexicon('bk_manager'), |
|
779 | + '<i class="fa fa-database"></i>'.$this->managerTheme->getLexicon('bk_manager'), |
|
780 | 780 | 'index.php?a=93', |
781 | 781 | $this->managerTheme->getLexicon('bk_manager'), |
782 | 782 | '', |
@@ -797,7 +797,7 @@ discard block |
||
797 | 797 | $this->sitemenu['remove_locks'] = [ |
798 | 798 | 'remove_locks', |
799 | 799 | 'tools', |
800 | - '<i class="fa fa-hourglass"></i>' . $this->managerTheme->getLexicon('remove_locks'), |
|
800 | + '<i class="fa fa-hourglass"></i>'.$this->managerTheme->getLexicon('remove_locks'), |
|
801 | 801 | 'javascript:modx.removeLocks();', |
802 | 802 | $this->managerTheme->getLexicon('remove_locks'), |
803 | 803 | '', |
@@ -818,7 +818,7 @@ discard block |
||
818 | 818 | $this->sitemenu['import_site'] = [ |
819 | 819 | 'import_site', |
820 | 820 | 'tools', |
821 | - '<i class="fa fa-upload"></i>' . $this->managerTheme->getLexicon('import_site'), |
|
821 | + '<i class="fa fa-upload"></i>'.$this->managerTheme->getLexicon('import_site'), |
|
822 | 822 | 'index.php?a=95', |
823 | 823 | $this->managerTheme->getLexicon('import_site'), |
824 | 824 | '', |
@@ -839,7 +839,7 @@ discard block |
||
839 | 839 | $this->sitemenu['export_site'] = [ |
840 | 840 | 'export_site', |
841 | 841 | 'tools', |
842 | - '<i class="fa fa-download"></i>' . $this->managerTheme->getLexicon('export_site'), |
|
842 | + '<i class="fa fa-download"></i>'.$this->managerTheme->getLexicon('export_site'), |
|
843 | 843 | 'index.php?a=83', |
844 | 844 | $this->managerTheme->getLexicon('export_site'), |
845 | 845 | '', |
@@ -3,25 +3,25 @@ discard block |
||
3 | 3 | use EvolutionCMS\Interfaces\ManagerTheme; |
4 | 4 | use EvolutionCMS\Interfaces\ManagerThemeInterface; |
5 | 5 | |
6 | -class Frame extends AbstractController implements ManagerTheme\PageControllerInterface |
|
7 | -{ |
|
6 | +class Frame extends AbstractController implements ManagerTheme\PageControllerInterface |
|
7 | +{ |
|
8 | 8 | protected $view; |
9 | 9 | |
10 | 10 | protected $frame; |
11 | 11 | |
12 | 12 | protected $sitemenu = []; |
13 | 13 | |
14 | - public function __construct(ManagerThemeInterface $managerTheme, array $data = []) |
|
15 | - { |
|
14 | + public function __construct(ManagerThemeInterface $managerTheme, array $data = []) |
|
15 | + { |
|
16 | 16 | parent::__construct($managerTheme, $data); |
17 | 17 | |
18 | 18 | $this->frame = $this->detectFrame(); |
19 | 19 | |
20 | - if ($this->frame > 9) { |
|
20 | + if ($this->frame > 9) { |
|
21 | 21 | // this is to stop the debug thingy being attached to the framesets |
22 | 22 | $this->managerTheme->getCore()->setConfig('enable_debug', false); |
23 | 23 | } |
24 | - if (!empty($this->frame)) { |
|
24 | + if (!empty($this->frame)) { |
|
25 | 25 | $this->setView('frame.' . $this->frame); |
26 | 26 | } |
27 | 27 | } |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | ] |
60 | 60 | ); |
61 | 61 | |
62 | - if ($this->managerTheme->getCore()->getConfig('manager_menu_height') === '') { |
|
62 | + if ($this->managerTheme->getCore()->getConfig('manager_menu_height') === '') { |
|
63 | 63 | $this->managerTheme->getCore()->setConfig('manager_menu_height', 2.2); // rem |
64 | 64 | } |
65 | 65 | |
66 | - if ($this->managerTheme->getCore()->getConfig('manager_tree_width') === '') { |
|
66 | + if ($this->managerTheme->getCore()->getConfig('manager_tree_width') === '') { |
|
67 | 67 | $this->managerTheme->getCore()->setConfig('manager_tree_width', 20); // rem |
68 | 68 | } |
69 | 69 | |
@@ -71,30 +71,30 @@ discard block |
||
71 | 71 | $tree_width = $this->managerTheme->getCore()->getConfig('manager_tree_width'); |
72 | 72 | $this->parameters['tree_min_width'] = 0; |
73 | 73 | |
74 | - if (isset($_COOKIE['MODX_widthSideBar'])) { |
|
74 | + if (isset($_COOKIE['MODX_widthSideBar'])) { |
|
75 | 75 | $MODX_widthSideBar = $_COOKIE['MODX_widthSideBar']; |
76 | - } else { |
|
76 | + } else { |
|
77 | 77 | $MODX_widthSideBar = $tree_width; |
78 | 78 | } |
79 | 79 | $this->parameters['MODX_widthSideBar'] = $MODX_widthSideBar; |
80 | 80 | |
81 | - if (!$MODX_widthSideBar) { |
|
81 | + if (!$MODX_widthSideBar) { |
|
82 | 82 | $body_class .= 'sidebar-closed'; |
83 | 83 | } |
84 | 84 | |
85 | 85 | $theme_modes = ['', 'lightness', 'light', 'dark', 'darkness']; |
86 | - if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) { |
|
86 | + if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) { |
|
87 | 87 | $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']]; |
88 | - } elseif (!empty($theme_modes[$this->managerTheme->getCore()->getConfig('manager_theme_mode')])) { |
|
88 | + } elseif (!empty($theme_modes[$this->managerTheme->getCore()->getConfig('manager_theme_mode')])) { |
|
89 | 89 | $body_class .= ' ' . $theme_modes[$this->managerTheme->getCore()->getConfig('manager_theme_mode')]; |
90 | 90 | } |
91 | 91 | |
92 | 92 | $navbar_position = $this->managerTheme->getCore()->getConfig('manager_menu_position'); |
93 | - if ($navbar_position === 'left') { |
|
93 | + if ($navbar_position === 'left') { |
|
94 | 94 | $body_class .= ' navbar-left navbar-left-icon-and-text'; |
95 | 95 | } |
96 | 96 | |
97 | - if (isset($this->managerTheme->getCore()->pluginCache['ElementsInTree'])) { |
|
97 | + if (isset($this->managerTheme->getCore()->pluginCache['ElementsInTree'])) { |
|
98 | 98 | $body_class .= ' ElementsInTree'; |
99 | 99 | } |
100 | 100 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | 'type8' => $this->managerTheme->getLexicon('lock_element_type_8') |
113 | 113 | ]; |
114 | 114 | |
115 | - foreach ($unlockTranslations as $key => $value) { |
|
115 | + foreach ($unlockTranslations as $key => $value) { |
|
116 | 116 | $unlockTranslations[$key] = iconv( |
117 | 117 | $this->managerTheme->getCore()->getConfig('modx_charset'), |
118 | 118 | 'utf-8', |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $this->parameters['unlockTranslations'] = $unlockTranslations; |
123 | 123 | |
124 | 124 | $user = $this->managerTheme->getCore()->getUserInfo($this->managerTheme->getCore()->getLoginUserID()); |
125 | - if ((isset($user['which_browser']) && $user['which_browser'] == 'default') || (!isset($user['which_browser']))) { |
|
125 | + if ((isset($user['which_browser']) && $user['which_browser'] == 'default') || (!isset($user['which_browser']))) { |
|
126 | 126 | $user['which_browser'] = $this->managerTheme->getCore()->getConfig('which_browser'); |
127 | 127 | } |
128 | 128 | $this->parameters['user'] = $user; |
@@ -159,14 +159,14 @@ discard block |
||
159 | 159 | { |
160 | 160 | $_SESSION['browser'] = (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 1') !== false) ? 'legacy_IE' : 'modern'; |
161 | 161 | |
162 | - if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) { |
|
162 | + if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) { |
|
163 | 163 | $this->parameters['initMainframeAction'] = $_SESSION['onLoginForwardToAction']; |
164 | 164 | unset($_SESSION['onLoginForwardToAction']); |
165 | - } else { |
|
165 | + } else { |
|
166 | 166 | $this->parameters['initMainframeAction'] = 2; // welcome.static |
167 | 167 | } |
168 | 168 | |
169 | - if (!isset($_SESSION['tree_show_only_folders'])) { |
|
169 | + if (!isset($_SESSION['tree_show_only_folders'])) { |
|
170 | 170 | $_SESSION['tree_show_only_folders'] = 0; |
171 | 171 | } |
172 | 172 | } |
@@ -175,10 +175,10 @@ discard block |
||
175 | 175 | { |
176 | 176 | $this->parameters['css'] = $this->managerTheme->getThemeDir(false) . 'css/page.css?v=' . EVO_INSTALL_TIME; |
177 | 177 | |
178 | - if ($this->managerTheme->getTheme() === 'default') { |
|
178 | + if ($this->managerTheme->getTheme() === 'default') { |
|
179 | 179 | $themeDir = $this->managerTheme->getThemeDir(); |
180 | 180 | |
181 | - if (!file_exists($themeDir . 'css/styles.min.css') && is_writable($themeDir . 'css')) { |
|
181 | + if (!file_exists($themeDir . 'css/styles.min.css') && is_writable($themeDir . 'css')) { |
|
182 | 182 | require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php'; |
183 | 183 | $minifier = new \Formatter\CSSMinify(); |
184 | 184 | $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css'); |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $minifier->addFile($themeDir . 'css/main.css'); |
195 | 195 | file_put_contents($themeDir . 'css/styles.min.css', $minifier->minify()); |
196 | 196 | } |
197 | - if (file_exists($themeDir . 'css/styles.min.css')) { |
|
197 | + if (file_exists($themeDir . 'css/styles.min.css')) { |
|
198 | 198 | $this->parameters['css'] = $this->managerTheme->getThemeDir(false) . 'css/styles.min.css?v=' . EVO_INSTALL_TIME; |
199 | 199 | } |
200 | 200 | } |
@@ -202,8 +202,8 @@ discard block |
||
202 | 202 | return $this->parameters['css']; |
203 | 203 | } |
204 | 204 | |
205 | - protected function makeMenu() |
|
206 | - { |
|
205 | + protected function makeMenu() |
|
206 | + { |
|
207 | 207 | $this->menuBars() |
208 | 208 | ->menuSite() |
209 | 209 | ->menuElementTypes() |
@@ -228,15 +228,15 @@ discard block |
||
228 | 228 | ->menuExportSite(); |
229 | 229 | |
230 | 230 | $menu = $this->managerTheme->getCore()->invokeEvent('OnManagerMenuPrerender', ['menu' => $this->sitemenu]); |
231 | - if (\is_array($menu)) { |
|
231 | + if (\is_array($menu)) { |
|
232 | 232 | $newmenu = []; |
233 | - foreach ($menu as $item) { |
|
233 | + foreach ($menu as $item) { |
|
234 | 234 | $data = unserialize($item, ['allowed_classes' => false]); |
235 | - if (\is_array($data)) { |
|
235 | + if (\is_array($data)) { |
|
236 | 236 | $newmenu = array_merge($newmenu, $data); |
237 | 237 | } |
238 | 238 | } |
239 | - if (\count($newmenu) > 0) { |
|
239 | + if (\count($newmenu) > 0) { |
|
240 | 240 | $this->sitemenu = $newmenu; |
241 | 241 | } |
242 | 242 | } |
@@ -256,8 +256,8 @@ discard block |
||
256 | 256 | ); |
257 | 257 | } |
258 | 258 | |
259 | - protected function menuBars() |
|
260 | - { |
|
259 | + protected function menuBars() |
|
260 | + { |
|
261 | 261 | $this->sitemenu['bars'] = [ |
262 | 262 | 'bars', |
263 | 263 | 'main', |
@@ -275,8 +275,8 @@ discard block |
||
275 | 275 | return $this; |
276 | 276 | } |
277 | 277 | |
278 | - protected function menuSite() |
|
279 | - { |
|
278 | + protected function menuSite() |
|
279 | + { |
|
280 | 280 | $this->sitemenu['site'] = [ |
281 | 281 | 'site', |
282 | 282 | 'main', |
@@ -294,13 +294,13 @@ discard block |
||
294 | 294 | return $this; |
295 | 295 | } |
296 | 296 | |
297 | - protected function menuElementTypes() |
|
298 | - { |
|
297 | + protected function menuElementTypes() |
|
298 | + { |
|
299 | 299 | $flag = $this->managerTheme->getCore()->hasAnyPermissions( |
300 | 300 | ['edit_template', 'edit_snippet', 'edit_chunk', 'edit_plugin', 'category_manager', 'file_manager'] |
301 | 301 | ); |
302 | 302 | |
303 | - if ($flag) { |
|
303 | + if ($flag) { |
|
304 | 304 | $this->sitemenu['elements'] = [ |
305 | 305 | 'elements', |
306 | 306 | 'main', |
@@ -319,9 +319,9 @@ discard block |
||
319 | 319 | return $this; |
320 | 320 | } |
321 | 321 | |
322 | - protected function menuModules() |
|
323 | - { |
|
324 | - if ($this->managerTheme->getCore()->hasPermission('exec_module')) { |
|
322 | + protected function menuModules() |
|
323 | + { |
|
324 | + if ($this->managerTheme->getCore()->hasPermission('exec_module')) { |
|
325 | 325 | $this->sitemenu['modules'] = [ |
326 | 326 | 'modules', |
327 | 327 | 'main', |
@@ -340,12 +340,12 @@ discard block |
||
340 | 340 | return $this; |
341 | 341 | } |
342 | 342 | |
343 | - protected function menuUsers() |
|
344 | - { |
|
343 | + protected function menuUsers() |
|
344 | + { |
|
345 | 345 | $flag = $this->managerTheme->getCore()->hasAnyPermissions( |
346 | 346 | ['edit_user', 'edit_web_user', 'edit_role', 'access_permissions', 'web_access_permissions'] |
347 | 347 | ); |
348 | - if ($flag) { |
|
348 | + if ($flag) { |
|
349 | 349 | $this->sitemenu['users'] = [ |
350 | 350 | 'users', |
351 | 351 | 'main', |
@@ -364,12 +364,12 @@ discard block |
||
364 | 364 | return $this; |
365 | 365 | } |
366 | 366 | |
367 | - protected function menuTools() |
|
368 | - { |
|
367 | + protected function menuTools() |
|
368 | + { |
|
369 | 369 | $flag = $this->managerTheme->getCore()->hasAnyPermissions( |
370 | 370 | ['empty_cache', 'bk_manager', 'remove_locks', 'import_static', 'export_static'] |
371 | 371 | ); |
372 | - if ($flag) { |
|
372 | + if ($flag) { |
|
373 | 373 | $this->sitemenu['tools'] = [ |
374 | 374 | 'tools', |
375 | 375 | 'main', |
@@ -388,8 +388,8 @@ discard block |
||
388 | 388 | return $this; |
389 | 389 | } |
390 | 390 | |
391 | - protected function menuElements() |
|
392 | - { |
|
391 | + protected function menuElements() |
|
392 | + { |
|
393 | 393 | $tab = $this->menuElementTemplates(0); |
394 | 394 | $tab = $this->menuElementTv($tab); |
395 | 395 | $tab = $this->menuElementChunks($tab); |
@@ -399,9 +399,9 @@ discard block |
||
399 | 399 | return $this; |
400 | 400 | } |
401 | 401 | |
402 | - protected function menuElementTemplates($tab) |
|
403 | - { |
|
404 | - if ($this->managerTheme->getCore()->hasPermission('edit_template')) { |
|
402 | + protected function menuElementTemplates($tab) |
|
403 | + { |
|
404 | + if ($this->managerTheme->getCore()->hasPermission('edit_template')) { |
|
405 | 405 | $this->sitemenu['element_templates'] = [ |
406 | 406 | 'element_templates', |
407 | 407 | 'elements', |
@@ -420,9 +420,9 @@ discard block |
||
420 | 420 | return $tab; |
421 | 421 | } |
422 | 422 | |
423 | - protected function menuElementTv($tab) |
|
424 | - { |
|
425 | - if ($this->managerTheme->getCore()->hasPermission('edit_template') && $this->managerTheme->getCore()->hasPermission('edit_snippet') && $this->managerTheme->getCore()->hasPermission('edit_chunk') && $this->managerTheme->getCore()->hasPermission('edit_plugin')) { |
|
423 | + protected function menuElementTv($tab) |
|
424 | + { |
|
425 | + if ($this->managerTheme->getCore()->hasPermission('edit_template') && $this->managerTheme->getCore()->hasPermission('edit_snippet') && $this->managerTheme->getCore()->hasPermission('edit_chunk') && $this->managerTheme->getCore()->hasPermission('edit_plugin')) { |
|
426 | 426 | $this->sitemenu['element_tplvars'] = [ |
427 | 427 | 'element_tplvars', |
428 | 428 | 'elements', |
@@ -441,9 +441,9 @@ discard block |
||
441 | 441 | return $tab; |
442 | 442 | } |
443 | 443 | |
444 | - protected function menuElementChunks($tab) |
|
445 | - { |
|
446 | - if ($this->managerTheme->getCore()->hasPermission('edit_chunk')) { |
|
444 | + protected function menuElementChunks($tab) |
|
445 | + { |
|
446 | + if ($this->managerTheme->getCore()->hasPermission('edit_chunk')) { |
|
447 | 447 | $this->sitemenu['element_htmlsnippets'] = [ |
448 | 448 | 'element_htmlsnippets', |
449 | 449 | 'elements', |
@@ -462,9 +462,9 @@ discard block |
||
462 | 462 | return $tab; |
463 | 463 | } |
464 | 464 | |
465 | - protected function menuElementSnippets($tab) |
|
466 | - { |
|
467 | - if ($this->managerTheme->getCore()->hasPermission('edit_snippet')) { |
|
465 | + protected function menuElementSnippets($tab) |
|
466 | + { |
|
467 | + if ($this->managerTheme->getCore()->hasPermission('edit_snippet')) { |
|
468 | 468 | $this->sitemenu['element_snippets'] = [ |
469 | 469 | 'element_snippets', |
470 | 470 | 'elements', |
@@ -483,9 +483,9 @@ discard block |
||
483 | 483 | return $tab; |
484 | 484 | } |
485 | 485 | |
486 | - protected function menuElementPlugins($tab) |
|
487 | - { |
|
488 | - if ($this->managerTheme->getCore()->hasPermission('edit_plugin')) { |
|
486 | + protected function menuElementPlugins($tab) |
|
487 | + { |
|
488 | + if ($this->managerTheme->getCore()->hasPermission('edit_plugin')) { |
|
489 | 489 | $this->sitemenu['element_plugins'] = [ |
490 | 490 | 'element_plugins', |
491 | 491 | 'elements', |
@@ -504,9 +504,9 @@ discard block |
||
504 | 504 | return $tab; |
505 | 505 | } |
506 | 506 | |
507 | - function menuFiles() |
|
508 | - { |
|
509 | - if ($this->managerTheme->getCore()->hasPermission('file_manager')) { |
|
507 | + function menuFiles() |
|
508 | + { |
|
509 | + if ($this->managerTheme->getCore()->hasPermission('file_manager')) { |
|
510 | 510 | $this->sitemenu['manage_files'] = [ |
511 | 511 | 'manage_files', |
512 | 512 | 'elements', |
@@ -525,9 +525,9 @@ discard block |
||
525 | 525 | return $this; |
526 | 526 | } |
527 | 527 | |
528 | - protected function menuCategories() |
|
529 | - { |
|
530 | - if ($this->managerTheme->getCore()->hasPermission('category_manager')) { |
|
528 | + protected function menuCategories() |
|
529 | + { |
|
530 | + if ($this->managerTheme->getCore()->hasPermission('category_manager')) { |
|
531 | 531 | $this->sitemenu['manage_categories'] = [ |
532 | 532 | 'manage_categories', |
533 | 533 | 'elements', |
@@ -546,13 +546,13 @@ discard block |
||
546 | 546 | return $this; |
547 | 547 | } |
548 | 548 | |
549 | - protected function menuNewModule() |
|
550 | - { |
|
549 | + protected function menuNewModule() |
|
550 | + { |
|
551 | 551 | $flag = $this->managerTheme->getCore()->hasAnyPermissions( |
552 | 552 | ['new_module', 'edit_module', 'save_module'] |
553 | 553 | ); |
554 | 554 | |
555 | - if ($flag) { |
|
555 | + if ($flag) { |
|
556 | 556 | $this->sitemenu['new_module'] = [ |
557 | 557 | 'new_module', |
558 | 558 | 'modules', |
@@ -571,17 +571,17 @@ discard block |
||
571 | 571 | return $this; |
572 | 572 | } |
573 | 573 | |
574 | - protected function menuRunModules() |
|
575 | - { |
|
576 | - if ($this->managerTheme->getCore()->hasPermission('exec_module')) { |
|
577 | - if ($_SESSION['mgrRole'] != 1 && $this->managerTheme->getCore()->getConfig('use_udperms') === true) { |
|
574 | + protected function menuRunModules() |
|
575 | + { |
|
576 | + if ($this->managerTheme->getCore()->hasPermission('exec_module')) { |
|
577 | + if ($_SESSION['mgrRole'] != 1 && $this->managerTheme->getCore()->getConfig('use_udperms') === true) { |
|
578 | 578 | $rs = $this->managerTheme->getCore()->getDatabase()->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member |
579 | 579 | FROM ' . $this->managerTheme->getCore()->getDatabase()->getFullTableName('site_modules') . ' AS sm |
580 | 580 | LEFT JOIN ' . $this->managerTheme->getCore()->getDatabase()->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id |
581 | 581 | LEFT JOIN ' . $this->managerTheme->getCore()->getDatabase()->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group |
582 | 582 | WHERE (mg.member IS NULL OR mg.member = ' . $this->managerTheme->getCore()->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
583 | 583 | ORDER BY sm.name'); |
584 | - } else { |
|
584 | + } else { |
|
585 | 585 | $rs = $this->managerTheme->getCore()->getDatabase()->select( |
586 | 586 | '*', |
587 | 587 | $this->managerTheme->getCore()->getDatabase()->getFullTableName('site_modules'), |
@@ -589,8 +589,8 @@ discard block |
||
589 | 589 | 'name' |
590 | 590 | ); |
591 | 591 | } |
592 | - if ($this->managerTheme->getCore()->getDatabase()->getRecordCount($rs)) { |
|
593 | - while ($row = $this->managerTheme->getCore()->getDatabase()->getRow($rs)) { |
|
592 | + if ($this->managerTheme->getCore()->getDatabase()->getRecordCount($rs)) { |
|
593 | + while ($row = $this->managerTheme->getCore()->getDatabase()->getRow($rs)) { |
|
594 | 594 | $this->sitemenu['module' . $row['id']] = [ |
595 | 595 | 'module' . $row['id'], |
596 | 596 | 'modules', |
@@ -611,9 +611,9 @@ discard block |
||
611 | 611 | return $this; |
612 | 612 | } |
613 | 613 | |
614 | - protected function menuUserManagment() |
|
615 | - { |
|
616 | - if ($this->managerTheme->getCore()->hasPermission('edit_user')) { |
|
614 | + protected function menuUserManagment() |
|
615 | + { |
|
616 | + if ($this->managerTheme->getCore()->hasPermission('edit_user')) { |
|
617 | 617 | $this->sitemenu['user_management_title'] = [ |
618 | 618 | 'user_management_title', |
619 | 619 | 'users', |
@@ -632,9 +632,9 @@ discard block |
||
632 | 632 | return $this; |
633 | 633 | } |
634 | 634 | |
635 | - protected function menuWebUserManagment() |
|
636 | - { |
|
637 | - if ($this->managerTheme->getCore()->hasPermission('edit_web_user')) { |
|
635 | + protected function menuWebUserManagment() |
|
636 | + { |
|
637 | + if ($this->managerTheme->getCore()->hasPermission('edit_web_user')) { |
|
638 | 638 | $this->sitemenu['web_user_management_title'] = [ |
639 | 639 | 'web_user_management_title', |
640 | 640 | 'users', |
@@ -653,9 +653,9 @@ discard block |
||
653 | 653 | return $this; |
654 | 654 | } |
655 | 655 | |
656 | - protected function menuRoleManagment() |
|
657 | - { |
|
658 | - if ($this->managerTheme->getCore()->hasPermission('edit_role')) { |
|
656 | + protected function menuRoleManagment() |
|
657 | + { |
|
658 | + if ($this->managerTheme->getCore()->hasPermission('edit_role')) { |
|
659 | 659 | $this->sitemenu['role_management_title'] = [ |
660 | 660 | 'role_management_title', |
661 | 661 | 'users', |
@@ -674,9 +674,9 @@ discard block |
||
674 | 674 | return $this; |
675 | 675 | } |
676 | 676 | |
677 | - protected function menuPermissions() |
|
678 | - { |
|
679 | - if ($this->managerTheme->getCore()->hasPermission('access_permissions')) { |
|
677 | + protected function menuPermissions() |
|
678 | + { |
|
679 | + if ($this->managerTheme->getCore()->hasPermission('access_permissions')) { |
|
680 | 680 | $this->sitemenu['manager_permissions'] = [ |
681 | 681 | 'manager_permissions', |
682 | 682 | 'users', |
@@ -695,9 +695,9 @@ discard block |
||
695 | 695 | return $this; |
696 | 696 | } |
697 | 697 | |
698 | - protected function menuWebPermissions() |
|
699 | - { |
|
700 | - if ($this->managerTheme->getCore()->hasPermission('web_access_permissions')) { |
|
698 | + protected function menuWebPermissions() |
|
699 | + { |
|
700 | + if ($this->managerTheme->getCore()->hasPermission('web_access_permissions')) { |
|
701 | 701 | $this->sitemenu['web_permissions'] = [ |
702 | 702 | 'web_permissions', |
703 | 703 | 'users', |
@@ -716,8 +716,8 @@ discard block |
||
716 | 716 | return $this; |
717 | 717 | } |
718 | 718 | |
719 | - protected function menuRefreshSite() |
|
720 | - { |
|
719 | + protected function menuRefreshSite() |
|
720 | + { |
|
721 | 721 | $this->sitemenu['refresh_site'] = [ |
722 | 722 | 'refresh_site', |
723 | 723 | 'tools', |
@@ -751,8 +751,8 @@ discard block |
||
751 | 751 | return $this; |
752 | 752 | } |
753 | 753 | |
754 | - protected function menuSearch() |
|
755 | - { |
|
754 | + protected function menuSearch() |
|
755 | + { |
|
756 | 756 | $this->sitemenu['search'] = [ |
757 | 757 | 'search', |
758 | 758 | 'tools', |
@@ -770,9 +770,9 @@ discard block |
||
770 | 770 | return $this; |
771 | 771 | } |
772 | 772 | |
773 | - protected function menuBkManager() |
|
774 | - { |
|
775 | - if ($this->managerTheme->getCore()->hasPermission('bk_manager')) { |
|
773 | + protected function menuBkManager() |
|
774 | + { |
|
775 | + if ($this->managerTheme->getCore()->hasPermission('bk_manager')) { |
|
776 | 776 | $this->sitemenu['bk_manager'] = [ |
777 | 777 | 'bk_manager', |
778 | 778 | 'tools', |
@@ -791,9 +791,9 @@ discard block |
||
791 | 791 | return $this; |
792 | 792 | } |
793 | 793 | |
794 | - protected function menuRemoveLocks() |
|
795 | - { |
|
796 | - if ($this->managerTheme->getCore()->hasPermission('remove_locks')) { |
|
794 | + protected function menuRemoveLocks() |
|
795 | + { |
|
796 | + if ($this->managerTheme->getCore()->hasPermission('remove_locks')) { |
|
797 | 797 | $this->sitemenu['remove_locks'] = [ |
798 | 798 | 'remove_locks', |
799 | 799 | 'tools', |
@@ -812,9 +812,9 @@ discard block |
||
812 | 812 | return $this; |
813 | 813 | } |
814 | 814 | |
815 | - protected function menuImportSite() |
|
816 | - { |
|
817 | - if ($this->managerTheme->getCore()->hasPermission('import_static')) { |
|
815 | + protected function menuImportSite() |
|
816 | + { |
|
817 | + if ($this->managerTheme->getCore()->hasPermission('import_static')) { |
|
818 | 818 | $this->sitemenu['import_site'] = [ |
819 | 819 | 'import_site', |
820 | 820 | 'tools', |
@@ -833,9 +833,9 @@ discard block |
||
833 | 833 | return $this; |
834 | 834 | } |
835 | 835 | |
836 | - protected function menuExportSite() |
|
837 | - { |
|
838 | - if ($this->managerTheme->getCore()->hasPermission('export_static')) { |
|
836 | + protected function menuExportSite() |
|
837 | + { |
|
838 | + if ($this->managerTheme->getCore()->hasPermission('export_static')) { |
|
839 | 839 | $this->sitemenu['export_site'] = [ |
840 | 840 | 'export_site', |
841 | 841 | 'tools', |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | } |
136 | 136 | |
137 | 137 | /** |
138 | - * @param string|int $id |
|
138 | + * @param integer $id |
|
139 | 139 | * @return Models\SiteContent |
140 | 140 | */ |
141 | 141 | protected function getDocument($id) : Models\SiteContent |
@@ -153,6 +153,9 @@ discard block |
||
153 | 153 | return $document; |
154 | 154 | } |
155 | 155 | |
156 | + /** |
|
157 | + * @param integer $id |
|
158 | + */ |
|
156 | 159 | protected function checkNewParentPermission($id) |
157 | 160 | { |
158 | 161 | $udperms = new Permissions; |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php namespace EvolutionCMS\Controllers; |
2 | 2 | |
3 | -use EvolutionCMS\Interfaces\ManagerTheme; |
|
4 | -use EvolutionCMS\Models; |
|
5 | -use EvolutionCMS\Legacy\Permissions; |
|
3 | +use EvolutionCMS\Interfaces\ManagerTheme; |
|
4 | +use EvolutionCMS\Legacy\Permissions; |
|
5 | +use EvolutionCMS\Models; |
|
6 | 6 | use Exception; |
7 | 7 | |
8 | 8 | class MoveDocument extends AbstractController implements ManagerTheme\PageControllerInterface |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | public function process() : bool |
29 | 29 | { |
30 | - if ((int)$this->getIndex() === 52) { |
|
30 | + if ((int) $this->getIndex() === 52) { |
|
31 | 31 | $this->handle(); |
32 | 32 | $flag = false; |
33 | 33 | } else { |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | protected function handle() |
42 | 42 | { |
43 | - $newParentID = (int)get_by_key($_REQUEST, 'new_parent', 0, 'is_scalar'); |
|
43 | + $newParentID = (int) get_by_key($_REQUEST, 'new_parent', 0, 'is_scalar'); |
|
44 | 44 | $documentID = $this->getElementId(); |
45 | 45 | |
46 | 46 | // ok, two things to check. |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | ]); |
74 | 74 | |
75 | 75 | if (\is_array($evtOut) && count($evtOut) > 0) { |
76 | - $newParent = (int)array_pop($evtOut); |
|
76 | + $newParent = (int) array_pop($evtOut); |
|
77 | 77 | if ($newParent === $document->parent) { |
78 | 78 | $this->managerTheme->alertAndQuit('error_movedocument2'); |
79 | 79 | } else { |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | // empty cache & sync site |
110 | 110 | $this->managerTheme->getCore()->clearCache('full'); |
111 | 111 | |
112 | - header('Location: index.php?a=3&id=' . $document->getKey() . '&r=9'); |
|
112 | + header('Location: index.php?a=3&id='.$document->getKey().'&r=9'); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | protected function processDisplay() : bool |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $udperms->document = $id; |
161 | 161 | $udperms->role = $_SESSION['mgrRole']; |
162 | 162 | |
163 | - if (! $udperms->checkPermissions()) { |
|
163 | + if (!$udperms->checkPermissions()) { |
|
164 | 164 | $this->managerTheme->alertAndQuit('access_permission_parent_denied'); |
165 | 165 | } |
166 | 166 | } |
@@ -5,8 +5,8 @@ discard block |
||
5 | 5 | use EvolutionCMS\Legacy\Permissions; |
6 | 6 | use Exception; |
7 | 7 | |
8 | -class MoveDocument extends AbstractController implements ManagerTheme\PageControllerInterface |
|
9 | -{ |
|
8 | +class MoveDocument extends AbstractController implements ManagerTheme\PageControllerInterface |
|
9 | +{ |
|
10 | 10 | protected $view = 'page.move_document'; |
11 | 11 | |
12 | 12 | /** |
@@ -27,10 +27,10 @@ discard block |
||
27 | 27 | |
28 | 28 | public function process() : bool |
29 | 29 | { |
30 | - if ((int)$this->getIndex() === 52) { |
|
30 | + if ((int)$this->getIndex() === 52) { |
|
31 | 31 | $this->handle(); |
32 | 32 | $flag = false; |
33 | - } else { |
|
33 | + } else { |
|
34 | 34 | $this->processDisplay(); |
35 | 35 | $flag = true; |
36 | 36 | } |
@@ -38,31 +38,31 @@ discard block |
||
38 | 38 | return $flag; |
39 | 39 | } |
40 | 40 | |
41 | - protected function handle() |
|
42 | - { |
|
41 | + protected function handle() |
|
42 | + { |
|
43 | 43 | $newParentID = (int)get_by_key($_REQUEST, 'new_parent', 0, 'is_scalar'); |
44 | 44 | $documentID = $this->getElementId(); |
45 | 45 | |
46 | 46 | // ok, two things to check. |
47 | 47 | // first, document cannot be moved to itself |
48 | 48 | // second, new parent must be a folder. If not, set it to folder. |
49 | - if ($documentID === $newParentID) { |
|
49 | + if ($documentID === $newParentID) { |
|
50 | 50 | $this->managerTheme->alertAndQuit('error_movedocument1'); |
51 | 51 | } |
52 | 52 | |
53 | - if ($documentID <= 0 || $newParentID < 0) { |
|
53 | + if ($documentID <= 0 || $newParentID < 0) { |
|
54 | 54 | $this->managerTheme->alertAndQuit('error_movedocument2'); |
55 | 55 | } |
56 | 56 | |
57 | 57 | $document = $this->getDocument($documentID); |
58 | 58 | |
59 | 59 | $parents = $this->managerTheme->getCore()->getParentIds($newParentID); |
60 | - if (\in_array($document->getKey(), $parents, true)) { |
|
60 | + if (\in_array($document->getKey(), $parents, true)) { |
|
61 | 61 | $this->managerTheme->alertAndQuit('error_movedocument2'); |
62 | 62 | } |
63 | 63 | |
64 | 64 | // check user has permission to move document to chosen location |
65 | - if ($this->managerTheme->getCore()->getConfig('use_udperms') && $document->parent !== $newParentID) { |
|
65 | + if ($this->managerTheme->getCore()->getConfig('use_udperms') && $document->parent !== $newParentID) { |
|
66 | 66 | $this->checkNewParentPermission($newParentID); |
67 | 67 | } |
68 | 68 | |
@@ -72,11 +72,11 @@ discard block |
||
72 | 72 | 'new_parent' => $newParentID |
73 | 73 | ]); |
74 | 74 | |
75 | - if (\is_array($evtOut) && count($evtOut) > 0) { |
|
75 | + if (\is_array($evtOut) && count($evtOut) > 0) { |
|
76 | 76 | $newParent = (int)array_pop($evtOut); |
77 | - if ($newParent === $document->parent) { |
|
77 | + if ($newParent === $document->parent) { |
|
78 | 78 | $this->managerTheme->alertAndQuit('error_movedocument2'); |
79 | - } else { |
|
79 | + } else { |
|
80 | 80 | $newParentID = $newParent; |
81 | 81 | } |
82 | 82 | } |
@@ -84,13 +84,13 @@ discard block |
||
84 | 84 | $parentDocument = $this->getDocument($newParentID); |
85 | 85 | |
86 | 86 | $children = allChildren($document->getKey()); |
87 | - if (\in_array($parentDocument->getKey(), $children, true)) { |
|
87 | + if (\in_array($parentDocument->getKey(), $children, true)) { |
|
88 | 88 | $this->managerTheme->alertAndQuit('You cannot move a document to a child document!', false); |
89 | 89 | } |
90 | 90 | |
91 | 91 | $parentDocument->isfolder = true; |
92 | 92 | $parentDocument->save(); |
93 | - if ($document->ancestor->childrens()->count() <= 1) { |
|
93 | + if ($document->ancestor->childrens()->count() <= 1) { |
|
94 | 94 | $document->ancestor->isfolder = false; |
95 | 95 | $document->ancestor->save(); |
96 | 96 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $udperms->document = $document->getKey(); |
124 | 124 | $udperms->role = $_SESSION['mgrRole']; |
125 | 125 | |
126 | - if (!$udperms->checkPermissions()) { |
|
126 | + if (!$udperms->checkPermissions()) { |
|
127 | 127 | $this->managerTheme->alertAndQuit('access_permission_denied'); |
128 | 128 | } |
129 | 129 | |
@@ -140,27 +140,27 @@ discard block |
||
140 | 140 | */ |
141 | 141 | protected function getDocument($id) : Models\SiteContent |
142 | 142 | { |
143 | - try { |
|
144 | - if ($id <= 0) { |
|
143 | + try { |
|
144 | + if ($id <= 0) { |
|
145 | 145 | throw new Exception(); |
146 | 146 | } |
147 | 147 | /** @var Models\SiteContent $document */ |
148 | 148 | $document = Models\SiteContent::withTrashed()->findOrFail($id); |
149 | - } catch (Exception $exception) { |
|
149 | + } catch (Exception $exception) { |
|
150 | 150 | $this->managerTheme->alertAndQuit('error_no_id'); |
151 | 151 | } |
152 | 152 | |
153 | 153 | return $document; |
154 | 154 | } |
155 | 155 | |
156 | - protected function checkNewParentPermission($id) |
|
157 | - { |
|
156 | + protected function checkNewParentPermission($id) |
|
157 | + { |
|
158 | 158 | $udperms = new Permissions; |
159 | 159 | $udperms->user = $this->managerTheme->getCore()->getLoginUserID(); |
160 | 160 | $udperms->document = $id; |
161 | 161 | $udperms->role = $_SESSION['mgrRole']; |
162 | 162 | |
163 | - if (! $udperms->checkPermissions()) { |
|
163 | + if (! $udperms->checkPermissions()) { |
|
164 | 164 | $this->managerTheme->alertAndQuit('access_permission_parent_denied'); |
165 | 165 | } |
166 | 166 | } |
@@ -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 Password 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 Plugin extends AbstractController implements ManagerTheme\PageControllerInterface |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | if ($data->exists) { |
88 | 88 | if (empty($data->count())) { |
89 | - $this->managerTheme->alertAndQuit('Plugin not found for id ' . $id . '.', false); |
|
89 | + $this->managerTheme->alertAndQuit('Plugin not found for id '.$id.'.', false); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | $_SESSION['itemname'] = $data->name; |
@@ -123,13 +123,13 @@ discard block |
||
123 | 123 | ->getDatabase() |
124 | 124 | ->select('sm.id,sm.name,sm.guid', $this->managerTheme->getCore() |
125 | 125 | ->getDatabase() |
126 | - ->getFullTableName("site_modules") . " sm |
|
126 | + ->getFullTableName("site_modules")." sm |
|
127 | 127 | INNER JOIN " . $this->managerTheme->getCore() |
128 | 128 | ->getDatabase() |
129 | - ->getFullTableName("site_module_depobj") . " smd ON smd.module=sm.id AND smd.type=30 |
|
129 | + ->getFullTableName("site_module_depobj")." smd ON smd.module=sm.id AND smd.type=30 |
|
130 | 130 | INNER JOIN " . $this->managerTheme->getCore() |
131 | 131 | ->getDatabase() |
132 | - ->getFullTableName("site_plugins") . " |
|
132 | + ->getFullTableName("site_plugins")." |
|
133 | 133 | sp ON sp.id=smd.resource", "smd.resource='{$this->object->getKey()}' AND sm.enable_sharedparams='1'", |
134 | 134 | 'sm.name'); |
135 | 135 | while ($row = $this->managerTheme->getCore() |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $out = implode('', $out); |
181 | 181 | } |
182 | 182 | |
183 | - return (string)$out; |
|
183 | + return (string) $out; |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | protected function parameterActionButtons() |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php namespace EvolutionCMS\Controllers; |
2 | 2 | |
3 | -use EvolutionCMS\Models; |
|
4 | -use EvolutionCMS\Interfaces\ManagerTheme; |
|
3 | +use EvolutionCMS\Interfaces\ManagerTheme; |
|
4 | +use EvolutionCMS\Models; |
|
5 | 5 | use Illuminate\Database\Eloquent; |
6 | 6 | |
7 | 7 |
@@ -39,7 +39,7 @@ |
||
39 | 39 | { |
40 | 40 | return Models\SystemEventname::with( |
41 | 41 | [ |
42 | - 'plugins' => function (Eloquent\Relations\BelongsToMany $query) { |
|
42 | + 'plugins' => function(Eloquent\Relations\BelongsToMany $query){ |
|
43 | 43 | $query->orderBy('priority'); |
44 | 44 | } |
45 | 45 | ] |
@@ -5,8 +5,8 @@ discard block |
||
5 | 5 | use Illuminate\Database\Eloquent; |
6 | 6 | |
7 | 7 | |
8 | -class PluginPriority extends AbstractController implements ManagerTheme\PageControllerInterface |
|
9 | -{ |
|
8 | +class PluginPriority extends AbstractController implements ManagerTheme\PageControllerInterface |
|
9 | +{ |
|
10 | 10 | protected $view = 'page.plugin_priority'; |
11 | 11 | |
12 | 12 | /** |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | { |
40 | 40 | return Models\SystemEventname::with( |
41 | 41 | [ |
42 | - 'plugins' => function (Eloquent\Relations\BelongsToMany $query) { |
|
42 | + 'plugins' => function (Eloquent\Relations\BelongsToMany $query){ |
|
43 | 43 | $query->orderBy('priority'); |
44 | 44 | } |
45 | 45 | ] |
@@ -50,19 +50,19 @@ discard block |
||
50 | 50 | { |
51 | 51 | $updateMsg = false; |
52 | 52 | |
53 | - if (isset($_POST['listSubmitted'])) { |
|
53 | + if (isset($_POST['listSubmitted'])) { |
|
54 | 54 | $updateMsg = true; |
55 | 55 | $tbl = $this->managerTheme->getCore()->getDatabase()->getFullTableName('site_plugin_events'); |
56 | 56 | |
57 | - foreach ($_POST as $listName => $listValue) { |
|
58 | - if ($listName === 'listSubmitted') { |
|
57 | + foreach ($_POST as $listName => $listValue) { |
|
58 | + if ($listName === 'listSubmitted') { |
|
59 | 59 | continue; |
60 | 60 | } |
61 | 61 | $orderArray = explode(',', $listValue); |
62 | 62 | $listName = ltrim($listName, 'list_'); |
63 | - if (\count($orderArray) > 0) { |
|
64 | - foreach ($orderArray as $key => $item) { |
|
65 | - if ($item == '') { |
|
63 | + if (\count($orderArray) > 0) { |
|
64 | + foreach ($orderArray as $key => $item) { |
|
65 | + if ($item == '') { |
|
66 | 66 | continue; |
67 | 67 | } |
68 | 68 | $pluginId = ltrim($item, 'item_'); |
@@ -1,7 +1,6 @@ |
||
1 | 1 | <?php namespace EvolutionCMS\Controllers; |
2 | 2 | |
3 | 3 | use EvolutionCMS\Interfaces\ManagerTheme; |
4 | -use Illuminate\Support\Arr; |
|
5 | 4 | |
6 | 5 | class Resources extends AbstractResources implements ManagerTheme\PageControllerInterface |
7 | 6 | { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | } |
37 | 37 | foreach ($this->tabs as $tabN => $tabClass) { |
38 | 38 | if (($tabController = $this->makeTab($tabClass, $tabN)) !== null) { |
39 | - if ((string)$tab !== (string)$tabN) { |
|
39 | + if ((string) $tab !== (string) $tabN) { |
|
40 | 40 | $tabController->setNoData(); |
41 | 41 | } else { |
42 | 42 | $activeTab = $tabController->getTabName(); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | return array_merge(compact('tabs'), parent::getParameters($params), compact('activeTab')); |
49 | 49 | } |
50 | 50 | |
51 | - protected function makeTab($tabClass, int $index = 0) :? ManagerTheme\TabControllerInterface |
|
51 | + protected function makeTab($tabClass, int $index = 0) : ? ManagerTheme\TabControllerInterface |
|
52 | 52 | { |
53 | 53 | $tabController = null; |
54 | 54 | if (class_exists($tabClass) && |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | /** @var ManagerTheme\TabControllerInterface $tabController */ |
58 | 58 | $tabController = new $tabClass($this->managerTheme); |
59 | 59 | $tabController->setIndex($index); |
60 | - if (! $tabController->canView()) { |
|
60 | + if (!$tabController->canView()) { |
|
61 | 61 | $tabController = null; |
62 | 62 | } |
63 | 63 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | protected function needTab() |
84 | 84 | { |
85 | - return get_by_key($_GET, 'tab', 0, function ($val) { |
|
85 | + return get_by_key($_GET, 'tab', 0, function($val){ |
|
86 | 86 | return is_numeric($val) && array_key_exists($val, $this->tabs); |
87 | 87 | }); |
88 | 88 | } |
@@ -82,7 +82,7 @@ |
||
82 | 82 | |
83 | 83 | protected function needTab() |
84 | 84 | { |
85 | - return get_by_key($_GET, 'tab', 0, function ($val) { |
|
85 | + return get_by_key($_GET, 'tab', 0, function ($val){ |
|
86 | 86 | return is_numeric($val) && array_key_exists($val, $this->tabs); |
87 | 87 | }); |
88 | 88 | } |
@@ -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(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')), |
10 | 10 | class Chunks extends AbstractResources implements TabControllerInterface |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | */ |
17 | 17 | public function getTabName($withIndex = true): string |
18 | 18 | { |
19 | - return 'tabChunks' . ($withIndex ? '-' . $this->getIndex() : ''); |
|
19 | + return 'tabChunks'.($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('chunks') |
68 | - ->whereHas('chunks', function (Eloquent\Builder $builder) { |
|
68 | + ->whereHas('chunks', 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('chunks') |
68 | - ->whereHas('chunks', function (Eloquent\Builder $builder) { |
|
68 | + ->whereHas('chunks', function (Eloquent\Builder $builder){ |
|
69 | 69 | return $builder->lockedView(); |
70 | 70 | })->orderBy('rank', 'ASC') |
71 | 71 | ->get(); |