@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.'); |
4 | 4 | } |
5 | 5 | |
6 | 6 | unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes |
7 | 7 | |
8 | -if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { |
|
8 | +if ($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { |
|
9 | 9 | // seems to be a new install - send the user to the configuration page |
10 | 10 | exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>'); |
11 | 11 | } |
@@ -16,62 +16,62 @@ discard block |
||
16 | 16 | $_SESSION['nrnewmessages'] = 0; |
17 | 17 | |
18 | 18 | // setup message info |
19 | -if($modx->hasPermission('messages')) { |
|
20 | - include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); |
|
19 | +if ($modx->hasPermission('messages')) { |
|
20 | + include_once(MODX_MANAGER_PATH.'includes/messageCount.inc.php'); |
|
21 | 21 | $_SESSION['nrtotalmessages'] = $nrtotalmessages; |
22 | 22 | $_SESSION['nrnewmessages'] = $nrnewmessages; |
23 | 23 | |
24 | 24 | $msg = array(); |
25 | 25 | $msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']); |
26 | - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : ''; |
|
26 | + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">'.$_SESSION['nrnewmessages'].'</span>)' : ''; |
|
27 | 27 | $msg[] = sprintf('<span style="color:#909090;font-size:15px;font-weight:bold"> <a class="wm_messages_inbox_link" href="index.php?a=10" target="main">[%%inbox%%]</a>%s</span><br />', $nrnewmessages); |
28 | - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0'; |
|
28 | + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">'.$_SESSION['nrnewmessages'].'</span>' : '0'; |
|
29 | 29 | $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); |
30 | 30 | $msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages); |
31 | 31 | $ph['MessageInfo'] = implode("\n", $msg); |
32 | 32 | } |
33 | 33 | |
34 | 34 | // setup icons |
35 | -if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { |
|
35 | +if ($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { |
|
36 | 36 | $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]'; |
37 | 37 | $ph['SecurityIcon'] = wrapIcon($icon, 75); |
38 | 38 | } |
39 | -if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { |
|
39 | +if ($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { |
|
40 | 40 | $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]'; |
41 | 41 | $ph['WebUserIcon'] = wrapIcon($icon, 99); |
42 | 42 | } |
43 | -if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { |
|
43 | +if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { |
|
44 | 44 | $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]'; |
45 | 45 | $ph['ModulesIcon'] = wrapIcon($icon, 106); |
46 | 46 | } |
47 | -if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { |
|
47 | +if ($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { |
|
48 | 48 | $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]'; |
49 | 49 | $ph['ResourcesIcon'] = wrapIcon($icon, 76); |
50 | 50 | } |
51 | -if($modx->hasPermission('bk_manager')) { |
|
51 | +if ($modx->hasPermission('bk_manager')) { |
|
52 | 52 | $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]'; |
53 | 53 | $ph['BackupIcon'] = wrapIcon($icon, 93); |
54 | 54 | } |
55 | -if($modx->hasPermission('help')) { |
|
55 | +if ($modx->hasPermission('help')) { |
|
56 | 56 | $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]'; |
57 | 57 | $ph['HelpIcon'] = wrapIcon($icon, 9); |
58 | 58 | } |
59 | 59 | |
60 | -if($modx->hasPermission('new_document')) { |
|
60 | +if ($modx->hasPermission('new_document')) { |
|
61 | 61 | $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]'; |
62 | 62 | $ph['ResourceIcon'] = wrapIcon($icon, 4); |
63 | 63 | $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]'; |
64 | 64 | $ph['WeblinkIcon'] = wrapIcon($icon, 72); |
65 | 65 | } |
66 | -if($modx->hasPermission('assets_images')) { |
|
66 | +if ($modx->hasPermission('assets_images')) { |
|
67 | 67 | $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]'; |
68 | 68 | $ph['ImagesIcon'] = wrapIcon($icon, 72); |
69 | 69 | } |
70 | -if($modx->hasPermission('assets_files')) { |
|
70 | +if ($modx->hasPermission('assets_files')) { |
|
71 | 71 | $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]'; |
72 | 72 | $ph['FilesIcon'] = wrapIcon($icon, 72); |
73 | 73 | } |
74 | -if($modx->hasPermission('change_password')) { |
|
74 | +if ($modx->hasPermission('change_password')) { |
|
75 | 75 | $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]'; |
76 | 76 | $ph['PasswordIcon'] = wrapIcon($icon, 28); |
77 | 77 | } |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | $ph['LogoutIcon'] = wrapIcon($icon, 8); |
80 | 80 | |
81 | 81 | // do some config checks |
82 | -if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { |
|
83 | - include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
|
84 | - if($config_check_results != $_lang['configcheck_ok']) { |
|
82 | +if (($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { |
|
83 | + include_once(MODX_MANAGER_PATH.'includes/config_check.inc.php'); |
|
84 | + if ($config_check_results != $_lang['configcheck_ok']) { |
|
85 | 85 | $ph['config_check_results'] = $config_check_results; |
86 | 86 | $ph['config_display'] = 'block'; |
87 | 87 | } else { |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | } |
93 | 93 | |
94 | 94 | // Check logout-reminder |
95 | -if(isset($_SESSION['show_logout_reminder'])) { |
|
96 | - switch($_SESSION['show_logout_reminder']['type']) { |
|
95 | +if (isset($_SESSION['show_logout_reminder'])) { |
|
96 | + switch ($_SESSION['show_logout_reminder']['type']) { |
|
97 | 97 | case 'logout_reminder': |
98 | 98 | $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); |
99 | 99 | $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | </tr> |
148 | 148 | </table>'; |
149 | 149 | |
150 | -$nrnewmessages = '<span class="text-danger">' . $_SESSION['nrnewmessages'] . '</span>'; |
|
150 | +$nrnewmessages = '<span class="text-danger">'.$_SESSION['nrnewmessages'].'</span>'; |
|
151 | 151 | |
152 | 152 | $ph['UserInfo'] = $modx->parseText($tpl, array( |
153 | 153 | 'username' => $modx->getLoginUserName(), |
@@ -162,10 +162,10 @@ discard block |
||
162 | 162 | $from[] = " us LEFT JOIN [+prefix+]active_users au ON au.sid=us.sid WHERE au.action <> '8'"; |
163 | 163 | $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC'); |
164 | 164 | |
165 | -if($modx->db->getRecordCount($rs) < 1) { |
|
165 | +if ($modx->db->getRecordCount($rs) < 1) { |
|
166 | 166 | $html = '<p>[%no_active_users_found%]</p>'; |
167 | 167 | } else { |
168 | - include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
|
168 | + include_once(MODX_MANAGER_PATH.'includes/actionlist.inc.php'); |
|
169 | 169 | $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
170 | 170 | $ph['now'] = strftime('%H:%M:%S', $now); |
171 | 171 | $timetocheck = ($now - (60 * 20)); //+$server_offset_time; |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | $userList = array(); |
191 | 191 | $userCount = array(); |
192 | 192 | // Create userlist with session-count first before output |
193 | - while($activeusers = $modx->db->getRow($rs)) { |
|
193 | + while ($activeusers = $modx->db->getRow($rs)) { |
|
194 | 194 | $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
195 | 195 | |
196 | 196 | $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
@@ -208,9 +208,9 @@ discard block |
||
208 | 208 | $currentaction |
209 | 209 | ); |
210 | 210 | } |
211 | - foreach($userList as $params) { |
|
211 | + foreach ($userList as $params) { |
|
212 | 212 | $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; |
213 | - $html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params); |
|
213 | + $html .= "\n\t\t".vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params); |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | $html .= ' |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | $ph['OnlineInfo'] = $html; |
223 | 223 | |
224 | 224 | // include rss feeds for important forum topics |
225 | -include_once(MODX_MANAGER_PATH . 'includes/rss.inc.php'); |
|
225 | +include_once(MODX_MANAGER_PATH.'includes/rss.inc.php'); |
|
226 | 226 | $ph['modx_security_notices_content'] = $feedData['modx_security_notices_content']; |
227 | 227 | $ph['modx_news_content'] = $feedData['modx_news_content']; |
228 | 228 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | |
254 | 254 | // invoke event OnManagerWelcomePrerender |
255 | 255 | $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender'); |
256 | -if(is_array($evtOut)) { |
|
256 | +if (is_array($evtOut)) { |
|
257 | 257 | $output = implode('', $evtOut); |
258 | 258 | $ph['OnManagerWelcomePrerender'] = $output; |
259 | 259 | } |
@@ -383,57 +383,57 @@ discard block |
||
383 | 383 | |
384 | 384 | // invoke OnManagerWelcomeHome event |
385 | 385 | $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets)); |
386 | -if(is_array($sitewidgets)) { |
|
386 | +if (is_array($sitewidgets)) { |
|
387 | 387 | $newwidgets = array(); |
388 | - foreach($sitewidgets as $widget){ |
|
388 | + foreach ($sitewidgets as $widget) { |
|
389 | 389 | $newwidgets = array_merge($newwidgets, unserialize($widget)); |
390 | 390 | } |
391 | 391 | $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets; |
392 | 392 | } |
393 | 393 | |
394 | -usort($widgets, function ($a, $b) { |
|
394 | +usort($widgets, function($a, $b){ |
|
395 | 395 | return $a['menuindex'] - $b['menuindex']; |
396 | 396 | }); |
397 | 397 | |
398 | 398 | $tpl = getTplWidget(); |
399 | 399 | $output = ''; |
400 | -foreach($widgets as $widget) { |
|
401 | - if ($widget['hide'] != '1'){ |
|
400 | +foreach ($widgets as $widget) { |
|
401 | + if ($widget['hide'] != '1') { |
|
402 | 402 | $output .= $modx->parseText($tpl, $widget); |
403 | 403 | } |
404 | 404 | } |
405 | 405 | $ph['widgets'] = $output; |
406 | 406 | |
407 | 407 | // load template |
408 | -if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { |
|
409 | - $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; |
|
408 | +if (!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { |
|
409 | + $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH.'media/style/common/welcome.tpl'; |
|
410 | 410 | } |
411 | 411 | |
412 | 412 | $target = $modx->config['manager_welcome_tpl']; |
413 | 413 | $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target); |
414 | 414 | $target = $modx->mergeSettingsContent($target); |
415 | 415 | |
416 | -if(substr($target, 0, 1) === '@') { |
|
417 | - if(substr($target, 0, 6) === '@CHUNK') { |
|
416 | +if (substr($target, 0, 1) === '@') { |
|
417 | + if (substr($target, 0, 6) === '@CHUNK') { |
|
418 | 418 | $content = $modx->getChunk(trim(substr($target, 7))); |
419 | - } elseif(substr($target, 0, 5) === '@FILE') { |
|
419 | + } elseif (substr($target, 0, 5) === '@FILE') { |
|
420 | 420 | $content = file_get_contents(trim(substr($target, 6))); |
421 | 421 | } else { |
422 | 422 | $content = ''; |
423 | 423 | } |
424 | 424 | } else { |
425 | 425 | $chunk = $modx->getChunk($target); |
426 | - if($chunk !== false && !empty($chunk)) { |
|
426 | + if ($chunk !== false && !empty($chunk)) { |
|
427 | 427 | $content = $chunk; |
428 | - } elseif(is_file(MODX_BASE_PATH . $target)) { |
|
429 | - $content = file_get_contents(MODX_BASE_PATH . $target); |
|
430 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { |
|
431 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); |
|
432 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible |
|
428 | + } elseif (is_file(MODX_BASE_PATH.$target)) { |
|
429 | + $content = file_get_contents(MODX_BASE_PATH.$target); |
|
430 | + } elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/welcome.tpl')) { |
|
431 | + $content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/welcome.tpl'); |
|
432 | + } elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html')) // ClipperCMS compatible |
|
433 | 433 | { |
434 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
434 | + $content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html'); |
|
435 | 435 | } else { |
436 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
|
436 | + $content = file_get_contents(MODX_MANAGER_PATH.'media/style/common/welcome.tpl'); |
|
437 | 437 | } |
438 | 438 | } |
439 | 439 | |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | $content = $modx->mergeConditionalTagsContent($content); |
442 | 442 | $content = $modx->mergeSettingsContent($content); |
443 | 443 | $content = $modx->parseText($content, $ph); |
444 | -if(strpos($content, '[+') !== false) { |
|
444 | +if (strpos($content, '[+') !== false) { |
|
445 | 445 | $modx->toPlaceholders($ph); |
446 | 446 | $content = $modx->mergePlaceholderContent($content); |
447 | 447 | } |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | $content = $modx->parseText($content, $_style, '[&', '&]'); |
451 | 451 | $content = $modx->cleanUpMODXTags($content); //cleanup |
452 | 452 | |
453 | -if($js = $modx->getRegisteredClientScripts()) { |
|
453 | +if ($js = $modx->getRegisteredClientScripts()) { |
|
454 | 454 | $content .= $js; |
455 | 455 | } |
456 | 456 | |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | // <a href="javascript:;" class="setting"><i class="fa fa-cog"></i></a> |
461 | 461 | // <a href="javascript:;" class="closed"><i class="fa fa-close"></i></a> |
462 | 462 | //</span> |
463 | -if(!function_exists('getTplWidget')) { |
|
463 | +if (!function_exists('getTplWidget')) { |
|
464 | 464 | function getTplWidget() |
465 | 465 | { // recent document info |
466 | 466 | return ' |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | } |
475 | 475 | } |
476 | 476 | |
477 | -if(!function_exists('getRecentInfo')) { |
|
477 | +if (!function_exists('getRecentInfo')) { |
|
478 | 478 | function getRecentInfo() |
479 | 479 | { // recent document info |
480 | 480 | $modx = evolutionCMS(); |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | } |
505 | 505 | } |
506 | 506 | |
507 | -if(!function_exists('getRecentInfoList')) { |
|
507 | +if (!function_exists('getRecentInfoList')) { |
|
508 | 508 | function getRecentInfoList() |
509 | 509 | { |
510 | 510 | $modx = evolutionCMS(); |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | } |
595 | 595 | } |
596 | 596 | |
597 | -if(!function_exists('getRecentInfoRowTpl')) { |
|
597 | +if (!function_exists('getRecentInfoRowTpl')) { |
|
598 | 598 | function getRecentInfoRowTpl() |
599 | 599 | { |
600 | 600 | $tpl = ' |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | } |
627 | 627 | } |
628 | 628 | |
629 | -if(!function_exists('wrapIcon')) { |
|
629 | +if (!function_exists('wrapIcon')) { |
|
630 | 630 | // setup icons |
631 | 631 | function wrapIcon($i, $action) |
632 | 632 | { |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | } |
636 | 636 | } |
637 | 637 | |
638 | -if(!function_exists('getStartUpScript')) { |
|
638 | +if (!function_exists('getStartUpScript')) { |
|
639 | 639 | function getStartUpScript() |
640 | 640 | { |
641 | 641 | $script = ' |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | exit(); |
4 | 4 | } |
5 | 5 | unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | <?php |
42 | 42 | $rs = $modx->db->select('*', $modx->getFullTableName('site_templates')); |
43 | 43 | $option[] = '<option value="">No selected</option>'; |
44 | - $templateid = (isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '') ? (int)$_REQUEST['templateid'] : ''; |
|
44 | + $templateid = (isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '') ? (int) $_REQUEST['templateid'] : ''; |
|
45 | 45 | $selected = $templateid === 0 ? ' selected="selected"' : ''; |
46 | - $option[] = '<option value="0"' . $selected . '>(blank)</option>'; |
|
46 | + $option[] = '<option value="0"'.$selected.'>(blank)</option>'; |
|
47 | 47 | while ($row = $modx->db->getRow($rs)) { |
48 | 48 | $templatename = htmlspecialchars($row['templatename'], ENT_QUOTES, $modx->config['modx_charset']); |
49 | 49 | $selected = $row['id'] == $templateid ? ' selected="selected"' : ''; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $searchfields = htmlentities(trim($_POST['searchfields']), ENT_QUOTES, $modx_manager_charset); |
87 | 87 | $searchlongtitle = $modx->db->escape(trim($_REQUEST['searchfields'])); |
88 | 88 | $search_alias = $modx->db->escape(trim($_REQUEST['searchfields'])); |
89 | - $templateid = isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '' ? (int)$_REQUEST['templateid'] : ''; |
|
89 | + $templateid = isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '' ? (int) $_REQUEST['templateid'] : ''; |
|
90 | 90 | $searchcontent = $modx->db->escape($_REQUEST['content']); |
91 | 91 | |
92 | 92 | $fields = 'DISTINCT sc.id, contenttype, pagetitle, longtitle, description, introtext, menutitle, deleted, published, isfolder, type'; |
@@ -100,12 +100,12 @@ discard block |
||
100 | 100 | $friendly_url_suffix = $modx->config['friendly_url_suffix']; |
101 | 101 | $base_url = $modx->config['base_url']; |
102 | 102 | $site_url = $modx->config['site_url']; |
103 | - $url = preg_replace('@' . $friendly_url_suffix . '$@', '', $url); |
|
103 | + $url = preg_replace('@'.$friendly_url_suffix.'$@', '', $url); |
|
104 | 104 | if ($url[0] === '/') { |
105 | - $url = preg_replace('@^' . $base_url . '@', '', $url); |
|
105 | + $url = preg_replace('@^'.$base_url.'@', '', $url); |
|
106 | 106 | } |
107 | 107 | if (substr($url, 0, 4) === 'http') { |
108 | - $url = preg_replace('@^' . $site_url . '@', '', $url); |
|
108 | + $url = preg_replace('@^'.$site_url.'@', '', $url); |
|
109 | 109 | } |
110 | 110 | $idFromAlias = $modx->getIdFromAlias($url); |
111 | 111 | } |
@@ -118,18 +118,18 @@ discard block |
||
118 | 118 | $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'"; |
119 | 119 | $articul_result = $modx->db->query($articul_query); |
120 | 120 | $articul_id_array = $modx->db->makeArray($articul_result); |
121 | - if(count($articul_id_array)>0){ |
|
121 | + if (count($articul_id_array) > 0) { |
|
122 | 122 | $articul_id = ''; |
123 | 123 | $i = 1; |
124 | - foreach( $articul_id_array as $articul ) { |
|
125 | - $articul_id.=$articul['contentid']; |
|
126 | - if($i !== count($articul_id_array)){ |
|
127 | - $articul_id.=','; |
|
124 | + foreach ($articul_id_array as $articul) { |
|
125 | + $articul_id .= $articul['contentid']; |
|
126 | + if ($i !== count($articul_id_array)) { |
|
127 | + $articul_id .= ','; |
|
128 | 128 | } |
129 | 129 | $i++; |
130 | 130 | } |
131 | 131 | $articul_id_query = " OR sc.id IN ({$articul_id})"; |
132 | - }else{ |
|
132 | + } else { |
|
133 | 133 | $articul_id_query = ''; |
134 | 134 | } |
135 | 135 | /*end search by TV*/ |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | if (ctype_digit($searchfields)) { |
138 | 138 | $sqladd .= "sc.id='{$searchfields}'"; |
139 | 139 | if (strlen($searchfields) > 3) { |
140 | - $sqladd .= $articul_id_query;//search by TV |
|
140 | + $sqladd .= $articul_id_query; //search by TV |
|
141 | 141 | $sqladd .= " OR sc.pagetitle LIKE '%{$searchfields}%'"; |
142 | 142 | } |
143 | 143 | } |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $sqladd .= " OR sc.introtext LIKE '%{$searchlongtitle}%'"; |
158 | 158 | $sqladd .= " OR sc.menutitle LIKE '%{$searchlongtitle}%'"; |
159 | 159 | $sqladd .= " OR sc.alias LIKE '%{$search_alias}%'"; |
160 | - $sqladd .= $articul_id_query;//search by TV |
|
160 | + $sqladd .= $articul_id_query; //search by TV |
|
161 | 161 | $sqladd .= ")"; |
162 | 162 | } |
163 | 163 | } else if ($idFromAlias) { |
@@ -181,8 +181,8 @@ discard block |
||
181 | 181 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
182 | 182 | $mgrRole = (isset ($_SESSION['mgrRole']) && $_SESSION['mgrRole'] == 1) ? 1 : 0; |
183 | 183 | $docgrp_cond = $docgrp ? " OR dg.document_group IN ({$docgrp})" : ''; |
184 | - $fields .= ', MAX(IF(1=' . $mgrRole . ' OR sc.privatemgr=0' . $docgrp_cond . ',1,0)) AS hasAccess'; |
|
185 | - $sqladd = '(' . $sqladd . ") AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
184 | + $fields .= ', MAX(IF(1='.$mgrRole.' OR sc.privatemgr=0'.$docgrp_cond.',1,0)) AS hasAccess'; |
|
185 | + $sqladd = '('.$sqladd.") AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | if ($sqladd) { |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $where = $sqladd; |
193 | 193 | |
194 | 194 | if ($where) { |
195 | - $rs = $modx->db->select($fields, $tbl_site_content . ' AS sc LEFT JOIN ' . $tbldg . ' AS dg ON dg.document=sc.id', $where, 'sc.id'); |
|
195 | + $rs = $modx->db->select($fields, $tbl_site_content.' AS sc LEFT JOIN '.$tbldg.' AS dg ON dg.document=sc.id', $where, 'sc.id'); |
|
196 | 196 | $limit = $modx->db->getRecordCount($rs); |
197 | 197 | } else { |
198 | 198 | $limit = 0; |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | if ($limit < 1) { |
212 | 212 | echo $_lang['search_empty']; |
213 | 213 | } else { |
214 | - printf('<p>' . $_lang['search_results_returned_msg'] . '</p>', $limit); |
|
214 | + printf('<p>'.$_lang['search_results_returned_msg'].'</p>', $limit); |
|
215 | 215 | ?> |
216 | 216 | <script type="text/javascript" src="media/script/tablesort.js"></script> |
217 | 217 | <table class="grid sortabletable sortable-onload-2 rowstyle-even" id="table-1"> |
@@ -271,14 +271,14 @@ discard block |
||
271 | 271 | if (function_exists('mb_strlen') && function_exists('mb_substr')) { |
272 | 272 | ?> |
273 | 273 | <td<?= $tdClass ?>> |
274 | - <a href="index.php?a=27&id=<?= $row['id'] ?>"><?= mb_strlen($row['pagetitle'], $modx_manager_charset) > 70 ? mb_substr($row['pagetitle'], 0, 70, $modx_manager_charset) . "..." : $row['pagetitle'] ?></a> |
|
274 | + <a href="index.php?a=27&id=<?= $row['id'] ?>"><?= mb_strlen($row['pagetitle'], $modx_manager_charset) > 70 ? mb_substr($row['pagetitle'], 0, 70, $modx_manager_charset)."..." : $row['pagetitle'] ?></a> |
|
275 | 275 | </td> |
276 | - <td<?= $tdClass ?>><?= mb_strlen($row['description'], $modx_manager_charset) > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset) . "..." : $row['description'] ?></td> |
|
276 | + <td<?= $tdClass ?>><?= mb_strlen($row['description'], $modx_manager_charset) > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset)."..." : $row['description'] ?></td> |
|
277 | 277 | <?php |
278 | 278 | } else { |
279 | 279 | ?> |
280 | - <td<?= $tdClass ?>><?= strlen($row['pagetitle']) > 20 ? substr($row['pagetitle'], 0, 20) . '...' : $row['pagetitle'] ?></td> |
|
281 | - <td<?= $tdClass ?>><?= strlen($row['description']) > 35 ? substr($row['description'], 0, 35) . '...' : $row['description'] ?></td> |
|
280 | + <td<?= $tdClass ?>><?= strlen($row['pagetitle']) > 20 ? substr($row['pagetitle'], 0, 20).'...' : $row['pagetitle'] ?></td> |
|
281 | + <td<?= $tdClass ?>><?= strlen($row['description']) > 35 ? substr($row['description'], 0, 35).'...' : $row['description'] ?></td> |
|
282 | 282 | <?php |
283 | 283 | } |
284 | 284 | ?> |
@@ -298,115 +298,115 @@ discard block |
||
298 | 298 | if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { |
299 | 299 | $docscounts = $modx->db->getRecordCount($rs); |
300 | 300 | if ($docscounts > 0) { |
301 | - $output .= '<li><b><i class="fa fa-sitemap"></i> ' . $_lang["manage_documents"] . ' (' . $docscounts . ')</b></li>'; |
|
301 | + $output .= '<li><b><i class="fa fa-sitemap"></i> '.$_lang["manage_documents"].' ('.$docscounts.')</b></li>'; |
|
302 | 302 | while ($row = $modx->db->getRow($rs)) { |
303 | - $output .= '<li' . addClassForItemList('', !$row['published'], $row['deleted']) . '><a href="index.php?a=27&id=' . $row['id'] . '" id="content_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['pagetitle'] . ' <small>(' . $row['id'] . ')</small>', $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
303 | + $output .= '<li'.addClassForItemList('', !$row['published'], $row['deleted']).'><a href="index.php?a=27&id='.$row['id'].'" id="content_'.$row['id'].'" target="main">'.highlightingCoincidence($row['pagetitle'].' <small>('.$row['id'].')</small>', $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
304 | 304 | } |
305 | 305 | } |
306 | 306 | } |
307 | 307 | |
308 | 308 | //templates |
309 | 309 | if ($modx->hasPermission('edit_template')) { |
310 | - $rs = $modx->db->select("id,templatename,locked", $modx->getFullTableName('site_templates'), "`id` like '%" . $searchfields . "%' |
|
311 | - OR `templatename` like '%" . $searchfields . "%' |
|
312 | - OR `description` like '%" . $searchfields . "%' |
|
313 | - OR `content` like '%" . $searchfields . "%'"); |
|
310 | + $rs = $modx->db->select("id,templatename,locked", $modx->getFullTableName('site_templates'), "`id` like '%".$searchfields."%' |
|
311 | + OR `templatename` like '%" . $searchfields."%' |
|
312 | + OR `description` like '%" . $searchfields."%' |
|
313 | + OR `content` like '%" . $searchfields."%'"); |
|
314 | 314 | $templatecounts = $modx->db->getRecordCount($rs); |
315 | 315 | if ($templatecounts > 0) { |
316 | - $output .= '<li><b><i class="fa fa-newspaper-o"></i> ' . $_lang["manage_templates"] . ' (' . $templatecounts . ')</b></li>'; |
|
316 | + $output .= '<li><b><i class="fa fa-newspaper-o"></i> '.$_lang["manage_templates"].' ('.$templatecounts.')</b></li>'; |
|
317 | 317 | while ($row = $modx->db->getRow($rs)) { |
318 | - $output .= '<li' . addClassForItemList($row['locked']) . '><a href="index.php?a=16&id=' . $row['id'] . '" id="templates_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['templatename'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
318 | + $output .= '<li'.addClassForItemList($row['locked']).'><a href="index.php?a=16&id='.$row['id'].'" id="templates_'.$row['id'].'" target="main">'.highlightingCoincidence($row['templatename'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
319 | 319 | } |
320 | 320 | } |
321 | 321 | } |
322 | 322 | |
323 | 323 | //tvs |
324 | 324 | if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
325 | - $rs = $modx->db->select("id,name,locked", $modx->getFullTableName('site_tmplvars'), "`id` like '%" . $searchfields . "%' |
|
326 | - OR `name` like '%" . $searchfields . "%' |
|
327 | - OR `description` like '%" . $searchfields . "%' |
|
328 | - OR `type` like '%" . $searchfields . "%' |
|
329 | - OR `elements` like '%" . $searchfields . "%' |
|
330 | - OR `display` like '%" . $searchfields . "%' |
|
331 | - OR `display_params` like '%" . $searchfields . "%' |
|
332 | - OR `default_text` like '%" . $searchfields . "%'"); |
|
325 | + $rs = $modx->db->select("id,name,locked", $modx->getFullTableName('site_tmplvars'), "`id` like '%".$searchfields."%' |
|
326 | + OR `name` like '%" . $searchfields."%' |
|
327 | + OR `description` like '%" . $searchfields."%' |
|
328 | + OR `type` like '%" . $searchfields."%' |
|
329 | + OR `elements` like '%" . $searchfields."%' |
|
330 | + OR `display` like '%" . $searchfields."%' |
|
331 | + OR `display_params` like '%" . $searchfields."%' |
|
332 | + OR `default_text` like '%" . $searchfields."%'"); |
|
333 | 333 | $tvscounts = $modx->db->getRecordCount($rs); |
334 | 334 | if ($tvscounts > 0) { |
335 | - $output .= '<li><b><i class="fa fa-list-alt"></i> ' . $_lang["settings_templvars"] . ' (' . $tvscounts . ')</b></li>'; |
|
335 | + $output .= '<li><b><i class="fa fa-list-alt"></i> '.$_lang["settings_templvars"].' ('.$tvscounts.')</b></li>'; |
|
336 | 336 | while ($row = $modx->db->getRow($rs)) { |
337 | - $output .= '<li' . addClassForItemList($row['locked']) . '><a href="index.php?a=301&id=' . $row['id'] . '" id="tmplvars_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
337 | + $output .= '<li'.addClassForItemList($row['locked']).'><a href="index.php?a=301&id='.$row['id'].'" id="tmplvars_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
338 | 338 | } |
339 | 339 | } |
340 | 340 | } |
341 | 341 | |
342 | 342 | //Chunks |
343 | 343 | if ($modx->hasPermission('edit_chunk')) { |
344 | - $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_htmlsnippets'), "`id` like '%" . $searchfields . "%' |
|
345 | - OR `name` like '%" . $searchfields . "%' |
|
346 | - OR `description` like '%" . $searchfields . "%' |
|
347 | - OR `snippet` like '%" . $searchfields . "%'"); |
|
344 | + $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_htmlsnippets'), "`id` like '%".$searchfields."%' |
|
345 | + OR `name` like '%" . $searchfields."%' |
|
346 | + OR `description` like '%" . $searchfields."%' |
|
347 | + OR `snippet` like '%" . $searchfields."%'"); |
|
348 | 348 | $chunkscounts = $modx->db->getRecordCount($rs); |
349 | 349 | if ($chunkscounts > 0) { |
350 | - $output .= '<li><b><i class="fa fa-th-large"></i> ' . $_lang["manage_htmlsnippets"] . ' (' . $chunkscounts . ')</b></li>'; |
|
350 | + $output .= '<li><b><i class="fa fa-th-large"></i> '.$_lang["manage_htmlsnippets"].' ('.$chunkscounts.')</b></li>'; |
|
351 | 351 | while ($row = $modx->db->getRow($rs)) { |
352 | - $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=78&id=' . $row['id'] . '" id="htmlsnippets_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
352 | + $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=78&id='.$row['id'].'" id="htmlsnippets_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
353 | 353 | } |
354 | 354 | } |
355 | 355 | } |
356 | 356 | |
357 | 357 | //Snippets |
358 | 358 | if ($modx->hasPermission('edit_snippet')) { |
359 | - $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_snippets'), "`id` like '%" . $searchfields . "%' |
|
360 | - OR `name` like '%" . $searchfields . "%' |
|
361 | - OR `description` like '%" . $searchfields . "%' |
|
362 | - OR `snippet` like '%" . $searchfields . "%' |
|
363 | - OR `properties` like '%" . $searchfields . "%' |
|
364 | - OR `moduleguid` like '%" . $searchfields . "%'"); |
|
359 | + $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_snippets'), "`id` like '%".$searchfields."%' |
|
360 | + OR `name` like '%" . $searchfields."%' |
|
361 | + OR `description` like '%" . $searchfields."%' |
|
362 | + OR `snippet` like '%" . $searchfields."%' |
|
363 | + OR `properties` like '%" . $searchfields."%' |
|
364 | + OR `moduleguid` like '%" . $searchfields."%'"); |
|
365 | 365 | $snippetscounts = $modx->db->getRecordCount($rs); |
366 | 366 | if ($snippetscounts > 0) { |
367 | - $output .= '<li><b><i class="fa fa-code"></i> ' . $_lang["manage_snippets"] . ' (' . $snippetscounts . ')</b></li>'; |
|
367 | + $output .= '<li><b><i class="fa fa-code"></i> '.$_lang["manage_snippets"].' ('.$snippetscounts.')</b></li>'; |
|
368 | 368 | while ($row = $modx->db->getRow($rs)) { |
369 | - $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=22&id=' . $row['id'] . '" id="snippets_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
369 | + $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=22&id='.$row['id'].'" id="snippets_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
370 | 370 | } |
371 | 371 | } |
372 | 372 | } |
373 | 373 | |
374 | 374 | //plugins |
375 | 375 | if ($modx->hasPermission('edit_plugin')) { |
376 | - $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_plugins'), "`id` like '%" . $searchfields . "%' |
|
377 | - OR `name` like '%" . $searchfields . "%' |
|
378 | - OR `description` like '%" . $searchfields . "%' |
|
379 | - OR `plugincode` like '%" . $searchfields . "%' |
|
380 | - OR `properties` like '%" . $searchfields . "%' |
|
381 | - OR `moduleguid` like '%" . $searchfields . "%'"); |
|
376 | + $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_plugins'), "`id` like '%".$searchfields."%' |
|
377 | + OR `name` like '%" . $searchfields."%' |
|
378 | + OR `description` like '%" . $searchfields."%' |
|
379 | + OR `plugincode` like '%" . $searchfields."%' |
|
380 | + OR `properties` like '%" . $searchfields."%' |
|
381 | + OR `moduleguid` like '%" . $searchfields."%'"); |
|
382 | 382 | $pluginscounts = $modx->db->getRecordCount($rs); |
383 | 383 | if ($pluginscounts > 0) { |
384 | - $output .= '<li><b><i class="fa fa-plug"></i> ' . $_lang["manage_plugins"] . ' (' . $pluginscounts . ')</b></li>'; |
|
384 | + $output .= '<li><b><i class="fa fa-plug"></i> '.$_lang["manage_plugins"].' ('.$pluginscounts.')</b></li>'; |
|
385 | 385 | while ($row = $modx->db->getRow($rs)) { |
386 | - $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=102&id=' . $row['id'] . '" id="plugins_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
386 | + $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=102&id='.$row['id'].'" id="plugins_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
387 | 387 | } |
388 | 388 | } |
389 | 389 | } |
390 | 390 | |
391 | 391 | //modules |
392 | 392 | if ($modx->hasPermission('edit_module')) { |
393 | - $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_modules'), "`id` like '%" . $searchfields . "%' |
|
394 | - OR `name` like '%" . $searchfields . "%' |
|
395 | - OR `description` like '%" . $searchfields . "%' |
|
396 | - OR `modulecode` like '%" . $searchfields . "%' |
|
397 | - OR `properties` like '%" . $searchfields . "%' |
|
398 | - OR `guid` like '%" . $searchfields . "%' |
|
399 | - OR `resourcefile` like '%" . $searchfields . "%'"); |
|
393 | + $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_modules'), "`id` like '%".$searchfields."%' |
|
394 | + OR `name` like '%" . $searchfields."%' |
|
395 | + OR `description` like '%" . $searchfields."%' |
|
396 | + OR `modulecode` like '%" . $searchfields."%' |
|
397 | + OR `properties` like '%" . $searchfields."%' |
|
398 | + OR `guid` like '%" . $searchfields."%' |
|
399 | + OR `resourcefile` like '%" . $searchfields."%'"); |
|
400 | 400 | $modulescounts = $modx->db->getRecordCount($rs); |
401 | 401 | if ($modulescounts > 0) { |
402 | - $output .= '<li><b><i class="fa fa-cogs"></i> ' . $_lang["modules"] . ' (' . $modulescounts . ')</b></li>'; |
|
402 | + $output .= '<li><b><i class="fa fa-cogs"></i> '.$_lang["modules"].' ('.$modulescounts.')</b></li>'; |
|
403 | 403 | while ($row = $modx->db->getRow($rs)) { |
404 | - $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=108&id=' . $row['id'] . '" id="modules_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
404 | + $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=108&id='.$row['id'].'" id="modules_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
405 | 405 | } |
406 | 406 | } |
407 | 407 | } |
408 | 408 | |
409 | - echo $output ? '<div class="ajaxSearchResults"><ul>' . $output . '</ul></div>' : '1'; |
|
409 | + echo $output ? '<div class="ajaxSearchResults"><ul>'.$output.'</ul></div>' : '1'; |
|
410 | 410 | } |
411 | 411 | |
412 | 412 | ?> |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | <?php |
416 | 416 | } |
417 | 417 | |
418 | -if(!function_exists('highlightingCoincidence')) { |
|
418 | +if (!function_exists('highlightingCoincidence')) { |
|
419 | 419 | /** |
420 | 420 | * @param string $text |
421 | 421 | * @param string $search |
@@ -423,19 +423,19 @@ discard block |
||
423 | 423 | */ |
424 | 424 | function highlightingCoincidence($text, $search) |
425 | 425 | { |
426 | - $regexp = '!(' . str_replace(array( |
|
426 | + $regexp = '!('.str_replace(array( |
|
427 | 427 | '(', |
428 | 428 | ')' |
429 | 429 | ), array( |
430 | 430 | '\(', |
431 | 431 | '\)' |
432 | - ), trim($search)) . ')!isu'; |
|
432 | + ), trim($search)).')!isu'; |
|
433 | 433 | |
434 | 434 | return preg_replace($regexp, '<span class="text-danger">$1</span>', $text); |
435 | 435 | } |
436 | 436 | } |
437 | 437 | |
438 | -if(!function_exists('addClassForItemList')) { |
|
438 | +if (!function_exists('addClassForItemList')) { |
|
439 | 439 | /** |
440 | 440 | * @param string $locked |
441 | 441 | * @param string $disabled |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | $class .= ' deleted'; |
456 | 456 | } |
457 | 457 | if ($class) { |
458 | - $class = ' class="' . trim($class) . '"'; |
|
458 | + $class = ' class="'.trim($class).'"'; |
|
459 | 459 | } |
460 | 460 | |
461 | 461 | return $class; |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if (!$modx->hasPermission('logs')) { |
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -if(!function_exists('array_unique_multi')) { |
|
9 | +if (!function_exists('array_unique_multi')) { |
|
10 | 10 | /** |
11 | 11 | * @param array $array |
12 | 12 | * @param string $checkKey |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | } |
35 | 35 | } |
36 | 36 | |
37 | -if(!function_exists('record_sort')) { |
|
37 | +if (!function_exists('record_sort')) { |
|
38 | 38 | /** |
39 | 39 | * @param array $array |
40 | 40 | * @param string $key |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $logs_user = record_sort(array_unique_multi($logs, 'internalKey'), 'username'); |
81 | 81 | foreach ($logs_user as $row) { |
82 | 82 | $selectedtext = $row['internalKey'] == $_REQUEST['searchuser'] ? ' selected="selected"' : ''; |
83 | - echo "\t\t" . '<option value="' . $row['internalKey'] . '"' . $selectedtext . '>' . $row['username'] . "</option>\n"; |
|
83 | + echo "\t\t".'<option value="'.$row['internalKey'].'"'.$selectedtext.'>'.$row['username']."</option>\n"; |
|
84 | 84 | } |
85 | 85 | ?> |
86 | 86 | </select> |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | continue; |
102 | 102 | } |
103 | 103 | $selectedtext = $row['action'] == $_REQUEST['action'] ? ' selected="selected"' : ''; |
104 | - echo "\t\t" . '<option value="' . $row['action'] . '"' . $selectedtext . '>' . $row['action'] . ' - ' . $action . "</option>\n"; |
|
104 | + echo "\t\t".'<option value="'.$row['action'].'"'.$selectedtext.'>'.$row['action'].' - '.$action."</option>\n"; |
|
105 | 105 | } |
106 | 106 | ?> |
107 | 107 | </select> |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $logs_items = record_sort(array_unique_multi($logs, 'itemid'), 'itemid'); |
118 | 118 | foreach ($logs_items as $row) { |
119 | 119 | $selectedtext = $row['itemid'] == $_REQUEST['itemid'] ? ' selected="selected"' : ''; |
120 | - echo "\t\t" . '<option value="' . $row['itemid'] . '"' . $selectedtext . '>' . $row['itemid'] . "</option>\n"; |
|
120 | + echo "\t\t".'<option value="'.$row['itemid'].'"'.$selectedtext.'>'.$row['itemid']."</option>\n"; |
|
121 | 121 | } |
122 | 122 | ?> |
123 | 123 | </select> |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $logs_names = record_sort(array_unique_multi($logs, 'itemname'), 'itemname'); |
134 | 134 | foreach ($logs_names as $row) { |
135 | 135 | $selectedtext = $row['itemname'] == $_REQUEST['itemname'] ? ' selected="selected"' : ''; |
136 | - echo "\t\t" . '<option value="' . $row['itemname'] . '"' . $selectedtext . '>' . $row['itemname'] . "</option>\n"; |
|
136 | + echo "\t\t".'<option value="'.$row['itemname'].'"'.$selectedtext.'>'.$row['itemname']."</option>\n"; |
|
137 | 137 | } |
138 | 138 | ?> |
139 | 139 | </select> |
@@ -191,26 +191,26 @@ discard block |
||
191 | 191 | // get the selections the user made. |
192 | 192 | $sqladd = array(); |
193 | 193 | if ($_REQUEST['searchuser'] != 0) { |
194 | - $sqladd[] = "internalKey='" . (int)$_REQUEST['searchuser'] . "'"; |
|
194 | + $sqladd[] = "internalKey='".(int) $_REQUEST['searchuser']."'"; |
|
195 | 195 | } |
196 | 196 | if ($_REQUEST['action'] != 0) { |
197 | - $sqladd[] = "action=" . (int)$_REQUEST['action']; |
|
197 | + $sqladd[] = "action=".(int) $_REQUEST['action']; |
|
198 | 198 | } |
199 | 199 | if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") { |
200 | - $sqladd[] = "itemid='" . $_REQUEST['itemid'] . "'"; |
|
200 | + $sqladd[] = "itemid='".$_REQUEST['itemid']."'"; |
|
201 | 201 | } |
202 | 202 | if ($_REQUEST['itemname'] != '0') { |
203 | - $sqladd[] = "itemname='" . $modx->db->escape($_REQUEST['itemname']) . "'"; |
|
203 | + $sqladd[] = "itemname='".$modx->db->escape($_REQUEST['itemname'])."'"; |
|
204 | 204 | } |
205 | 205 | if ($_REQUEST['message'] != "") { |
206 | - $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'"; |
|
206 | + $sqladd[] = "message LIKE '%".$modx->db->escape($_REQUEST['message'])."%'"; |
|
207 | 207 | } |
208 | 208 | // date stuff |
209 | 209 | if ($_REQUEST['datefrom'] != "") { |
210 | - $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']); |
|
210 | + $sqladd[] = "timestamp>".$modx->toTimeStamp($_REQUEST['datefrom']); |
|
211 | 211 | } |
212 | 212 | if ($_REQUEST['dateto'] != "") { |
213 | - $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']); |
|
213 | + $sqladd[] = "timestamp<".$modx->toTimeStamp($_REQUEST['dateto']); |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | // If current position is not set, set it to zero |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | // Number of result to display on the page, will be in the LIMIT of the sql query also |
224 | 224 | $int_num_result = is_numeric($_REQUEST['nrresults']) ? $_REQUEST['nrresults'] : $number_of_logs; |
225 | 225 | |
226 | - $extargv = "&a=13&searchuser=" . $_REQUEST['searchuser'] . "&action=" . $_REQUEST['action'] . "&itemid=" . $_REQUEST['itemid'] . "&itemname=" . $_REQUEST['itemname'] . "&message=" . $_REQUEST['message'] . "&dateto=" . $_REQUEST['dateto'] . "&datefrom=" . $_REQUEST['datefrom'] . "&nrresults=" . $int_num_result . "&log_submit=" . $_REQUEST['log_submit']; // extra argv here (could be anything depending on your page) |
|
226 | + $extargv = "&a=13&searchuser=".$_REQUEST['searchuser']."&action=".$_REQUEST['action']."&itemid=".$_REQUEST['itemid']."&itemname=".$_REQUEST['itemname']."&message=".$_REQUEST['message']."&dateto=".$_REQUEST['dateto']."&datefrom=".$_REQUEST['datefrom']."&nrresults=".$int_num_result."&log_submit=".$_REQUEST['log_submit']; // extra argv here (could be anything depending on your page) |
|
227 | 227 | |
228 | 228 | // build the sql |
229 | 229 | $limit = $num_rows = $modx->db->getValue($modx->db->select('COUNT(*)', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''))); |
@@ -231,9 +231,9 @@ discard block |
||
231 | 231 | $rs = $modx->db->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}"); |
232 | 232 | |
233 | 233 | if ($limit < 1) { |
234 | - echo '<p>' . $_lang["mgrlog_emptysrch"] . '</p>'; |
|
234 | + echo '<p>'.$_lang["mgrlog_emptysrch"].'</p>'; |
|
235 | 235 | } else { |
236 | - echo '<p>' . $_lang["mgrlog_sortinst"] . '</p>'; |
|
236 | + echo '<p>'.$_lang["mgrlog_sortinst"].'</p>'; |
|
237 | 237 | |
238 | 238 | // New instance of the Paging class, you can modify the color and the width of the html table |
239 | 239 | $p = new EvolutionCMS\Support\Paginate($num_rows, $int_cur_position, $int_num_result, $extargv); |
@@ -244,11 +244,11 @@ discard block |
||
244 | 244 | $current_row = $int_cur_position / $int_num_result; |
245 | 245 | |
246 | 246 | // Display the result as you like... |
247 | - print "<p>" . $_lang["paging_showing"] . " " . $array_paging['lower']; |
|
248 | - print " " . $_lang["paging_to"] . " " . $array_paging['upper']; |
|
249 | - print " (" . $array_paging['total'] . " " . $_lang["paging_total"] . ")<br />"; |
|
250 | - $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? "</a> " : " "); |
|
251 | - $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? "</a> " : " "); |
|
247 | + print "<p>".$_lang["paging_showing"]." ".$array_paging['lower']; |
|
248 | + print " ".$_lang["paging_to"]." ".$array_paging['upper']; |
|
249 | + print " (".$array_paging['total']." ".$_lang["paging_total"].")<br />"; |
|
250 | + $paging = $array_paging['first_link'].$_lang["paging_first"].(isset($array_paging['first_link']) ? "</a> " : " "); |
|
251 | + $paging .= $array_paging['previous_link'].$_lang["paging_prev"].(isset($array_paging['previous_link']) ? "</a> " : " "); |
|
252 | 252 | $pagesfound = sizeof($array_row_paging); |
253 | 253 | if ($pagesfound > 6) { |
254 | 254 | $paging .= $array_row_paging[$current_row - 2]; // ." "; |
@@ -258,11 +258,11 @@ discard block |
||
258 | 258 | $paging .= $array_row_paging[$current_row + 2]; // ." "; |
259 | 259 | } else { |
260 | 260 | for ($i = 0; $i < $pagesfound; $i++) { |
261 | - $paging .= $array_row_paging[$i] . " "; |
|
261 | + $paging .= $array_row_paging[$i]." "; |
|
262 | 262 | } |
263 | 263 | } |
264 | - $paging .= $array_paging['next_link'] . $_lang["paging_next"] . (isset($array_paging['next_link']) ? "</a> " : " ") . " "; |
|
265 | - $paging .= $array_paging['last_link'] . $_lang["paging_last"] . (isset($array_paging['last_link']) ? "</a> " : " ") . " "; |
|
264 | + $paging .= $array_paging['next_link'].$_lang["paging_next"].(isset($array_paging['next_link']) ? "</a> " : " ")." "; |
|
265 | + $paging .= $array_paging['last_link'].$_lang["paging_last"].(isset($array_paging['last_link']) ? "</a> " : " ")." "; |
|
266 | 266 | // The above exemple print somethings like: |
267 | 267 | // Results 1 to 20 of 597 <<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>> |
268 | 268 | // Of course you can now play with array_row_paging in order to print |
@@ -298,16 +298,16 @@ discard block |
||
298 | 298 | if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { |
299 | 299 | $item = '<div style="text-align:center;">-</div>'; |
300 | 300 | } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { |
301 | - $item = '<a href="index.php?a=3&id=' . $logentry['itemid'] . '">' . $logentry['itemname'] . '</a>'; |
|
301 | + $item = '<a href="index.php?a=3&id='.$logentry['itemid'].'">'.$logentry['itemname'].'</a>'; |
|
302 | 302 | } else { |
303 | 303 | $item = $logentry['itemname']; |
304 | 304 | } |
305 | 305 | //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true' |
306 | - $user_drill = 'index.php?a=13&searchuser=' . $logentry['internalKey'] . '&itemname=0&log_submit=true'; |
|
306 | + $user_drill = 'index.php?a=13&searchuser='.$logentry['internalKey'].'&itemname=0&log_submit=true'; |
|
307 | 307 | ?> |
308 | 308 | <tr> |
309 | - <td><?= '<a href="' . $user_drill . '">' . $logentry['username'] . '</a>' ?></td> |
|
310 | - <td class="text-nowrap"><?= '[' . $logentry['action'] . '] ' . $logentry['message'] ?></td> |
|
309 | + <td><?= '<a href="'.$user_drill.'">'.$logentry['username'].'</a>' ?></td> |
|
310 | + <td class="text-nowrap"><?= '['.$logentry['action'].'] '.$logentry['message'] ?></td> |
|
311 | 311 | <td class="text-xs-right"><?= $logentry['itemid'] ?></td> |
312 | 312 | <td><?= $item ?></td> |
313 | 313 | <td class="text-nowrap"><?= $modx->toDateFormat($logentry['timestamp'] + $server_offset_time) ?></td> |
@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | |
6 | -switch((int) $modx->manager->action) { |
|
6 | +switch ((int) $modx->manager->action) { |
|
7 | 7 | case 35: |
8 | - if(!$modx->hasPermission('edit_role')) { |
|
8 | + if (!$modx->hasPermission('edit_role')) { |
|
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
10 | 10 | } |
11 | 11 | break; |
12 | 12 | case 38: |
13 | - if(!$modx->hasPermission('new_role')) { |
|
13 | + if (!$modx->hasPermission('new_role')) { |
|
14 | 14 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
15 | 15 | } |
16 | 16 | break; |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
19 | 19 | } |
20 | 20 | |
21 | -$role = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
21 | +$role = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
22 | 22 | |
23 | 23 | $tbl_user_roles = $modx->getFullTableName('user_roles'); |
24 | 24 | |
25 | 25 | // check to see the snippet editor isn't locked |
26 | -if($lockedEl = $modx->elementIsLocked(8, $role)) { |
|
26 | +if ($lockedEl = $modx->elementIsLocked(8, $role)) { |
|
27 | 27 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['role'])); |
28 | 28 | } |
29 | 29 | // end check for lock |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | // Lock snippet for other users to edit |
32 | 32 | $modx->lockElement(8, $role); |
33 | 33 | |
34 | -if($modx->manager->action == '35') { |
|
34 | +if ($modx->manager->action == '35') { |
|
35 | 35 | $rs = $modx->db->select('*', $tbl_user_roles, "id='{$role}'"); |
36 | 36 | $roledata = $modx->db->getRow($rs); |
37 | - if(!$roledata) { |
|
37 | + if (!$roledata) { |
|
38 | 38 | $modx->webAlertAndQuit("No role returned!"); |
39 | 39 | } |
40 | 40 | $_SESSION['itemname'] = $roledata['name']; |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | // Add lock-element JS-Script |
47 | 47 | $lockElementId = $role; |
48 | 48 | $lockElementType = 8; |
49 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
49 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
50 | 50 | ?> |
51 | 51 | <script type="text/javascript"> |
52 | 52 | function changestate(element) { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | <input type="hidden" name="id" value="<?= $_GET['id'] ?>"> |
83 | 83 | |
84 | 84 | <h1> |
85 | - <i class="fa fa-legal"></i><?= ($roledata['name'] ? $roledata['name'] . '<small>(' . $roledata['id'] . ')</small>' : $_lang['role_title']) ?> |
|
85 | + <i class="fa fa-legal"></i><?= ($roledata['name'] ? $roledata['name'].'<small>('.$roledata['id'].')</small>' : $_lang['role_title']) ?> |
|
86 | 86 | </h1> |
87 | 87 | |
88 | 88 | <?= $_style['actionbuttons']['dynamic']['savedelete'] ?> |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | </form> |
294 | 294 | |
295 | 295 | <?php |
296 | -if(!function_exists('render_form')) { |
|
296 | +if (!function_exists('render_form')) { |
|
297 | 297 | /** |
298 | 298 | * @param string $name |
299 | 299 | * @param string $label |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!function_exists('get_lang_keys')) { |
|
2 | +if (!function_exists('get_lang_keys')) { |
|
3 | 3 | /** |
4 | 4 | * get_lang_keys |
5 | 5 | * |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | */ |
9 | 9 | function get_lang_keys($filename) |
10 | 10 | { |
11 | - $file = MODX_MANAGER_PATH . 'includes/lang' . DIRECTORY_SEPARATOR . $filename; |
|
11 | + $file = MODX_MANAGER_PATH.'includes/lang'.DIRECTORY_SEPARATOR.$filename; |
|
12 | 12 | if (is_file($file) && is_readable($file)) { |
13 | 13 | include($file); |
14 | 14 | $out = isset($_lang) ? array_keys($_lang) : array(); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | } |
21 | 21 | } |
22 | 22 | |
23 | -if(!function_exists('get_langs_by_key')) { |
|
23 | +if (!function_exists('get_langs_by_key')) { |
|
24 | 24 | /** |
25 | 25 | * get_langs_by_key |
26 | 26 | * |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
44 | -if(!function_exists('get_lang_options')) { |
|
44 | +if (!function_exists('get_lang_options')) { |
|
45 | 45 | /** |
46 | 46 | * get_lang_options |
47 | 47 | * |
@@ -58,11 +58,11 @@ discard block |
||
58 | 58 | if (!empty($key)) { |
59 | 59 | $languages = get_langs_by_key($key); |
60 | 60 | sort($languages); |
61 | - $lang_options .= '<option value="">' . $_lang['language_title'] . '</option>'; |
|
61 | + $lang_options .= '<option value="">'.$_lang['language_title'].'</option>'; |
|
62 | 62 | |
63 | 63 | foreach ($languages as $language_name) { |
64 | 64 | $uclanguage_name = ucwords(str_replace("_", " ", $language_name)); |
65 | - $lang_options .= '<option value="' . $language_name . '">' . $uclanguage_name . '</option>'; |
|
65 | + $lang_options .= '<option value="'.$language_name.'">'.$uclanguage_name.'</option>'; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | return $lang_options; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | foreach ($languages as $language_name) { |
73 | 73 | $uclanguage_name = ucwords(str_replace("_", " ", $language_name)); |
74 | 74 | $sel = $language_name === $selected_lang ? ' selected="selected"' : ''; |
75 | - $lang_options .= '<option value="' . $language_name . '" ' . $sel . '>' . $uclanguage_name . '</option>'; |
|
75 | + $lang_options .= '<option value="'.$language_name.'" '.$sel.'>'.$uclanguage_name.'</option>'; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | return $lang_options; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
83 | -if(!function_exists('form_radio')) { |
|
83 | +if (!function_exists('form_radio')) { |
|
84 | 84 | /** |
85 | 85 | * @param string $name |
86 | 86 | * @param string $value |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $disabled = ''; |
100 | 100 | } |
101 | 101 | if ($add) { |
102 | - $add = ' ' . $add; |
|
102 | + $add = ' '.$add; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | return sprintf('<input onchange="documentDirty=true;" type="radio" name="%s" value="%s" %s %s %s />', $name, |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | } |
109 | 109 | } |
110 | 110 | |
111 | -if(!function_exists('wrap_label')) { |
|
111 | +if (!function_exists('wrap_label')) { |
|
112 | 112 | /** |
113 | 113 | * @param string $str |
114 | 114 | * @param string $object |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | } |
121 | 121 | } |
122 | 122 | |
123 | -if(!function_exists('parseText')) { |
|
123 | +if (!function_exists('parseText')) { |
|
124 | 124 | /** |
125 | 125 | * @param string $tpl |
126 | 126 | * @param array $ph |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | } |
142 | 142 | } |
143 | 143 | |
144 | -if(!function_exists('showHide')) { |
|
144 | +if (!function_exists('showHide')) { |
|
145 | 145 | /** |
146 | 146 | * @param bool $cond |
147 | 147 | * @return string |
@@ -1,18 +1,18 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('exec_module')) { |
|
5 | +if (!$modx->hasPermission('exec_module')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
|
10 | -if($id==0) { |
|
9 | +$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
10 | +if ($id == 0) { |
|
11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
12 | 12 | } |
13 | 13 | |
14 | 14 | // check if user has access permission, except admins |
15 | -if($_SESSION['mgrRole']!=1){ |
|
15 | +if ($_SESSION['mgrRole'] != 1) { |
|
16 | 16 | $rs = $modx->db->select( |
17 | 17 | 'sma.usergroup,mg.member', |
18 | 18 | $modx->getFullTableName("site_module_access")." sma |
@@ -24,18 +24,18 @@ discard block |
||
24 | 24 | $permissionAccessInt = -1; |
25 | 25 | |
26 | 26 | while ($row = $modx->db->getRow($rs)) { |
27 | - if($row["usergroup"] && $row["member"]) { |
|
27 | + if ($row["usergroup"] && $row["member"]) { |
|
28 | 28 | //if there are permissions and this member has permission, ofcourse |
29 | 29 | //this is granted |
30 | 30 | $permissionAccessInt = 1; |
31 | - } elseif ($permissionAccessInt==-1) { |
|
31 | + } elseif ($permissionAccessInt == -1) { |
|
32 | 32 | //if there are permissions but this member has no permission and the |
33 | 33 | //variable was still in init state we set permission to 0; no permissions |
34 | 34 | $permissionAccessInt = 0; |
35 | 35 | } |
36 | 36 | } |
37 | 37 | |
38 | - if($permissionAccessInt==0) { |
|
38 | + if ($permissionAccessInt == 0) { |
|
39 | 39 | $modx->webAlertAndQuit("You do not sufficient privileges to execute this module.", "index.php?a=106"); |
40 | 40 | } |
41 | 41 | } |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | // get module data |
44 | 44 | $rs = $modx->db->select('*', $modx->getFullTableName("site_modules"), "id='{$id}'"); |
45 | 45 | $content = $modx->db->getRow($rs); |
46 | -if(!$content) { |
|
46 | +if (!$content) { |
|
47 | 47 | $modx->webAlertAndQuit("No record found for id {$id}.", "index.php?a=106"); |
48 | 48 | } |
49 | -if($content['disabled']) { |
|
49 | +if ($content['disabled']) { |
|
50 | 50 | $modx->webAlertAndQuit("This module is disabled and cannot be executed.", "index.php?a=106"); |
51 | 51 | } |
52 | 52 | |
@@ -60,14 +60,14 @@ discard block |
||
60 | 60 | $_SESSION['itemname'] = $content['name']; |
61 | 61 | |
62 | 62 | |
63 | -$output = evalModule($content["modulecode"],$parameter); |
|
64 | -if (strpos(trim($output),'<')===0 && strpos(trim($output),'<?xml')!==0) { |
|
63 | +$output = evalModule($content["modulecode"], $parameter); |
|
64 | +if (strpos(trim($output), '<') === 0 && strpos(trim($output), '<?xml') !== 0) { |
|
65 | 65 | echo "<style>@supports (-webkit-overflow-scrolling: touch) {body,html {-webkit-overflow-scrolling: touch;overflow:auto!important;height:100%!important}}</style>"; // for iframe scroller |
66 | 66 | } |
67 | 67 | echo $output; |
68 | 68 | include MODX_MANAGER_PATH."includes/sysalert.display.inc.php"; |
69 | 69 | |
70 | -if(!function_exists('evalModule')) { |
|
70 | +if (!function_exists('evalModule')) { |
|
71 | 71 | /** |
72 | 72 | * evalModule |
73 | 73 | * |
@@ -103,12 +103,12 @@ discard block |
||
103 | 103 | } |
104 | 104 | if ($modx->config['error_reporting'] === '99' || 2 < $error_level) { |
105 | 105 | $modx->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], |
106 | - $_SESSION['itemname'] . ' - Module', $error_info['message'], $error_info['line'], $msg); |
|
106 | + $_SESSION['itemname'].' - Module', $error_info['message'], $error_info['line'], $msg); |
|
107 | 107 | $modx->event->alert("An error occurred while loading. Please see the event log for more information<p>{$msg}</p>"); |
108 | 108 | } |
109 | 109 | } |
110 | 110 | unset($modx->event->params); |
111 | 111 | |
112 | - return $mod . $msg; |
|
112 | + return $mod.$msg; |
|
113 | 113 | } |
114 | 114 | } |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.'); |
4 | 4 | } |
5 | 5 | if (!$modx->hasPermission('save_plugin')) { |
6 | 6 | $modx->webAlertAndQuit($_lang['error_no_privileges']); |
7 | 7 | } |
8 | 8 | |
9 | -$id = (int)$_POST['id']; |
|
9 | +$id = (int) $_POST['id']; |
|
10 | 10 | $name = $modx->db->escape(trim($_POST['name'])); |
11 | 11 | $description = $modx->db->escape($_POST['description']); |
12 | 12 | $locked = $_POST['locked'] == 'on' ? '1' : '0'; |
@@ -20,11 +20,11 @@ discard block |
||
20 | 20 | |
21 | 21 | //Kyle Jaebker - added category support |
22 | 22 | if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) { |
23 | - $categoryid = (int)$_POST['categoryid']; |
|
23 | + $categoryid = (int) $_POST['categoryid']; |
|
24 | 24 | } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) { |
25 | 25 | $categoryid = 0; |
26 | 26 | } else { |
27 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
27 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
28 | 28 | $categoryid = getCategory($_POST['newcategory']); |
29 | 29 | } |
30 | 30 | |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | $moduleguid = isset($parsed['guid']) ? $parsed['guid'] : $moduleguid; |
41 | 41 | |
42 | 42 | $description = isset($parsed['description']) ? $parsed['description'] : $description; |
43 | - $version = isset($parsed['version']) ? '<b>' . $parsed['version'] . '</b> ' : ''; |
|
43 | + $version = isset($parsed['version']) ? '<b>'.$parsed['version'].'</b> ' : ''; |
|
44 | 44 | if ($version) { |
45 | - $description = $version . trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description)); |
|
45 | + $description = $version.trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description)); |
|
46 | 46 | } |
47 | 47 | if (isset($parsed['modx_category'])) { |
48 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
48 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
49 | 49 | $categoryid = getCategory($parsed['modx_category']); |
50 | 50 | } |
51 | 51 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | // finished emptying cache - redirect |
104 | 104 | if ($_POST['stay'] != '') { |
105 | 105 | $a = ($_POST['stay'] == '2') ? "102&id=$newid" : '101'; |
106 | - $header = 'Location: index.php?a=' . $a . '&r=2&stay=' . $_POST['stay']; |
|
106 | + $header = 'Location: index.php?a='.$a.'&r=2&stay='.$_POST['stay']; |
|
107 | 107 | header($header); |
108 | 108 | } else { |
109 | 109 | $header = 'Location: index.php?a=76&r=2'; |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | // finished emptying cache - redirect |
159 | 159 | if ($_POST['stay'] != '') { |
160 | 160 | $a = ($_POST['stay'] == '2') ? "102&id=$id" : '101'; |
161 | - $header = 'Location: index.php?a=' . $a . '&r=2&stay=' . $_POST['stay']; |
|
161 | + $header = 'Location: index.php?a='.$a.'&r=2&stay='.$_POST['stay']; |
|
162 | 162 | header($header); |
163 | 163 | } else { |
164 | 164 | $modx->unlockElement(5, $id); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $modx->webAlertAndQuit('No operation set in request.'); |
171 | 171 | } |
172 | 172 | |
173 | -if(!function_exists('saveEventListeners')) { |
|
173 | +if (!function_exists('saveEventListeners')) { |
|
174 | 174 | # Save Plugin Event Listeners |
175 | 175 | function saveEventListeners($id, $sysevents, $mode) |
176 | 176 | { |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | } |
224 | 224 | } |
225 | 225 | |
226 | -if(!function_exists('getEventIdByName')) { |
|
226 | +if (!function_exists('getEventIdByName')) { |
|
227 | 227 | /** |
228 | 228 | * @param string $name |
229 | 229 | * @return string|int |
@@ -1,25 +1,25 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('save_document')||!$modx->hasPermission('publish_document')) { |
|
5 | +if (!$modx->hasPermission('save_document') || !$modx->hasPermission('publish_document')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0; |
|
10 | -if($id==0) { |
|
9 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
10 | +if ($id == 0) { |
|
11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
12 | 12 | } |
13 | 13 | |
14 | 14 | /************webber ********/ |
15 | -$content=$modx->db->getRow($modx->db->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'")); |
|
16 | -$pid=($content['parent']==0?$id:$content['parent']); |
|
15 | +$content = $modx->db->getRow($modx->db->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'")); |
|
16 | +$pid = ($content['parent'] == 0 ? $id : $content['parent']); |
|
17 | 17 | |
18 | 18 | /************** webber *************/ |
19 | -$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC'; |
|
20 | -$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon'; |
|
21 | -$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:''; |
|
22 | -$add_path=$sd.$sb.$pg; |
|
19 | +$sd = isset($_REQUEST['dir']) ? '&dir='.$_REQUEST['dir'] : '&dir=DESC'; |
|
20 | +$sb = isset($_REQUEST['sort']) ? '&sort='.$_REQUEST['sort'] : '&sort=createdon'; |
|
21 | +$pg = isset($_REQUEST['page']) ? '&page='.(int) $_REQUEST['page'] : ''; |
|
22 | +$add_path = $sd.$sb.$pg; |
|
23 | 23 | |
24 | 24 | /***********************************/ |
25 | 25 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $udperms->document = $id; |
32 | 32 | $udperms->role = $_SESSION['mgrRole']; |
33 | 33 | |
34 | -if(!$udperms->checkPermissions()) { |
|
34 | +if (!$udperms->checkPermissions()) { |
|
35 | 35 | $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
36 | 36 | } |
37 | 37 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | ), $modx->getFullTableName('site_content'), "id='{$id}'"); |
49 | 49 | |
50 | 50 | // invoke OnDocPublished event |
51 | -$modx->invokeEvent("OnDocPublished",array("docid"=>$id)); |
|
51 | +$modx->invokeEvent("OnDocPublished", array("docid"=>$id)); |
|
52 | 52 | |
53 | 53 | // Set the item name for logger |
54 | 54 | $_SESSION['itemname'] = $content['pagetitle']; |
@@ -56,6 +56,6 @@ discard block |
||
56 | 56 | // empty cache |
57 | 57 | $modx->clearCache('full'); |
58 | 58 | |
59 | -$header="Location: index.php?a=3&id=$pid&r=1".$add_path; |
|
59 | +$header = "Location: index.php?a=3&id=$pid&r=1".$add_path; |
|
60 | 60 | |
61 | 61 | header($header); |
@@ -1,27 +1,27 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if (!$modx->hasPermission('save_template')) { |
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = (int)$_POST['id']; |
|
9 | +$id = (int) $_POST['id']; |
|
10 | 10 | $template = $modx->db->escape($_POST['post']); |
11 | 11 | $templatename = $modx->db->escape(trim($_POST['templatename'])); |
12 | 12 | $description = $modx->db->escape($_POST['description']); |
13 | 13 | $locked = $_POST['locked'] == 'on' ? 1 : 0; |
14 | -$selectable = $id == $modx->config['default_template'] ? 1 : // Force selectable |
|
14 | +$selectable = $id == $modx->config['default_template'] ? 1 : // Force selectable |
|
15 | 15 | $_POST['selectable'] == 'on' ? 1 : 0; |
16 | 16 | $currentdate = time() + $modx->config['server_offset_time']; |
17 | 17 | |
18 | 18 | //Kyle Jaebker - added category support |
19 | 19 | if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) { |
20 | - $categoryid = (int)$_POST['categoryid']; |
|
20 | + $categoryid = (int) $_POST['categoryid']; |
|
21 | 21 | } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) { |
22 | 22 | $categoryid = 0; |
23 | 23 | } else { |
24 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
24 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
25 | 25 | $categoryid = checkCategory($_POST['newcategory']); |
26 | 26 | if (!$categoryid) { |
27 | 27 | $categoryid = newCategory($_POST['newcategory']); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | // finished emptying cache - redirect |
79 | 79 | if ($_POST['stay'] != '') { |
80 | 80 | $a = ($_POST['stay'] == '2') ? "16&id=$newid" : "19"; |
81 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
81 | + $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']; |
|
82 | 82 | header($header); |
83 | 83 | } else { |
84 | 84 | $header = "Location: index.php?a=76&r=2"; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | // finished emptying cache - redirect |
131 | 131 | if ($_POST['stay'] != '') { |
132 | 132 | $a = ($_POST['stay'] == '2') ? "16&id=$id" : "19"; |
133 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
133 | + $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']; |
|
134 | 134 | header($header); |
135 | 135 | } else { |
136 | 136 | $modx->unlockElement(1, $id); |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $modx->webAlertAndQuit("No operation set in request."); |
145 | 145 | } |
146 | 146 | |
147 | -if(!function_exists('saveTemplateAccess')) { |
|
147 | +if (!function_exists('saveTemplateAccess')) { |
|
148 | 148 | /** |
149 | 149 | * @param int $id |
150 | 150 | */ |