@@ -4,18 +4,18 @@ |
||
4 | 4 | } |
5 | 5 | $logo= '<img src="media/style/default/images/misc/login-logo.png" height="54" width="358" border="0">'; |
6 | 6 | $downloadLinks = array( |
7 | - 0=>array('title'=>$_lang["information"],'link'=>'https://evo.im/'), |
|
8 | - 1=>array('title'=>$_lang["download"],'link'=>'https://github.com/evolution-cms/evolution/releases'), |
|
9 | - 2=>array('title'=>$_lang["previous_releases"],'link'=>'https://modx.com/download/evolution/previous-releases.html'), |
|
10 | - 3=>array('title'=>$_lang["extras"],'link'=>array( |
|
11 | - 'http://extras.evolution-cms.com/', |
|
12 | - 'https://github.com/extras-evolution' |
|
13 | - )), |
|
7 | + 0=>array('title'=>$_lang["information"],'link'=>'https://evo.im/'), |
|
8 | + 1=>array('title'=>$_lang["download"],'link'=>'https://github.com/evolution-cms/evolution/releases'), |
|
9 | + 2=>array('title'=>$_lang["previous_releases"],'link'=>'https://modx.com/download/evolution/previous-releases.html'), |
|
10 | + 3=>array('title'=>$_lang["extras"],'link'=>array( |
|
11 | + 'http://extras.evolution-cms.com/', |
|
12 | + 'https://github.com/extras-evolution' |
|
13 | + )), |
|
14 | 14 | ); |
15 | 15 | |
16 | 16 | $translationLinks = array( |
17 | - 0=>array('title'=>'Evolution CMS','link'=>'https://www.transifex.com/evolutioncms/evolution/'), |
|
18 | - 1=>array('title'=>$_lang["extras"],'link'=>'https://www.transifex.com/evolutioncms/extras/'), |
|
17 | + 0=>array('title'=>'Evolution CMS','link'=>'https://www.transifex.com/evolutioncms/evolution/'), |
|
18 | + 1=>array('title'=>$_lang["extras"],'link'=>'https://www.transifex.com/evolutioncms/extras/'), |
|
19 | 19 | ); |
20 | 20 | |
21 | 21 | if(!function_exists('createList')) { |
@@ -1,24 +1,24 @@ 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 | -$logo= '<img src="media/style/default/images/misc/login-logo.png" height="54" width="358" border="0">'; |
|
5 | +$logo = '<img src="media/style/default/images/misc/login-logo.png" height="54" width="358" border="0">'; |
|
6 | 6 | $downloadLinks = array( |
7 | - 0=>array('title'=>$_lang["information"],'link'=>'https://evo.im/'), |
|
8 | - 1=>array('title'=>$_lang["download"],'link'=>'https://github.com/evolution-cms/evolution/releases'), |
|
9 | - 2=>array('title'=>$_lang["previous_releases"],'link'=>'https://modx.com/download/evolution/previous-releases.html'), |
|
10 | - 3=>array('title'=>$_lang["extras"],'link'=>array( |
|
7 | + 0=>array('title'=>$_lang["information"], 'link'=>'https://evo.im/'), |
|
8 | + 1=>array('title'=>$_lang["download"], 'link'=>'https://github.com/evolution-cms/evolution/releases'), |
|
9 | + 2=>array('title'=>$_lang["previous_releases"], 'link'=>'https://modx.com/download/evolution/previous-releases.html'), |
|
10 | + 3=>array('title'=>$_lang["extras"], 'link'=>array( |
|
11 | 11 | 'http://extras.evolution-cms.com/', |
12 | 12 | 'https://github.com/extras-evolution' |
13 | 13 | )), |
14 | 14 | ); |
15 | 15 | |
16 | 16 | $translationLinks = array( |
17 | - 0=>array('title'=>'Evolution CMS','link'=>'https://www.transifex.com/evolutioncms/evolution/'), |
|
18 | - 1=>array('title'=>$_lang["extras"],'link'=>'https://www.transifex.com/evolutioncms/extras/'), |
|
17 | + 0=>array('title'=>'Evolution CMS', 'link'=>'https://www.transifex.com/evolutioncms/evolution/'), |
|
18 | + 1=>array('title'=>$_lang["extras"], 'link'=>'https://www.transifex.com/evolutioncms/extras/'), |
|
19 | 19 | ); |
20 | 20 | |
21 | -if(!function_exists('createList')) { |
|
21 | +if (!function_exists('createList')) { |
|
22 | 22 | /** |
23 | 23 | * @param string $sectionHeader |
24 | 24 | * @param array $linkArr |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | */ |
27 | 27 | function createList($sectionHeader, $linkArr) |
28 | 28 | { |
29 | - $output = '<div class="sectionHeader">' . $sectionHeader . '</div><div class="sectionBody">' . "\n"; |
|
30 | - $output .= '<table width="500" border="0" cellspacing="0" cellpadding="0">' . "\n"; |
|
29 | + $output = '<div class="sectionHeader">'.$sectionHeader.'</div><div class="sectionBody">'."\n"; |
|
30 | + $output .= '<table width="500" border="0" cellspacing="0" cellpadding="0">'."\n"; |
|
31 | 31 | $links = ''; |
32 | 32 | foreach ($linkArr as $row) { |
33 | 33 | if (!is_array($row['link'])) { |
@@ -35,16 +35,16 @@ discard block |
||
35 | 35 | } |
36 | 36 | foreach ($row['link'] as $link) { |
37 | 37 | $links .= $links != '' ? '<br/>' : ''; |
38 | - $links .= '<a href="' . $link . '" target="_blank">' . $link . '</a>'; |
|
38 | + $links .= '<a href="'.$link.'" target="_blank">'.$link.'</a>'; |
|
39 | 39 | } |
40 | 40 | $output .= ' |
41 | 41 | <tr> |
42 | - <td align="left"><strong>' . $row["title"] . '</strong></td> |
|
43 | - <td align="left">' . $links . '</td> |
|
42 | + <td align="left"><strong>' . $row["title"].'</strong></td> |
|
43 | + <td align="left">' . $links.'</td> |
|
44 | 44 | </tr>'; |
45 | 45 | $links = ''; |
46 | 46 | } |
47 | - $output .= '</table></div>' . "\n"; |
|
47 | + $output .= '</table></div>'."\n"; |
|
48 | 48 | |
49 | 49 | return $output; |
50 | 50 | } |
@@ -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 | 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('bk_manager')) { |
@@ -9,10 +9,10 @@ discard block |
||
9 | 9 | $dbase = trim($dbase, '`'); |
10 | 10 | |
11 | 11 | if (!isset($modx->config['snapshot_path'])) { |
12 | - if (is_dir(MODX_BASE_PATH . 'temp/backup/')) { |
|
13 | - $modx->config['snapshot_path'] = MODX_BASE_PATH . 'temp/backup/'; |
|
12 | + if (is_dir(MODX_BASE_PATH.'temp/backup/')) { |
|
13 | + $modx->config['snapshot_path'] = MODX_BASE_PATH.'temp/backup/'; |
|
14 | 14 | } else { |
15 | - $modx->config['snapshot_path'] = MODX_BASE_PATH . 'assets/backup/'; |
|
15 | + $modx->config['snapshot_path'] = MODX_BASE_PATH.'assets/backup/'; |
|
16 | 16 | } |
17 | 17 | } |
18 | 18 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | if ($mode == 'restore1') { |
24 | 24 | if (isset($_POST['textarea']) && !empty($_POST['textarea'])) { |
25 | 25 | $source = trim($_POST['textarea']); |
26 | - $_SESSION['textarea'] = $source . "\n"; |
|
26 | + $_SESSION['textarea'] = $source."\n"; |
|
27 | 27 | } else { |
28 | 28 | $source = file_get_contents($_FILES['sqlfile']['tmp_name']); |
29 | 29 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | header('Location: index.php?r=9&a=93'); |
32 | 32 | exit; |
33 | 33 | } elseif ($mode == 'restore2') { |
34 | - $path = $modx->config['snapshot_path'] . $_POST['filename']; |
|
34 | + $path = $modx->config['snapshot_path'].$_POST['filename']; |
|
35 | 35 | if (file_exists($path)) { |
36 | 36 | $source = file_get_contents($path); |
37 | 37 | import_sql($source); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | if (!is_writable(rtrim($modx->config['snapshot_path'], '/'))) { |
78 | 78 | $modx->webAlertAndQuit(parsePlaceholder($_lang["bkmgr_alert_mkdir"], array('snapshot_path' => $modx->config['snapshot_path']))); |
79 | 79 | } |
80 | - $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '" . $modx->db->escape($modx->db->config['table_prefix']) . "%'"; |
|
80 | + $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '".$modx->db->escape($modx->db->config['table_prefix'])."%'"; |
|
81 | 81 | $rs = $modx->db->query($sql); |
82 | 82 | $tables = $modx->db->getColumn('Name', $rs); |
83 | 83 | $today = date('Y-m-d_H-i-s'); |
@@ -109,18 +109,18 @@ discard block |
||
109 | 109 | $modx->webAlertAndQuit('Unable to Backup Database'); |
110 | 110 | } |
111 | 111 | } else { |
112 | - include_once MODX_MANAGER_PATH . "includes/header.inc.php"; // start normal header |
|
112 | + include_once MODX_MANAGER_PATH."includes/header.inc.php"; // start normal header |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | if (isset($_SESSION['result_msg']) && $_SESSION['result_msg'] != '') { |
116 | 116 | switch ($_SESSION['result_msg']) { |
117 | 117 | case 'import_ok': |
118 | - $ph['result_msg_import'] = '<div class="alert alert-success">' . $_lang["bkmgr_import_ok"] . '</div>'; |
|
119 | - $ph['result_msg_snapshot'] = '<div class="alert alert-success">' . $_lang["bkmgr_import_ok"] . '</div>'; |
|
118 | + $ph['result_msg_import'] = '<div class="alert alert-success">'.$_lang["bkmgr_import_ok"].'</div>'; |
|
119 | + $ph['result_msg_snapshot'] = '<div class="alert alert-success">'.$_lang["bkmgr_import_ok"].'</div>'; |
|
120 | 120 | break; |
121 | 121 | case 'snapshot_ok': |
122 | 122 | $ph['result_msg_import'] = ''; |
123 | - $ph['result_msg_snapshot'] = '<div class="alert alert-success">' . $_lang["bkmgr_snapshot_ok"] . '</div>'; |
|
123 | + $ph['result_msg_snapshot'] = '<div class="alert alert-success">'.$_lang["bkmgr_snapshot_ok"].'</div>'; |
|
124 | 124 | break; |
125 | 125 | } |
126 | 126 | $_SESSION['result_msg'] = ''; |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | f.style.display = 'none'; |
180 | 180 | } |
181 | 181 | } |
182 | - <?= (isset($_REQUEST['r']) ? " doRefresh(" . $_REQUEST['r'] . ");" : "") ?> |
|
182 | + <?= (isset($_REQUEST['r']) ? " doRefresh(".$_REQUEST['r'].");" : "") ?> |
|
183 | 183 | |
184 | 184 | </script> |
185 | 185 | |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | </thead> |
224 | 224 | <tbody> |
225 | 225 | <?php |
226 | - $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '" . $modx->db->escape($modx->db->config['table_prefix']) . "%'"; |
|
226 | + $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '".$modx->db->escape($modx->db->config['table_prefix'])."%'"; |
|
227 | 227 | $rs = $modx->db->query($sql); |
228 | 228 | $i = 0; |
229 | 229 | while ($db_status = $modx->db->getRow($rs)) { |
@@ -233,29 +233,29 @@ discard block |
||
233 | 233 | $table_string = ''; |
234 | 234 | } |
235 | 235 | |
236 | - echo '<tr>' . "\n" . '<td><label class="form-check form-check-label"><input type="checkbox" name="chk[]" class="form-check-input" value="' . $db_status['Name'] . '"' . (strstr($table_string, $db_status['Name']) === false ? '' : ' checked="checked"') . ' /><b class="text-primary">' . $db_status['Name'] . '</b></label></td>' . "\n"; |
|
237 | - echo '<td class="text-xs-center">' . (!empty($db_status['Comment']) ? '<i class="' . $_style['actions_help'] . '" data-tooltip="' . $db_status['Comment'] . '"></i>' : '') . '</td>' . "\n"; |
|
238 | - echo '<td class="text-xs-right">' . $db_status['Rows'] . '</td>' . "\n"; |
|
239 | - echo '<td class="text-xs-right">' . $db_status['Collation'] . '</td>' . "\n"; |
|
236 | + echo '<tr>'."\n".'<td><label class="form-check form-check-label"><input type="checkbox" name="chk[]" class="form-check-input" value="'.$db_status['Name'].'"'.(strstr($table_string, $db_status['Name']) === false ? '' : ' checked="checked"').' /><b class="text-primary">'.$db_status['Name'].'</b></label></td>'."\n"; |
|
237 | + echo '<td class="text-xs-center">'.(!empty($db_status['Comment']) ? '<i class="'.$_style['actions_help'].'" data-tooltip="'.$db_status['Comment'].'"></i>' : '').'</td>'."\n"; |
|
238 | + echo '<td class="text-xs-right">'.$db_status['Rows'].'</td>'."\n"; |
|
239 | + echo '<td class="text-xs-right">'.$db_status['Collation'].'</td>'."\n"; |
|
240 | 240 | |
241 | 241 | // Enable record deletion for certain tables (TRUNCATE TABLE) if they're not already empty |
242 | 242 | $truncateable = array( |
243 | - $modx->db->config['table_prefix'] . 'event_log', |
|
244 | - $modx->db->config['table_prefix'] . 'manager_log', |
|
243 | + $modx->db->config['table_prefix'].'event_log', |
|
244 | + $modx->db->config['table_prefix'].'manager_log', |
|
245 | 245 | ); |
246 | 246 | if ($modx->hasPermission('settings') && in_array($db_status['Name'], $truncateable) && $db_status['Rows'] > 0) { |
247 | - echo '<td class="text-xs-right"><a class="text-danger" href="index.php?a=54&mode=' . $action . '&u=' . $db_status['Name'] . '" title="' . $_lang['truncate_table'] . '">' . $modx->nicesize($db_status['Data_length'] + $db_status['Data_free']) . '</a>' . '</td>' . "\n"; |
|
247 | + echo '<td class="text-xs-right"><a class="text-danger" href="index.php?a=54&mode='.$action.'&u='.$db_status['Name'].'" title="'.$_lang['truncate_table'].'">'.$modx->nicesize($db_status['Data_length'] + $db_status['Data_free']).'</a>'.'</td>'."\n"; |
|
248 | 248 | } else { |
249 | - echo '<td class="text-xs-right">' . $modx->nicesize($db_status['Data_length'] + $db_status['Data_free']) . '</td>' . "\n"; |
|
249 | + echo '<td class="text-xs-right">'.$modx->nicesize($db_status['Data_length'] + $db_status['Data_free']).'</td>'."\n"; |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | if ($modx->hasPermission('settings')) { |
253 | - echo '<td class="text-xs-right">' . ($db_status['Data_free'] > 0 ? '<a class="text-danger" href="index.php?a=54&mode=' . $action . '&t=' . $db_status['Name'] . '" title="' . $_lang['optimize_table'] . '">' . $modx->nicesize($db_status['Data_free']) . '</a>' : '-') . '</td>' . "\n"; |
|
253 | + echo '<td class="text-xs-right">'.($db_status['Data_free'] > 0 ? '<a class="text-danger" href="index.php?a=54&mode='.$action.'&t='.$db_status['Name'].'" title="'.$_lang['optimize_table'].'">'.$modx->nicesize($db_status['Data_free']).'</a>' : '-').'</td>'."\n"; |
|
254 | 254 | } else { |
255 | - echo '<td class="text-xs-right">' . ($db_status['Data_free'] > 0 ? $modx->nicesize($db_status['Data_free']) : '-') . '</td>' . "\n"; |
|
255 | + echo '<td class="text-xs-right">'.($db_status['Data_free'] > 0 ? $modx->nicesize($db_status['Data_free']) : '-').'</td>'."\n"; |
|
256 | 256 | } |
257 | 257 | |
258 | - echo '<td class="text-xs-right">' . $modx->nicesize($db_status['Data_length'] - $db_status['Data_free']) . '</td>' . "\n" . '<td class="text-xs-right">' . $modx->nicesize($db_status['Index_length']) . '</td>' . "\n" . '<td class="text-xs-right">' . $modx->nicesize($db_status['Index_length'] + $db_status['Data_length'] + $db_status['Data_free']) . '</td>' . "\n" . "</tr>"; |
|
258 | + echo '<td class="text-xs-right">'.$modx->nicesize($db_status['Data_length'] - $db_status['Data_free']).'</td>'."\n".'<td class="text-xs-right">'.$modx->nicesize($db_status['Index_length']).'</td>'."\n".'<td class="text-xs-right">'.$modx->nicesize($db_status['Index_length'] + $db_status['Data_length'] + $db_status['Data_free']).'</td>'."\n"."</tr>"; |
|
259 | 259 | |
260 | 260 | $total = $total + $db_status['Index_length'] + $db_status['Data_length']; |
261 | 261 | $totaloverhead = $totaloverhead + $db_status['Data_free']; |
@@ -266,9 +266,9 @@ discard block |
||
266 | 266 | <tr> |
267 | 267 | <td class="text-xs-right"><?= $_lang['database_table_totals'] ?></td> |
268 | 268 | <td colspan="4"> </td> |
269 | - <td class="text-xs-right"><?= $totaloverhead > 0 ? '<b class="text-danger">' . $modx->nicesize($totaloverhead) . '</b><br />(' . number_format($totaloverhead) . ' B)' : '-' ?></td> |
|
269 | + <td class="text-xs-right"><?= $totaloverhead > 0 ? '<b class="text-danger">'.$modx->nicesize($totaloverhead).'</b><br />('.number_format($totaloverhead).' B)' : '-' ?></td> |
|
270 | 270 | <td colspan="2"> </td> |
271 | - <td class="text-xs-right"><?= "<b>" . $modx->nicesize($total) . "</b><br />(" . number_format($total) . " B)" ?></td> |
|
271 | + <td class="text-xs-right"><?= "<b>".$modx->nicesize($total)."</b><br />(".number_format($total)." B)" ?></td> |
|
272 | 272 | </tr> |
273 | 273 | </tfoot> |
274 | 274 | </table> |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | foreach ($last_result['0'] as $k => $v) { |
320 | 320 | $title[] = $k; |
321 | 321 | } |
322 | - $result = '<thead><tr><th>' . implode('</th><th>', $title) . '</th></tr></thead>'; |
|
322 | + $result = '<thead><tr><th>'.implode('</th><th>', $title).'</th></tr></thead>'; |
|
323 | 323 | $result .= '<tbody>'; |
324 | 324 | foreach ($last_result as $row) { |
325 | 325 | $result_value = array(); |
@@ -327,11 +327,11 @@ discard block |
||
327 | 327 | foreach ($row as $k => $v) { |
328 | 328 | $result_value[] = $v; |
329 | 329 | } |
330 | - $result .= '<tr><td>' . implode('</td><td>', $result_value) . '</td></tr>'; |
|
330 | + $result .= '<tr><td>'.implode('</td><td>', $result_value).'</td></tr>'; |
|
331 | 331 | } |
332 | 332 | } |
333 | 333 | $result .= '</tbody>'; |
334 | - $result = '<table class="table data">' . $result . '</table>'; |
|
334 | + $result = '<table class="table data">'.$result.'</table>'; |
|
335 | 335 | } |
336 | 336 | } |
337 | 337 | |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | while ($count < 11) { |
434 | 434 | $line = fgets($file); |
435 | 435 | foreach ($detailFields as $label) { |
436 | - $fileLabel = '# ' . $label; |
|
436 | + $fileLabel = '# '.$label; |
|
437 | 437 | if (strpos($line, $fileLabel) !== false) { |
438 | 438 | $details[$label] = htmlentities(trim(str_replace(array( |
439 | 439 | $fileLabel, |
@@ -446,10 +446,10 @@ discard block |
||
446 | 446 | }; |
447 | 447 | fclose($file); |
448 | 448 | |
449 | - $tooltip = "Generation Time: " . $details["Generation Time"] . "\n"; |
|
450 | - $tooltip .= "Server version: " . $details["Server version"] . "\n"; |
|
451 | - $tooltip .= "PHP Version: " . $details["PHP Version"] . "\n"; |
|
452 | - $tooltip .= "Host: " . $details["Host"] . "\n"; |
|
449 | + $tooltip = "Generation Time: ".$details["Generation Time"]."\n"; |
|
450 | + $tooltip .= "Server version: ".$details["Server version"]."\n"; |
|
451 | + $tooltip .= "PHP Version: ".$details["PHP Version"]."\n"; |
|
452 | + $tooltip .= "Host: ".$details["Host"]."\n"; |
|
453 | 453 | ?> |
454 | 454 | <tr> |
455 | 455 | <td><?= $filename ?></td> |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | <?php |
482 | 482 | |
483 | 483 | if (is_numeric($_GET['tab'])) { |
484 | - echo '<script type="text/javascript">tpDBM.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
484 | + echo '<script type="text/javascript">tpDBM.setSelectedIndex( '.$_GET['tab'].' );</script>'; |
|
485 | 485 | } |
486 | 486 | |
487 | 487 | include_once "footer.inc.php"; // send footer |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | */ |
494 | 494 | class Mysqldumper extends EvolutionCMS\Support\MysqlDumper{} |
495 | 495 | |
496 | -if(!function_exists('import_sql')) { |
|
496 | +if (!function_exists('import_sql')) { |
|
497 | 497 | /** |
498 | 498 | * @param string $source |
499 | 499 | * @param string $result_code |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | } |
535 | 535 | } |
536 | 536 | |
537 | -if(!function_exists('dumpSql')) { |
|
537 | +if (!function_exists('dumpSql')) { |
|
538 | 538 | /** |
539 | 539 | * @param string $dumpstring |
540 | 540 | * @return bool |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | } |
561 | 561 | } |
562 | 562 | |
563 | -if(!function_exists('snapshot')) { |
|
563 | +if (!function_exists('snapshot')) { |
|
564 | 564 | /** |
565 | 565 | * @param string $dumpstring |
566 | 566 | * @return bool |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | } |
575 | 575 | } |
576 | 576 | |
577 | -if(!function_exists('getSettings')) { |
|
577 | +if (!function_exists('getSettings')) { |
|
578 | 578 | /** |
579 | 579 | * @return array |
580 | 580 | */ |
@@ -601,7 +601,7 @@ discard block |
||
601 | 601 | } |
602 | 602 | } |
603 | 603 | |
604 | -if(!function_exists('restoreSettings')) { |
|
604 | +if (!function_exists('restoreSettings')) { |
|
605 | 605 | /** |
606 | 606 | * @param array $settings |
607 | 607 | */ |
@@ -616,7 +616,7 @@ discard block |
||
616 | 616 | } |
617 | 617 | } |
618 | 618 | |
619 | -if(!function_exists('parsePlaceholder')) { |
|
619 | +if (!function_exists('parsePlaceholder')) { |
|
620 | 620 | /** |
621 | 621 | * @param string $tpl |
622 | 622 | * @param array $ph |
@@ -491,7 +491,9 @@ |
||
491 | 491 | /** |
492 | 492 | * @deprecated use EvolutionCMS\Support\MysqlDumper |
493 | 493 | */ |
494 | -class Mysqldumper extends EvolutionCMS\Support\MysqlDumper{} |
|
494 | +class Mysqldumper extends EvolutionCMS\Support\MysqlDumper |
|
495 | +{ |
|
496 | +} |
|
495 | 497 | |
496 | 498 | if(!function_exists('import_sql')) { |
497 | 499 | /** |
@@ -4,4 +4,6 @@ |
||
4 | 4 | * Class to handle the modx-categories |
5 | 5 | * @deprecated use EvolutionCMS\Legacy\Categories |
6 | 6 | */ |
7 | -class Categories extends EvolutionCMS\Legacy\Categories{} |
|
7 | +class Categories extends EvolutionCMS\Legacy\Categories |
|
8 | +{ |
|
9 | +} |
@@ -1,20 +1,20 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
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 | switch($modx->manager->action) { |
6 | - case 107: |
|
7 | - if(!$modx->hasPermission('new_module')) { |
|
8 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
9 | - } |
|
10 | - break; |
|
11 | - case 108: |
|
12 | - if(!$modx->hasPermission('edit_module')) { |
|
13 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
14 | - } |
|
15 | - break; |
|
16 | - default: |
|
17 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + case 107: |
|
7 | + if(!$modx->hasPermission('new_module')) { |
|
8 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
9 | + } |
|
10 | + break; |
|
11 | + case 108: |
|
12 | + if(!$modx->hasPermission('edit_module')) { |
|
13 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
14 | + } |
|
15 | + break; |
|
16 | + default: |
|
17 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
18 | 18 | } |
19 | 19 | $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
20 | 20 | // Get table names (alphabetical) |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | // check to see the module editor isn't locked |
50 | 50 | if($lockedEl = $modx->elementIsLocked(6, $id)) { |
51 | - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); |
|
51 | + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); |
|
52 | 52 | } |
53 | 53 | // end check for lock |
54 | 54 | |
@@ -56,22 +56,22 @@ discard block |
||
56 | 56 | $modx->lockElement(6, $id); |
57 | 57 | |
58 | 58 | if(isset($_GET['id'])) { |
59 | - $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'"); |
|
60 | - $content = $modx->db->getRow($rs); |
|
61 | - if(!$content) { |
|
62 | - $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
|
63 | - } |
|
64 | - $content['properties'] = str_replace("&", "&", $content['properties']); |
|
65 | - $_SESSION['itemname'] = $content['name']; |
|
66 | - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
67 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
68 | - } |
|
59 | + $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'"); |
|
60 | + $content = $modx->db->getRow($rs); |
|
61 | + if(!$content) { |
|
62 | + $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
|
63 | + } |
|
64 | + $content['properties'] = str_replace("&", "&", $content['properties']); |
|
65 | + $_SESSION['itemname'] = $content['name']; |
|
66 | + if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
67 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
68 | + } |
|
69 | 69 | } else { |
70 | - $_SESSION['itemname'] = $_lang["new_module"]; |
|
71 | - $content['wrap'] = '1'; |
|
70 | + $_SESSION['itemname'] = $_lang["new_module"]; |
|
71 | + $content['wrap'] = '1'; |
|
72 | 72 | } |
73 | 73 | if($modx->manager->hasFormValues()) { |
74 | - $modx->manager->loadFormValues(); |
|
74 | + $modx->manager->loadFormValues(); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | // Add lock-element JS-Script |
@@ -442,18 +442,18 @@ discard block |
||
442 | 442 | |
443 | 443 | <form name="mutate" id="mutate" class="module" method="post" action="index.php?a=109"> |
444 | 444 | <?php |
445 | - // invoke OnModFormPrerender event |
|
446 | - $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id)); |
|
447 | - if(is_array($evtOut)) { |
|
448 | - echo implode('', $evtOut); |
|
449 | - } |
|
445 | + // invoke OnModFormPrerender event |
|
446 | + $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id)); |
|
447 | + if(is_array($evtOut)) { |
|
448 | + echo implode('', $evtOut); |
|
449 | + } |
|
450 | 450 | |
451 | - // Prepare internal params & info-tab via parseDocBlock |
|
452 | - $modulecode = isset($content['modulecode']) ? $modx->db->escape($content['modulecode']) : ''; |
|
453 | - $docBlock = $modx->parseDocBlockFromString($modulecode); |
|
454 | - $docBlockList = $modx->convertDocBlockIntoList($docBlock); |
|
455 | - $internal = array(); |
|
456 | - ?> |
|
451 | + // Prepare internal params & info-tab via parseDocBlock |
|
452 | + $modulecode = isset($content['modulecode']) ? $modx->db->escape($content['modulecode']) : ''; |
|
453 | + $docBlock = $modx->parseDocBlockFromString($modulecode); |
|
454 | + $docBlockList = $modx->convertDocBlockIntoList($docBlock); |
|
455 | + $internal = array(); |
|
456 | + ?> |
|
457 | 457 | <input type="hidden" name="id" value="<?= $content['id'] ?>"> |
458 | 458 | <input type="hidden" name="mode" value="<?= $modx->manager->action ?>"> |
459 | 459 | |
@@ -506,11 +506,11 @@ discard block |
||
506 | 506 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
507 | 507 | <option> </option> |
508 | 508 | <?php |
509 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
510 | - foreach(getCategories() as $n => $v) { |
|
511 | - echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n"; |
|
512 | - } |
|
513 | - ?> |
|
509 | + include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
510 | + foreach(getCategories() as $n => $v) { |
|
511 | + echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n"; |
|
512 | + } |
|
513 | + ?> |
|
514 | 514 | </select> |
515 | 515 | </div> |
516 | 516 | </div> |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | <i class="<?= $_style["actions_save"] ?>"></i> <?= $_lang['manage_depends'] ?></a> |
618 | 618 | </div> |
619 | 619 | <?php |
620 | - $ds = $modx->db->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, |
|
620 | + $ds = $modx->db->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, |
|
621 | 621 | CASE smd.type |
622 | 622 | WHEN 10 THEN 'Chunk' |
623 | 623 | WHEN 20 THEN 'Document' |
@@ -633,17 +633,17 @@ discard block |
||
633 | 633 | LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50 |
634 | 634 | LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name'); |
635 | 635 | |
636 | - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
637 | - $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items |
|
638 | - $grd->noRecordMsg = $_lang['no_records_found']; |
|
639 | - $grd->cssClass = 'grid'; |
|
640 | - $grd->columnHeaderClass = 'gridHeader'; |
|
641 | - $grd->itemClass = 'gridItem'; |
|
642 | - $grd->altItemClass = 'gridAltItem'; |
|
643 | - $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; |
|
644 | - $grd->fields = "name,type"; |
|
645 | - echo $grd->render(); |
|
646 | - ?> |
|
636 | + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
637 | + $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items |
|
638 | + $grd->noRecordMsg = $_lang['no_records_found']; |
|
639 | + $grd->cssClass = 'grid'; |
|
640 | + $grd->columnHeaderClass = 'gridHeader'; |
|
641 | + $grd->itemClass = 'gridItem'; |
|
642 | + $grd->altItemClass = 'gridAltItem'; |
|
643 | + $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; |
|
644 | + $grd->fields = "name,type"; |
|
645 | + echo $grd->render(); |
|
646 | + ?> |
|
647 | 647 | </div> |
648 | 648 | </div> |
649 | 649 | <?php endif; ?> |
@@ -655,12 +655,12 @@ discard block |
||
655 | 655 | <div class="container container-body"> |
656 | 656 | <?php if($use_udperms == 1) : ?> |
657 | 657 | <?php |
658 | - // fetch user access permissions for the module |
|
659 | - $rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'"); |
|
660 | - $groupsarray = $modx->db->getColumn('usergroup', $rs); |
|
658 | + // fetch user access permissions for the module |
|
659 | + $rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'"); |
|
660 | + $groupsarray = $modx->db->getColumn('usergroup', $rs); |
|
661 | 661 | |
662 | - if($modx->hasPermission('access_permissions')) { |
|
663 | - ?> |
|
662 | + if($modx->hasPermission('access_permissions')) { |
|
663 | + ?> |
|
664 | 664 | <!-- User Group Access Permissions --> |
665 | 665 | <script type="text/javascript"> |
666 | 666 | function makePublic(b) { |
@@ -684,28 +684,28 @@ discard block |
||
684 | 684 | </script> |
685 | 685 | <p><?= $_lang['module_group_access_msg'] ?></p> |
686 | 686 | <?php |
687 | - } |
|
688 | - $chk = ''; |
|
689 | - $rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name'); |
|
690 | - while($row = $modx->db->getRow($rs)) { |
|
691 | - $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); |
|
692 | - $checked = in_array($row['id'], $groupsarray); |
|
693 | - if($modx->hasPermission('access_permissions')) { |
|
694 | - if($checked) { |
|
695 | - $notPublic = true; |
|
696 | - } |
|
697 | - $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n"; |
|
698 | - } else { |
|
699 | - if($checked) { |
|
700 | - $chks = '<input type="hidden" name="usrgroups[]" value="' . $row['id'] . '" />' . "\n" . $chks; |
|
701 | - } |
|
702 | - } |
|
703 | - } |
|
704 | - if($modx->hasPermission('access_permissions')) { |
|
705 | - $chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks; |
|
706 | - } |
|
707 | - echo $chks; |
|
708 | - ?> |
|
687 | + } |
|
688 | + $chk = ''; |
|
689 | + $rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name'); |
|
690 | + while($row = $modx->db->getRow($rs)) { |
|
691 | + $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); |
|
692 | + $checked = in_array($row['id'], $groupsarray); |
|
693 | + if($modx->hasPermission('access_permissions')) { |
|
694 | + if($checked) { |
|
695 | + $notPublic = true; |
|
696 | + } |
|
697 | + $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n"; |
|
698 | + } else { |
|
699 | + if($checked) { |
|
700 | + $chks = '<input type="hidden" name="usrgroups[]" value="' . $row['id'] . '" />' . "\n" . $chks; |
|
701 | + } |
|
702 | + } |
|
703 | + } |
|
704 | + if($modx->hasPermission('access_permissions')) { |
|
705 | + $chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks; |
|
706 | + } |
|
707 | + echo $chks; |
|
708 | + ?> |
|
709 | 709 | <?php endif; ?> |
710 | 710 | </div> |
711 | 711 | </div> |
@@ -721,11 +721,11 @@ discard block |
||
721 | 721 | |
722 | 722 | <input type="submit" name="save" style="display:none;"> |
723 | 723 | <?php |
724 | - // invoke OnModFormRender event |
|
725 | - $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id)); |
|
726 | - if(is_array($evtOut)) { |
|
727 | - echo implode('', $evtOut); |
|
728 | - } |
|
729 | - ?> |
|
724 | + // invoke OnModFormRender event |
|
725 | + $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id)); |
|
726 | + if(is_array($evtOut)) { |
|
727 | + echo implode('', $evtOut); |
|
728 | + } |
|
729 | + ?> |
|
730 | 730 | </form> |
731 | 731 | <script type="text/javascript">setTimeout('showParameters();', 10);</script> |
@@ -1,22 +1,22 @@ 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 | -switch($modx->manager->action) { |
|
5 | +switch ($modx->manager->action) { |
|
6 | 6 | case 107: |
7 | - if(!$modx->hasPermission('new_module')) { |
|
7 | + if (!$modx->hasPermission('new_module')) { |
|
8 | 8 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
9 | 9 | } |
10 | 10 | break; |
11 | 11 | case 108: |
12 | - if(!$modx->hasPermission('edit_module')) { |
|
12 | + if (!$modx->hasPermission('edit_module')) { |
|
13 | 13 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
14 | 14 | } |
15 | 15 | break; |
16 | 16 | default: |
17 | 17 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
18 | 18 | } |
19 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
19 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
20 | 20 | // Get table names (alphabetical) |
21 | 21 | $tbl_membergroup_names = $modx->getFullTableName('membergroup_names'); |
22 | 22 | $tbl_site_content = $modx->getFullTableName('site_content'); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $tbl_site_templates = $modx->getFullTableName('site_templates'); |
30 | 30 | $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); |
31 | 31 | |
32 | -if(!function_exists('createGUID')) { |
|
32 | +if (!function_exists('createGUID')) { |
|
33 | 33 | /** |
34 | 34 | * create globally unique identifiers (guid) |
35 | 35 | * |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | */ |
38 | 38 | function createGUID() |
39 | 39 | { |
40 | - srand((double)microtime() * 1000000); |
|
40 | + srand((double) microtime() * 1000000); |
|
41 | 41 | $r = rand(); |
42 | - $u = uniqid(getmypid() . $r . (double)microtime() * 1000000, 1); |
|
42 | + $u = uniqid(getmypid().$r.(double) microtime() * 1000000, 1); |
|
43 | 43 | $m = md5($u); |
44 | 44 | |
45 | 45 | return $m; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | // check to see the module editor isn't locked |
50 | -if($lockedEl = $modx->elementIsLocked(6, $id)) { |
|
50 | +if ($lockedEl = $modx->elementIsLocked(6, $id)) { |
|
51 | 51 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); |
52 | 52 | } |
53 | 53 | // end check for lock |
@@ -55,29 +55,29 @@ discard block |
||
55 | 55 | // Lock snippet for other users to edit |
56 | 56 | $modx->lockElement(6, $id); |
57 | 57 | |
58 | -if(isset($_GET['id'])) { |
|
58 | +if (isset($_GET['id'])) { |
|
59 | 59 | $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'"); |
60 | 60 | $content = $modx->db->getRow($rs); |
61 | - if(!$content) { |
|
61 | + if (!$content) { |
|
62 | 62 | $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
63 | 63 | } |
64 | 64 | $content['properties'] = str_replace("&", "&", $content['properties']); |
65 | 65 | $_SESSION['itemname'] = $content['name']; |
66 | - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
66 | + if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
67 | 67 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
68 | 68 | } |
69 | 69 | } else { |
70 | 70 | $_SESSION['itemname'] = $_lang["new_module"]; |
71 | 71 | $content['wrap'] = '1'; |
72 | 72 | } |
73 | -if($modx->manager->hasFormValues()) { |
|
73 | +if ($modx->manager->hasFormValues()) { |
|
74 | 74 | $modx->manager->loadFormValues(); |
75 | 75 | } |
76 | 76 | |
77 | 77 | // Add lock-element JS-Script |
78 | 78 | $lockElementId = $id; |
79 | 79 | $lockElementType = 6; |
80 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
80 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
81 | 81 | ?> |
82 | 82 | <script type="text/javascript"> |
83 | 83 | function loadDependencies() { |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | function BrowseServer() { |
425 | 425 | var w = screen.width * 0.7; |
426 | 426 | var h = screen.height * 0.7; |
427 | - OpenServerBrowser("<?= MODX_MANAGER_URL;?>media/browser/<?= $which_browser;?>/browser.php?Type=images", w, h); |
|
427 | + OpenServerBrowser("<?= MODX_MANAGER_URL; ?>media/browser/<?= $which_browser; ?>/browser.php?Type=images", w, h); |
|
428 | 428 | } |
429 | 429 | |
430 | 430 | function SetUrl(url, width, height, alt) { |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | <?php |
445 | 445 | // invoke OnModFormPrerender event |
446 | 446 | $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id)); |
447 | - if(is_array($evtOut)) { |
|
447 | + if (is_array($evtOut)) { |
|
448 | 448 | echo implode('', $evtOut); |
449 | 449 | } |
450 | 450 | |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | <input type="hidden" name="mode" value="<?= $modx->manager->action ?>"> |
459 | 459 | |
460 | 460 | <h1> |
461 | - <i class="<?= ($content['icon'] != '' ? $content['icon'] : $_style['icons_module']) ?>"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_module']) ?><i class="fa fa-question-circle help"></i> |
|
461 | + <i class="<?= ($content['icon'] != '' ? $content['icon'] : $_style['icons_module']) ?>"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_module']) ?><i class="fa fa-question-circle help"></i> |
|
462 | 462 | </h1> |
463 | 463 | |
464 | 464 | <?= $_style['actionbuttons']['dynamic']['element'] ?> |
@@ -483,8 +483,8 @@ discard block |
||
483 | 483 | <div class="col-md-9 col-lg-10"> |
484 | 484 | <div class="form-control-name clearfix"> |
485 | 485 | <input name="name" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" /> |
486 | - <?php if($modx->hasPermission('save_role')): ?> |
|
487 | - <label class="custom-control" title="<?= $_lang['lock_module'] . "\n" . $_lang['lock_module_msg'] ?>" tooltip> |
|
486 | + <?php if ($modx->hasPermission('save_role')): ?> |
|
487 | + <label class="custom-control" title="<?= $_lang['lock_module']."\n".$_lang['lock_module_msg'] ?>" tooltip> |
|
488 | 488 | <input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> /> |
489 | 489 | <i class="fa fa-lock"></i> |
490 | 490 | </label> |
@@ -506,9 +506,9 @@ discard block |
||
506 | 506 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
507 | 507 | <option> </option> |
508 | 508 | <?php |
509 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
510 | - foreach(getCategories() as $n => $v) { |
|
511 | - echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n"; |
|
509 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
510 | + foreach (getCategories() as $n => $v) { |
|
511 | + echo "\t\t\t".'<option value="'.$v['id'].'"'.($content['category'] == $v['id'] ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($v['category'])."</option>\n"; |
|
512 | 512 | } |
513 | 513 | ?> |
514 | 514 | </select> |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | <div class="form-group"> |
541 | 541 | <div class="form-row"> |
542 | 542 | <label for="disabled"><input name="disabled" id="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> |
543 | - <?= ($content['disabled'] == 1 ? '<span class="text-danger">' . $_lang['module_disabled'] . '</span>' : $_lang['module_disabled']) ?></label> |
|
543 | + <?= ($content['disabled'] == 1 ? '<span class="text-danger">'.$_lang['module_disabled'].'</span>' : $_lang['module_disabled']) ?></label> |
|
544 | 544 | </div> |
545 | 545 | <div class="form-row"> |
546 | 546 | <label for="parse_docblock"> |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | </div> |
606 | 606 | <!-- HTML text editor end --> |
607 | 607 | </div> |
608 | - <?php if($modx->manager->action == '108'): ?> |
|
608 | + <?php if ($modx->manager->action == '108'): ?> |
|
609 | 609 | <!-- Dependencies --> |
610 | 610 | <div class="tab-page" id="tabDepend"> |
611 | 611 | <h2 class="tab"><?= $_lang['settings_dependencies'] ?></h2> |
@@ -633,14 +633,14 @@ discard block |
||
633 | 633 | LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50 |
634 | 634 | LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name'); |
635 | 635 | |
636 | - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
636 | + include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; |
|
637 | 637 | $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items |
638 | 638 | $grd->noRecordMsg = $_lang['no_records_found']; |
639 | 639 | $grd->cssClass = 'grid'; |
640 | 640 | $grd->columnHeaderClass = 'gridHeader'; |
641 | 641 | $grd->itemClass = 'gridItem'; |
642 | 642 | $grd->altItemClass = 'gridAltItem'; |
643 | - $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; |
|
643 | + $grd->columns = $_lang['element_name']." ,".$_lang['type']; |
|
644 | 644 | $grd->fields = "name,type"; |
645 | 645 | echo $grd->render(); |
646 | 646 | ?> |
@@ -653,13 +653,13 @@ discard block |
||
653 | 653 | <h2 class="tab"><?= $_lang['access_permissions'] ?></h2> |
654 | 654 | <script type="text/javascript">tp.addTabPage(document.getElementById("tabPermissions"));</script> |
655 | 655 | <div class="container container-body"> |
656 | - <?php if($use_udperms == 1) : ?> |
|
656 | + <?php if ($use_udperms == 1) : ?> |
|
657 | 657 | <?php |
658 | 658 | // fetch user access permissions for the module |
659 | 659 | $rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'"); |
660 | 660 | $groupsarray = $modx->db->getColumn('usergroup', $rs); |
661 | 661 | |
662 | - if($modx->hasPermission('access_permissions')) { |
|
662 | + if ($modx->hasPermission('access_permissions')) { |
|
663 | 663 | ?> |
664 | 664 | <!-- User Group Access Permissions --> |
665 | 665 | <script type="text/javascript"> |
@@ -687,22 +687,22 @@ discard block |
||
687 | 687 | } |
688 | 688 | $chk = ''; |
689 | 689 | $rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name'); |
690 | - while($row = $modx->db->getRow($rs)) { |
|
690 | + while ($row = $modx->db->getRow($rs)) { |
|
691 | 691 | $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); |
692 | 692 | $checked = in_array($row['id'], $groupsarray); |
693 | - if($modx->hasPermission('access_permissions')) { |
|
694 | - if($checked) { |
|
693 | + if ($modx->hasPermission('access_permissions')) { |
|
694 | + if ($checked) { |
|
695 | 695 | $notPublic = true; |
696 | 696 | } |
697 | - $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n"; |
|
697 | + $chks .= '<label><input type="checkbox" name="usrgroups[]" value="'.$row['id'].'"'.($checked ? ' checked="checked"' : '').' onclick="makePublic(false)" /> '.$row['name']."</label><br />\n"; |
|
698 | 698 | } else { |
699 | - if($checked) { |
|
700 | - $chks = '<input type="hidden" name="usrgroups[]" value="' . $row['id'] . '" />' . "\n" . $chks; |
|
699 | + if ($checked) { |
|
700 | + $chks = '<input type="hidden" name="usrgroups[]" value="'.$row['id'].'" />'."\n".$chks; |
|
701 | 701 | } |
702 | 702 | } |
703 | 703 | } |
704 | - if($modx->hasPermission('access_permissions')) { |
|
705 | - $chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks; |
|
704 | + if ($modx->hasPermission('access_permissions')) { |
|
705 | + $chks = '<label><input type="checkbox" name="chkallgroups"'.(!$notPublic ? ' checked="checked"' : '').' onclick="makePublic(true)" /><span class="warning"> '.$_lang['all_usr_groups'].'</span></label><br />'."\n".$chks; |
|
706 | 706 | } |
707 | 707 | echo $chks; |
708 | 708 | ?> |
@@ -723,7 +723,7 @@ discard block |
||
723 | 723 | <?php |
724 | 724 | // invoke OnModFormRender event |
725 | 725 | $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id)); |
726 | - if(is_array($evtOut)) { |
|
726 | + if (is_array($evtOut)) { |
|
727 | 727 | echo implode('', $evtOut); |
728 | 728 | } |
729 | 729 | ?> |
@@ -1,15 +1,15 @@ 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 | -switch($modx->manager->action) { |
|
5 | +switch($modx->manager->action) { |
|
6 | 6 | case 107: |
7 | - if(!$modx->hasPermission('new_module')) { |
|
7 | + if(!$modx->hasPermission('new_module')) { |
|
8 | 8 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
9 | 9 | } |
10 | 10 | break; |
11 | 11 | case 108: |
12 | - if(!$modx->hasPermission('edit_module')) { |
|
12 | + if(!$modx->hasPermission('edit_module')) { |
|
13 | 13 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
14 | 14 | } |
15 | 15 | break; |
@@ -29,14 +29,14 @@ discard block |
||
29 | 29 | $tbl_site_templates = $modx->getFullTableName('site_templates'); |
30 | 30 | $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); |
31 | 31 | |
32 | -if(!function_exists('createGUID')) { |
|
32 | +if(!function_exists('createGUID')) { |
|
33 | 33 | /** |
34 | 34 | * create globally unique identifiers (guid) |
35 | 35 | * |
36 | 36 | * @return string |
37 | 37 | */ |
38 | - function createGUID() |
|
39 | - { |
|
38 | + function createGUID() |
|
39 | + { |
|
40 | 40 | srand((double)microtime() * 1000000); |
41 | 41 | $r = rand(); |
42 | 42 | $u = uniqid(getmypid() . $r . (double)microtime() * 1000000, 1); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | // check to see the module editor isn't locked |
50 | -if($lockedEl = $modx->elementIsLocked(6, $id)) { |
|
50 | +if($lockedEl = $modx->elementIsLocked(6, $id)) { |
|
51 | 51 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); |
52 | 52 | } |
53 | 53 | // end check for lock |
@@ -55,22 +55,22 @@ discard block |
||
55 | 55 | // Lock snippet for other users to edit |
56 | 56 | $modx->lockElement(6, $id); |
57 | 57 | |
58 | -if(isset($_GET['id'])) { |
|
58 | +if(isset($_GET['id'])) { |
|
59 | 59 | $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'"); |
60 | 60 | $content = $modx->db->getRow($rs); |
61 | - if(!$content) { |
|
61 | + if(!$content) { |
|
62 | 62 | $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
63 | 63 | } |
64 | 64 | $content['properties'] = str_replace("&", "&", $content['properties']); |
65 | 65 | $_SESSION['itemname'] = $content['name']; |
66 | - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
66 | + if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
67 | 67 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
68 | 68 | } |
69 | -} else { |
|
69 | +} else { |
|
70 | 70 | $_SESSION['itemname'] = $_lang["new_module"]; |
71 | 71 | $content['wrap'] = '1'; |
72 | 72 | } |
73 | -if($modx->manager->hasFormValues()) { |
|
73 | +if($modx->manager->hasFormValues()) { |
|
74 | 74 | $modx->manager->loadFormValues(); |
75 | 75 | } |
76 | 76 | |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | <?php |
445 | 445 | // invoke OnModFormPrerender event |
446 | 446 | $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id)); |
447 | - if(is_array($evtOut)) { |
|
447 | + if(is_array($evtOut)) { |
|
448 | 448 | echo implode('', $evtOut); |
449 | 449 | } |
450 | 450 | |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | <option> </option> |
508 | 508 | <?php |
509 | 509 | include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
510 | - foreach(getCategories() as $n => $v) { |
|
510 | + foreach(getCategories() as $n => $v) { |
|
511 | 511 | echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n"; |
512 | 512 | } |
513 | 513 | ?> |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | $rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'"); |
660 | 660 | $groupsarray = $modx->db->getColumn('usergroup', $rs); |
661 | 661 | |
662 | - if($modx->hasPermission('access_permissions')) { |
|
662 | + if($modx->hasPermission('access_permissions')) { |
|
663 | 663 | ?> |
664 | 664 | <!-- User Group Access Permissions --> |
665 | 665 | <script type="text/javascript"> |
@@ -687,21 +687,21 @@ discard block |
||
687 | 687 | } |
688 | 688 | $chk = ''; |
689 | 689 | $rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name'); |
690 | - while($row = $modx->db->getRow($rs)) { |
|
690 | + while($row = $modx->db->getRow($rs)) { |
|
691 | 691 | $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); |
692 | 692 | $checked = in_array($row['id'], $groupsarray); |
693 | - if($modx->hasPermission('access_permissions')) { |
|
694 | - if($checked) { |
|
693 | + if($modx->hasPermission('access_permissions')) { |
|
694 | + if($checked) { |
|
695 | 695 | $notPublic = true; |
696 | 696 | } |
697 | 697 | $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n"; |
698 | - } else { |
|
699 | - if($checked) { |
|
698 | + } else { |
|
699 | + if($checked) { |
|
700 | 700 | $chks = '<input type="hidden" name="usrgroups[]" value="' . $row['id'] . '" />' . "\n" . $chks; |
701 | 701 | } |
702 | 702 | } |
703 | 703 | } |
704 | - if($modx->hasPermission('access_permissions')) { |
|
704 | + if($modx->hasPermission('access_permissions')) { |
|
705 | 705 | $chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks; |
706 | 706 | } |
707 | 707 | echo $chks; |
@@ -723,7 +723,7 @@ discard block |
||
723 | 723 | <?php |
724 | 724 | // invoke OnModFormRender event |
725 | 725 | $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id)); |
726 | - if(is_array($evtOut)) { |
|
726 | + if(is_array($evtOut)) { |
|
727 | 727 | echo implode('', $evtOut); |
728 | 728 | } |
729 | 729 | ?> |
@@ -1,13 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.'); |
|
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 | 8 | if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { |
9 | - // seems to be a new install - send the user to the configuration page |
|
10 | - exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>'); |
|
9 | + // seems to be a new install - send the user to the configuration page |
|
10 | + exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>'); |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | // set placeholders |
@@ -17,92 +17,92 @@ discard block |
||
17 | 17 | |
18 | 18 | // setup message info |
19 | 19 | if($modx->hasPermission('messages')) { |
20 | - include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); |
|
21 | - $_SESSION['nrtotalmessages'] = $nrtotalmessages; |
|
22 | - $_SESSION['nrnewmessages'] = $nrnewmessages; |
|
23 | - |
|
24 | - $msg = array(); |
|
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>)' : ''; |
|
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'; |
|
29 | - $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); |
|
30 | - $msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages); |
|
31 | - $ph['MessageInfo'] = implode("\n", $msg); |
|
20 | + include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); |
|
21 | + $_SESSION['nrtotalmessages'] = $nrtotalmessages; |
|
22 | + $_SESSION['nrnewmessages'] = $nrnewmessages; |
|
23 | + |
|
24 | + $msg = array(); |
|
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>)' : ''; |
|
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'; |
|
29 | + $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); |
|
30 | + $msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages); |
|
31 | + $ph['MessageInfo'] = implode("\n", $msg); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | // setup icons |
35 | 35 | if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { |
36 | - $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]'; |
|
37 | - $ph['SecurityIcon'] = wrapIcon($icon, 75); |
|
36 | + $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]'; |
|
37 | + $ph['SecurityIcon'] = wrapIcon($icon, 75); |
|
38 | 38 | } |
39 | 39 | if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { |
40 | - $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]'; |
|
41 | - $ph['WebUserIcon'] = wrapIcon($icon, 99); |
|
40 | + $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]'; |
|
41 | + $ph['WebUserIcon'] = wrapIcon($icon, 99); |
|
42 | 42 | } |
43 | 43 | if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { |
44 | - $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]'; |
|
45 | - $ph['ModulesIcon'] = wrapIcon($icon, 106); |
|
44 | + $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]'; |
|
45 | + $ph['ModulesIcon'] = wrapIcon($icon, 106); |
|
46 | 46 | } |
47 | 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 | - $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]'; |
|
49 | - $ph['ResourcesIcon'] = wrapIcon($icon, 76); |
|
48 | + $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]'; |
|
49 | + $ph['ResourcesIcon'] = wrapIcon($icon, 76); |
|
50 | 50 | } |
51 | 51 | if($modx->hasPermission('bk_manager')) { |
52 | - $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]'; |
|
53 | - $ph['BackupIcon'] = wrapIcon($icon, 93); |
|
52 | + $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]'; |
|
53 | + $ph['BackupIcon'] = wrapIcon($icon, 93); |
|
54 | 54 | } |
55 | 55 | if($modx->hasPermission('help')) { |
56 | - $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]'; |
|
57 | - $ph['HelpIcon'] = wrapIcon($icon, 9); |
|
56 | + $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]'; |
|
57 | + $ph['HelpIcon'] = wrapIcon($icon, 9); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | if($modx->hasPermission('new_document')) { |
61 | - $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]'; |
|
62 | - $ph['ResourceIcon'] = wrapIcon($icon, 4); |
|
63 | - $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]'; |
|
64 | - $ph['WeblinkIcon'] = wrapIcon($icon, 72); |
|
61 | + $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]'; |
|
62 | + $ph['ResourceIcon'] = wrapIcon($icon, 4); |
|
63 | + $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]'; |
|
64 | + $ph['WeblinkIcon'] = wrapIcon($icon, 72); |
|
65 | 65 | } |
66 | 66 | if($modx->hasPermission('assets_images')) { |
67 | - $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]'; |
|
68 | - $ph['ImagesIcon'] = wrapIcon($icon, 72); |
|
67 | + $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]'; |
|
68 | + $ph['ImagesIcon'] = wrapIcon($icon, 72); |
|
69 | 69 | } |
70 | 70 | if($modx->hasPermission('assets_files')) { |
71 | - $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]'; |
|
72 | - $ph['FilesIcon'] = wrapIcon($icon, 72); |
|
71 | + $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]'; |
|
72 | + $ph['FilesIcon'] = wrapIcon($icon, 72); |
|
73 | 73 | } |
74 | 74 | if($modx->hasPermission('change_password')) { |
75 | - $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]'; |
|
76 | - $ph['PasswordIcon'] = wrapIcon($icon, 28); |
|
75 | + $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]'; |
|
76 | + $ph['PasswordIcon'] = wrapIcon($icon, 28); |
|
77 | 77 | } |
78 | 78 | $icon = '<i class="[&icons_logout_large&]"></i>[%logout%]'; |
79 | 79 | $ph['LogoutIcon'] = wrapIcon($icon, 8); |
80 | 80 | |
81 | 81 | // do some config checks |
82 | 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 | - $ph['config_check_results'] = $config_check_results; |
|
86 | - $ph['config_display'] = 'block'; |
|
87 | - } else { |
|
88 | - $ph['config_display'] = 'none'; |
|
89 | - } |
|
83 | + include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
|
84 | + if($config_check_results != $_lang['configcheck_ok']) { |
|
85 | + $ph['config_check_results'] = $config_check_results; |
|
86 | + $ph['config_display'] = 'block'; |
|
87 | + } else { |
|
88 | + $ph['config_display'] = 'none'; |
|
89 | + } |
|
90 | 90 | } else { |
91 | - $ph['config_display'] = 'none'; |
|
91 | + $ph['config_display'] = 'none'; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | // Check logout-reminder |
95 | 95 | if(isset($_SESSION['show_logout_reminder'])) { |
96 | - switch($_SESSION['show_logout_reminder']['type']) { |
|
97 | - case 'logout_reminder': |
|
98 | - $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); |
|
99 | - $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); |
|
100 | - break; |
|
101 | - } |
|
102 | - $ph['show_logout_reminder'] = 'block'; |
|
103 | - unset($_SESSION['show_logout_reminder']); |
|
96 | + switch($_SESSION['show_logout_reminder']['type']) { |
|
97 | + case 'logout_reminder': |
|
98 | + $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); |
|
99 | + $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); |
|
100 | + break; |
|
101 | + } |
|
102 | + $ph['show_logout_reminder'] = 'block'; |
|
103 | + unset($_SESSION['show_logout_reminder']); |
|
104 | 104 | } else { |
105 | - $ph['show_logout_reminder'] = 'none'; |
|
105 | + $ph['show_logout_reminder'] = 'none'; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | // Check multiple sessions |
@@ -150,11 +150,11 @@ discard block |
||
150 | 150 | $nrnewmessages = '<span class="text-danger">' . $_SESSION['nrnewmessages'] . '</span>'; |
151 | 151 | |
152 | 152 | $ph['UserInfo'] = $modx->parseText($tpl, array( |
153 | - 'username' => $modx->getLoginUserName(), |
|
154 | - 'role' => $_SESSION['mgrPermissions']['name'], |
|
155 | - 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), |
|
156 | - 'logincount' => $_SESSION['mgrLogincount'] + 1, |
|
157 | - 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) |
|
153 | + 'username' => $modx->getLoginUserName(), |
|
154 | + 'role' => $_SESSION['mgrPermissions']['name'], |
|
155 | + 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), |
|
156 | + 'logincount' => $_SESSION['mgrLogincount'] + 1, |
|
157 | + 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) |
|
158 | 158 | )); |
159 | 159 | |
160 | 160 | $from = array(); |
@@ -163,13 +163,13 @@ discard block |
||
163 | 163 | $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC'); |
164 | 164 | |
165 | 165 | if($modx->db->getRecordCount($rs) < 1) { |
166 | - $html = '<p>[%no_active_users_found%]</p>'; |
|
166 | + $html = '<p>[%no_active_users_found%]</p>'; |
|
167 | 167 | } else { |
168 | - include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
|
169 | - $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
|
170 | - $ph['now'] = strftime('%H:%M:%S', $now); |
|
171 | - $timetocheck = ($now - (60 * 20)); //+$server_offset_time; |
|
172 | - $html = ' |
|
168 | + include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
|
169 | + $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
|
170 | + $ph['now'] = strftime('%H:%M:%S', $now); |
|
171 | + $timetocheck = ($now - (60 * 20)); //+$server_offset_time; |
|
172 | + $html = ' |
|
173 | 173 | <div class="card-body"> |
174 | 174 | [%onlineusers_message%] |
175 | 175 | <b>[+now+]</b>): |
@@ -187,33 +187,33 @@ discard block |
||
187 | 187 | </thead> |
188 | 188 | <tbody>'; |
189 | 189 | |
190 | - $userList = array(); |
|
191 | - $userCount = array(); |
|
192 | - // Create userlist with session-count first before output |
|
193 | - while($activeusers = $modx->db->getRow($rs)) { |
|
194 | - $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
|
195 | - |
|
196 | - $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
|
197 | - $webicon = $activeusers['internalKey'] < 0 ? '<img src="[&tree_globe&]" alt="Web user" /> ' : ''; |
|
198 | - $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; |
|
199 | - $currentaction = getAction($activeusers['action'], $activeusers['id']); |
|
200 | - $userList[] = array( |
|
201 | - $idle, |
|
202 | - '', |
|
203 | - $activeusers['username'], |
|
204 | - $webicon, |
|
205 | - abs($activeusers['internalKey']), |
|
206 | - $ip, |
|
207 | - strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time), |
|
208 | - $currentaction |
|
209 | - ); |
|
210 | - } |
|
211 | - foreach($userList as $params) { |
|
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); |
|
214 | - } |
|
215 | - |
|
216 | - $html .= ' |
|
190 | + $userList = array(); |
|
191 | + $userCount = array(); |
|
192 | + // Create userlist with session-count first before output |
|
193 | + while($activeusers = $modx->db->getRow($rs)) { |
|
194 | + $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
|
195 | + |
|
196 | + $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
|
197 | + $webicon = $activeusers['internalKey'] < 0 ? '<img src="[&tree_globe&]" alt="Web user" /> ' : ''; |
|
198 | + $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; |
|
199 | + $currentaction = getAction($activeusers['action'], $activeusers['id']); |
|
200 | + $userList[] = array( |
|
201 | + $idle, |
|
202 | + '', |
|
203 | + $activeusers['username'], |
|
204 | + $webicon, |
|
205 | + abs($activeusers['internalKey']), |
|
206 | + $ip, |
|
207 | + strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time), |
|
208 | + $currentaction |
|
209 | + ); |
|
210 | + } |
|
211 | + foreach($userList as $params) { |
|
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); |
|
214 | + } |
|
215 | + |
|
216 | + $html .= ' |
|
217 | 217 | </tbody> |
218 | 218 | </table> |
219 | 219 | </div> |
@@ -254,17 +254,17 @@ discard block |
||
254 | 254 | // invoke event OnManagerWelcomePrerender |
255 | 255 | $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender'); |
256 | 256 | if(is_array($evtOut)) { |
257 | - $output = implode('', $evtOut); |
|
258 | - $ph['OnManagerWelcomePrerender'] = $output; |
|
257 | + $output = implode('', $evtOut); |
|
258 | + $ph['OnManagerWelcomePrerender'] = $output; |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | $widgets['welcome'] = array( |
262 | - 'menuindex' => '10', |
|
263 | - 'id' => 'welcome', |
|
264 | - 'cols' => 'col-lg-6', |
|
265 | - 'icon' => 'fa-home', |
|
266 | - 'title' => '[%welcome_title%]', |
|
267 | - 'body' => ' |
|
262 | + 'menuindex' => '10', |
|
263 | + 'id' => 'welcome', |
|
264 | + 'cols' => 'col-lg-6', |
|
265 | + 'icon' => 'fa-home', |
|
266 | + 'title' => '[%welcome_title%]', |
|
267 | + 'body' => ' |
|
268 | 268 | <div class="wm_buttons card-body"> |
269 | 269 | <!--@IF:[[#hasPermission?key=new_document]]--> |
270 | 270 | <span class="wm_button"> |
@@ -338,25 +338,25 @@ discard block |
||
338 | 338 | </table> |
339 | 339 | </div> |
340 | 340 | ', |
341 | - 'hide'=>'0' |
|
341 | + 'hide'=>'0' |
|
342 | 342 | ); |
343 | 343 | $widgets['onlineinfo'] = array( |
344 | - 'menuindex' => '20', |
|
345 | - 'id' => 'onlineinfo', |
|
346 | - 'cols' => 'col-lg-6', |
|
347 | - 'icon' => 'fa-user', |
|
348 | - 'title' => '[%onlineusers_title%]', |
|
349 | - 'body' => '<div class="userstable">[+OnlineInfo+]</div>', |
|
350 | - 'hide'=>'0' |
|
344 | + 'menuindex' => '20', |
|
345 | + 'id' => 'onlineinfo', |
|
346 | + 'cols' => 'col-lg-6', |
|
347 | + 'icon' => 'fa-user', |
|
348 | + 'title' => '[%onlineusers_title%]', |
|
349 | + 'body' => '<div class="userstable">[+OnlineInfo+]</div>', |
|
350 | + 'hide'=>'0' |
|
351 | 351 | ); |
352 | 352 | $widgets['recentinfo'] = array( |
353 | - 'menuindex' => '30', |
|
354 | - 'id' => 'modxrecent_widget', |
|
355 | - 'cols' => 'col-sm-12', |
|
356 | - 'icon' => 'fa-pencil-square-o', |
|
357 | - 'title' => '[%activity_title%]', |
|
358 | - 'body' => '<div class="widget-stage">[+RecentInfo+]</div>', |
|
359 | - 'hide'=>'0' |
|
353 | + 'menuindex' => '30', |
|
354 | + 'id' => 'modxrecent_widget', |
|
355 | + 'cols' => 'col-sm-12', |
|
356 | + 'icon' => 'fa-pencil-square-o', |
|
357 | + 'title' => '[%activity_title%]', |
|
358 | + 'body' => '<div class="widget-stage">[+RecentInfo+]</div>', |
|
359 | + 'hide'=>'0' |
|
360 | 360 | ); |
361 | 361 | if ($modx->config['rss_url_news']) { |
362 | 362 | $widgets['news'] = array( |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | // invoke OnManagerWelcomeHome event |
385 | 385 | $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets)); |
386 | 386 | if(is_array($sitewidgets)) { |
387 | - $newwidgets = array(); |
|
387 | + $newwidgets = array(); |
|
388 | 388 | foreach($sitewidgets as $widget){ |
389 | 389 | $newwidgets = array_merge($newwidgets, unserialize($widget)); |
390 | 390 | } |
@@ -392,21 +392,21 @@ discard block |
||
392 | 392 | } |
393 | 393 | |
394 | 394 | usort($widgets, function ($a, $b) { |
395 | - return $a['menuindex'] - $b['menuindex']; |
|
395 | + return $a['menuindex'] - $b['menuindex']; |
|
396 | 396 | }); |
397 | 397 | |
398 | 398 | $tpl = getTplWidget(); |
399 | 399 | $output = ''; |
400 | 400 | foreach($widgets as $widget) { |
401 | - if ($widget['hide'] != '1'){ |
|
402 | - $output .= $modx->parseText($tpl, $widget); |
|
403 | - } |
|
401 | + if ($widget['hide'] != '1'){ |
|
402 | + $output .= $modx->parseText($tpl, $widget); |
|
403 | + } |
|
404 | 404 | } |
405 | 405 | $ph['widgets'] = $output; |
406 | 406 | |
407 | 407 | // load template |
408 | 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'; |
|
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']; |
@@ -414,27 +414,27 @@ discard block |
||
414 | 414 | $target = $modx->mergeSettingsContent($target); |
415 | 415 | |
416 | 416 | if(substr($target, 0, 1) === '@') { |
417 | - if(substr($target, 0, 6) === '@CHUNK') { |
|
418 | - $content = $modx->getChunk(trim(substr($target, 7))); |
|
419 | - } elseif(substr($target, 0, 5) === '@FILE') { |
|
420 | - $content = file_get_contents(trim(substr($target, 6))); |
|
421 | - } else { |
|
422 | - $content = ''; |
|
423 | - } |
|
417 | + if(substr($target, 0, 6) === '@CHUNK') { |
|
418 | + $content = $modx->getChunk(trim(substr($target, 7))); |
|
419 | + } elseif(substr($target, 0, 5) === '@FILE') { |
|
420 | + $content = file_get_contents(trim(substr($target, 6))); |
|
421 | + } else { |
|
422 | + $content = ''; |
|
423 | + } |
|
424 | 424 | } else { |
425 | - $chunk = $modx->getChunk($target); |
|
426 | - if($chunk !== false && !empty($chunk)) { |
|
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 |
|
433 | - { |
|
434 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
435 | - } else { |
|
436 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
|
437 | - } |
|
425 | + $chunk = $modx->getChunk($target); |
|
426 | + if($chunk !== false && !empty($chunk)) { |
|
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 |
|
433 | + { |
|
434 | + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
435 | + } else { |
|
436 | + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
|
437 | + } |
|
438 | 438 | } |
439 | 439 | |
440 | 440 | // merge placeholders |
@@ -442,8 +442,8 @@ discard block |
||
442 | 442 | $content = $modx->mergeSettingsContent($content); |
443 | 443 | $content = $modx->parseText($content, $ph); |
444 | 444 | if(strpos($content, '[+') !== false) { |
445 | - $modx->toPlaceholders($ph); |
|
446 | - $content = $modx->mergePlaceholderContent($content); |
|
445 | + $modx->toPlaceholders($ph); |
|
446 | + $content = $modx->mergePlaceholderContent($content); |
|
447 | 447 | } |
448 | 448 | $content = $modx->parseDocumentSource($content); |
449 | 449 | $content = $modx->parseText($content, $_lang, '[%', '%]'); |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | $content = $modx->cleanUpMODXTags($content); //cleanup |
452 | 452 | |
453 | 453 | if($js = $modx->getRegisteredClientScripts()) { |
454 | - $content .= $js; |
|
454 | + $content .= $js; |
|
455 | 455 | } |
456 | 456 | |
457 | 457 | echo $content; |
@@ -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,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,7 +16,7 @@ discard block |
||
16 | 16 | $_SESSION['nrnewmessages'] = 0; |
17 | 17 | |
18 | 18 | // setup message info |
19 | -if($modx->hasPermission('messages')) { |
|
19 | +if($modx->hasPermission('messages')) { |
|
20 | 20 | include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); |
21 | 21 | $_SESSION['nrtotalmessages'] = $nrtotalmessages; |
22 | 22 | $_SESSION['nrnewmessages'] = $nrnewmessages; |
@@ -32,46 +32,46 @@ discard block |
||
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,21 +79,21 @@ 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) { |
|
82 | +if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { |
|
83 | 83 | include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
84 | - if($config_check_results != $_lang['configcheck_ok']) { |
|
84 | + if($config_check_results != $_lang['configcheck_ok']) { |
|
85 | 85 | $ph['config_check_results'] = $config_check_results; |
86 | 86 | $ph['config_display'] = 'block'; |
87 | - } else { |
|
87 | + } else { |
|
88 | 88 | $ph['config_display'] = 'none'; |
89 | 89 | } |
90 | -} else { |
|
90 | +} else { |
|
91 | 91 | $ph['config_display'] = 'none'; |
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']); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | $ph['show_logout_reminder'] = 'block'; |
103 | 103 | unset($_SESSION['show_logout_reminder']); |
104 | -} else { |
|
104 | +} else { |
|
105 | 105 | $ph['show_logout_reminder'] = 'none'; |
106 | 106 | } |
107 | 107 | |
@@ -162,9 +162,9 @@ 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 | -} else { |
|
167 | +} else { |
|
168 | 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); |
@@ -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,7 +208,7 @@ 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 | 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 | } |
@@ -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 | } |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | 'body' => '<div class="widget-stage">[+RecentInfo+]</div>', |
359 | 359 | 'hide'=>'0' |
360 | 360 | ); |
361 | -if ($modx->config['rss_url_news']) { |
|
361 | +if ($modx->config['rss_url_news']) { |
|
362 | 362 | $widgets['news'] = array( |
363 | 363 | 'menuindex' => '40', |
364 | 364 | 'id' => 'news', |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | 'hide'=>'0' |
370 | 370 | ); |
371 | 371 | } |
372 | -if ($modx->config['rss_url_security']) { |
|
372 | +if ($modx->config['rss_url_security']) { |
|
373 | 373 | $widgets['security'] = array( |
374 | 374 | 'menuindex' => '50', |
375 | 375 | 'id' => 'security', |
@@ -383,29 +383,29 @@ 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'])) { |
|
408 | +if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { |
|
409 | 409 | $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; |
410 | 410 | } |
411 | 411 | |
@@ -413,26 +413,28 @@ discard block |
||
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 | - } else { |
|
421 | + } else { |
|
422 | 422 | $content = ''; |
423 | 423 | } |
424 | -} else { |
|
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)) { |
|
428 | + } elseif(is_file(MODX_BASE_PATH . $target)) { |
|
429 | 429 | $content = file_get_contents(MODX_BASE_PATH . $target); |
430 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { |
|
430 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { |
|
431 | 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 |
|
432 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) { |
|
433 | + // ClipperCMS compatible |
|
433 | 434 | { |
434 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
435 | - } else { |
|
435 | + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
436 | + } |
|
437 | + } else { |
|
436 | 438 | $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
437 | 439 | } |
438 | 440 | } |
@@ -441,7 +443,7 @@ discard block |
||
441 | 443 | $content = $modx->mergeConditionalTagsContent($content); |
442 | 444 | $content = $modx->mergeSettingsContent($content); |
443 | 445 | $content = $modx->parseText($content, $ph); |
444 | -if(strpos($content, '[+') !== false) { |
|
446 | +if(strpos($content, '[+') !== false) { |
|
445 | 447 | $modx->toPlaceholders($ph); |
446 | 448 | $content = $modx->mergePlaceholderContent($content); |
447 | 449 | } |
@@ -450,7 +452,7 @@ discard block |
||
450 | 452 | $content = $modx->parseText($content, $_style, '[&', '&]'); |
451 | 453 | $content = $modx->cleanUpMODXTags($content); //cleanup |
452 | 454 | |
453 | -if($js = $modx->getRegisteredClientScripts()) { |
|
455 | +if($js = $modx->getRegisteredClientScripts()) { |
|
454 | 456 | $content .= $js; |
455 | 457 | } |
456 | 458 | |
@@ -460,9 +462,10 @@ discard block |
||
460 | 462 | // <a href="javascript:;" class="setting"><i class="fa fa-cog"></i></a> |
461 | 463 | // <a href="javascript:;" class="closed"><i class="fa fa-close"></i></a> |
462 | 464 | //</span> |
463 | -if(!function_exists('getTplWidget')) { |
|
464 | - function getTplWidget() |
|
465 | - { // recent document info |
|
465 | +if(!function_exists('getTplWidget')) { |
|
466 | + function getTplWidget() |
|
467 | + { |
|
468 | +// recent document info |
|
466 | 469 | return ' |
467 | 470 | <div class="[+cols+]" id="[+id+]"> |
468 | 471 | <div class="card"[+cardAttr+]> |
@@ -474,9 +477,10 @@ discard block |
||
474 | 477 | } |
475 | 478 | } |
476 | 479 | |
477 | -if(!function_exists('getRecentInfo')) { |
|
478 | - function getRecentInfo() |
|
479 | - { // recent document info |
|
480 | +if(!function_exists('getRecentInfo')) { |
|
481 | + function getRecentInfo() |
|
482 | + { |
|
483 | +// recent document info |
|
480 | 484 | $modx = evolutionCMS(); |
481 | 485 | |
482 | 486 | $modx->addSnippet('recentInfoList', 'getRecentInfoList'); |
@@ -504,14 +508,14 @@ discard block |
||
504 | 508 | } |
505 | 509 | } |
506 | 510 | |
507 | -if(!function_exists('getRecentInfoList')) { |
|
508 | - function getRecentInfoList() |
|
509 | - { |
|
511 | +if(!function_exists('getRecentInfoList')) { |
|
512 | + function getRecentInfoList() |
|
513 | + { |
|
510 | 514 | $modx = evolutionCMS(); |
511 | 515 | |
512 | 516 | $rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10); |
513 | 517 | |
514 | - if ($modx->db->getRecordCount($rs) < 1) { |
|
518 | + if ($modx->db->getRecordCount($rs) < 1) { |
|
515 | 519 | return '<tr><td>[%no_activity_message%]</td></tr>'; |
516 | 520 | } |
517 | 521 | |
@@ -521,22 +525,22 @@ discard block |
||
521 | 525 | $btntpl['preview_btn'] = '<a [+preview_disabled+]" title="[%preview_resource%]" target="_blank" href="../index.php?&id=[+id+]"><i class="fa fa-eye fa-fw"></i></a> '; |
522 | 526 | |
523 | 527 | $output = array(); |
524 | - while ($ph = $modx->db->getRow($rs)) { |
|
528 | + while ($ph = $modx->db->getRow($rs)) { |
|
525 | 529 | $docid = $ph['id']; |
526 | 530 | $_ = $modx->getUserInfo($ph['editedby']); |
527 | 531 | $ph['username'] = $_['username']; |
528 | 532 | |
529 | - if ($ph['deleted'] == 1) { |
|
533 | + if ($ph['deleted'] == 1) { |
|
530 | 534 | $ph['status'] = 'deleted text-danger'; |
531 | - } elseif ($ph['published'] == 0) { |
|
535 | + } elseif ($ph['published'] == 0) { |
|
532 | 536 | $ph['status'] = 'unpublished font-italic text-muted'; |
533 | - } else { |
|
537 | + } else { |
|
534 | 538 | $ph['status'] = 'published'; |
535 | 539 | } |
536 | 540 | |
537 | - if ($modx->hasPermission('edit_document')) { |
|
541 | + if ($modx->hasPermission('edit_document')) { |
|
538 | 542 | $ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']); |
539 | - } else { |
|
543 | + } else { |
|
540 | 544 | $ph['edit_btn'] = ''; |
541 | 545 | } |
542 | 546 | |
@@ -549,24 +553,24 @@ discard block |
||
549 | 553 | $preview_disabled |
550 | 554 | ), $btntpl['preview_btn']); |
551 | 555 | |
552 | - if ($modx->hasPermission('delete_document')) { |
|
553 | - if ($ph['deleted'] == 0) { |
|
556 | + if ($modx->hasPermission('delete_document')) { |
|
557 | + if ($ph['deleted'] == 0) { |
|
554 | 558 | $delete_btn = '<a onclick="return confirm(\'[%confirm_delete_record%]\')" title="[%delete_resource%]" href="index.php?a=6&id=[+id+]" target="main"><i class="fa fa-trash fa-fw"></i></a> '; |
555 | - } else { |
|
559 | + } else { |
|
556 | 560 | $delete_btn = '<a onclick="return confirm(\'[%confirm_undelete%]\')" title="[%undelete_resource%]" href="index.php?a=63&id=[+id+]" target="main"><i class="fa fa-arrow-circle-o-up fa-fw"></i></a> '; |
557 | 561 | } |
558 | 562 | $ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn); |
559 | - } else { |
|
563 | + } else { |
|
560 | 564 | $ph['delete_btn'] = ''; |
561 | 565 | } |
562 | 566 | |
563 | - if ($ph['deleted'] == 1 && $ph['published'] == 0) { |
|
567 | + if ($ph['deleted'] == 1 && $ph['published'] == 0) { |
|
564 | 568 | $publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> '; |
565 | - } elseif ($ph['deleted'] == 1 && $ph['published'] == 1) { |
|
569 | + } elseif ($ph['deleted'] == 1 && $ph['published'] == 1) { |
|
566 | 570 | $publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> '; |
567 | - } elseif ($ph['deleted'] == 0 && $ph['published'] == 0) { |
|
571 | + } elseif ($ph['deleted'] == 0 && $ph['published'] == 0) { |
|
568 | 572 | $publish_btn = '<a title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> '; |
569 | - } else { |
|
573 | + } else { |
|
570 | 574 | $publish_btn = '<a title="[%unpublish_resource%]" href="index.php?a=62&id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> '; |
571 | 575 | } |
572 | 576 | $ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn); |
@@ -574,16 +578,16 @@ discard block |
||
574 | 578 | $ph['info_btn'] = str_replace('[+id+]', $docid, |
575 | 579 | '<a title="[%resource_overview%]" data-toggle="collapse" data-target=".collapse[+id+]"><i class="fa fa-info fa-fw"></i></a>'); |
576 | 580 | |
577 | - if ($ph['longtitle'] == '') { |
|
581 | + if ($ph['longtitle'] == '') { |
|
578 | 582 | $ph['longtitle'] = '(<i>[%not_set%]</i>)'; |
579 | 583 | } |
580 | - if ($ph['description'] == '') { |
|
584 | + if ($ph['description'] == '') { |
|
581 | 585 | $ph['description'] = '(<i>[%not_set%]</i>)'; |
582 | 586 | } |
583 | - if ($ph['introtext'] == '') { |
|
587 | + if ($ph['introtext'] == '') { |
|
584 | 588 | $ph['introtext'] = '(<i>[%not_set%]</i>)'; |
585 | 589 | } |
586 | - if ($ph['alias'] == '') { |
|
590 | + if ($ph['alias'] == '') { |
|
587 | 591 | $ph['alias'] = '(<i>[%not_set%]</i>)'; |
588 | 592 | } |
589 | 593 | |
@@ -594,9 +598,9 @@ discard block |
||
594 | 598 | } |
595 | 599 | } |
596 | 600 | |
597 | -if(!function_exists('getRecentInfoRowTpl')) { |
|
598 | - function getRecentInfoRowTpl() |
|
599 | - { |
|
601 | +if(!function_exists('getRecentInfoRowTpl')) { |
|
602 | + function getRecentInfoRowTpl() |
|
603 | + { |
|
600 | 604 | $tpl = ' |
601 | 605 | <tr> |
602 | 606 | <td data-toggle="collapse" data-target=".collapse[+id+]" class="text-right"><span class="label label-info">[+id+]</span></td> |
@@ -626,18 +630,18 @@ discard block |
||
626 | 630 | } |
627 | 631 | } |
628 | 632 | |
629 | -if(!function_exists('wrapIcon')) { |
|
633 | +if(!function_exists('wrapIcon')) { |
|
630 | 634 | // setup icons |
631 | - function wrapIcon($i, $action) |
|
632 | - { |
|
635 | + function wrapIcon($i, $action) |
|
636 | + { |
|
633 | 637 | return sprintf('<a href="index.php?a=%s" target="main"><span class="wm_button" style="border:0">%s</span></a>', |
634 | 638 | $action, $i); |
635 | 639 | } |
636 | 640 | } |
637 | 641 | |
638 | -if(!function_exists('getStartUpScript')) { |
|
639 | - function getStartUpScript() |
|
640 | - { |
|
642 | +if(!function_exists('getStartUpScript')) { |
|
643 | + function getStartUpScript() |
|
644 | + { |
|
641 | 645 | $script = ' |
642 | 646 | <script type="text/javascript"> |
643 | 647 | function hideConfigCheckWarning(key) { |
@@ -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,28 +1,28 @@ 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('logs')) { |
|
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 |
13 | 13 | * @return array |
14 | 14 | */ |
15 | - function array_unique_multi($array, $checkKey) |
|
16 | - { |
|
15 | + function array_unique_multi($array, $checkKey) |
|
16 | + { |
|
17 | 17 | // Use the builtin if we're not a multi-dimensional array |
18 | - if (!is_array(current($array)) || empty($checkKey)) { |
|
18 | + if (!is_array(current($array)) || empty($checkKey)) { |
|
19 | 19 | return array_unique($array); |
20 | 20 | } |
21 | 21 | |
22 | 22 | $ret = array(); |
23 | 23 | $checkValues = array(); // contains the unique key Values |
24 | - foreach ($array as $key => $current) { |
|
25 | - if (in_array($current[$checkKey], $checkValues)) { |
|
24 | + foreach ($array as $key => $current) { |
|
25 | + if (in_array($current[$checkKey], $checkValues)) { |
|
26 | 26 | continue; |
27 | 27 | } // duplicate |
28 | 28 | |
@@ -34,23 +34,23 @@ 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 |
41 | 41 | * @return array |
42 | 42 | */ |
43 | - function record_sort($array, $key) |
|
44 | - { |
|
43 | + function record_sort($array, $key) |
|
44 | + { |
|
45 | 45 | $hash = array(); |
46 | - foreach ($array as $k => $v) { |
|
46 | + foreach ($array as $k => $v) { |
|
47 | 47 | $hash[$k] = $v[$key]; |
48 | 48 | } |
49 | 49 | |
50 | 50 | natsort($hash); |
51 | 51 | |
52 | 52 | $records = array(); |
53 | - foreach ($hash as $k => $row) { |
|
53 | + foreach ($hash as $k => $row) { |
|
54 | 54 | $records[$k] = $array[$k]; |
55 | 55 | } |
56 | 56 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | <?php |
79 | 79 | // get all users currently in the log |
80 | 80 | $logs_user = record_sort(array_unique_multi($logs, 'internalKey'), 'username'); |
81 | - foreach ($logs_user as $row) { |
|
81 | + foreach ($logs_user as $row) { |
|
82 | 82 | $selectedtext = $row['internalKey'] == $_REQUEST['searchuser'] ? ' selected="selected"' : ''; |
83 | 83 | echo "\t\t" . '<option value="' . $row['internalKey'] . '"' . $selectedtext . '>' . $row['username'] . "</option>\n"; |
84 | 84 | } |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | // get all available actions in the log |
96 | 96 | include_once "actionlist.inc.php"; |
97 | 97 | $logs_actions = record_sort(array_unique_multi($logs, 'action'), 'action'); |
98 | - foreach ($logs_actions as $row) { |
|
98 | + foreach ($logs_actions as $row) { |
|
99 | 99 | $action = getAction($row['action']); |
100 | - if ($action == 'Idle') { |
|
100 | + if ($action == 'Idle') { |
|
101 | 101 | continue; |
102 | 102 | } |
103 | 103 | $selectedtext = $row['action'] == $_REQUEST['action'] ? ' selected="selected"' : ''; |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | <?php |
116 | 116 | // get all itemid currently in logging |
117 | 117 | $logs_items = record_sort(array_unique_multi($logs, 'itemid'), 'itemid'); |
118 | - foreach ($logs_items as $row) { |
|
118 | + foreach ($logs_items as $row) { |
|
119 | 119 | $selectedtext = $row['itemid'] == $_REQUEST['itemid'] ? ' selected="selected"' : ''; |
120 | 120 | echo "\t\t" . '<option value="' . $row['itemid'] . '"' . $selectedtext . '>' . $row['itemid'] . "</option>\n"; |
121 | 121 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | <?php |
132 | 132 | // get all itemname currently in logging |
133 | 133 | $logs_names = record_sort(array_unique_multi($logs, 'itemname'), 'itemname'); |
134 | - foreach ($logs_names as $row) { |
|
134 | + foreach ($logs_names as $row) { |
|
135 | 135 | $selectedtext = $row['itemname'] == $_REQUEST['itemname'] ? ' selected="selected"' : ''; |
136 | 136 | echo "\t\t" . '<option value="' . $row['itemname'] . '"' . $selectedtext . '>' . $row['itemname'] . "</option>\n"; |
137 | 137 | } |
@@ -187,36 +187,36 @@ discard block |
||
187 | 187 | <div class="container container-body"> |
188 | 188 | |
189 | 189 | <?php |
190 | -if (isset($_REQUEST['log_submit'])) { |
|
190 | +if (isset($_REQUEST['log_submit'])) { |
|
191 | 191 | // get the selections the user made. |
192 | 192 | $sqladd = array(); |
193 | - if ($_REQUEST['searchuser'] != 0) { |
|
193 | + if ($_REQUEST['searchuser'] != 0) { |
|
194 | 194 | $sqladd[] = "internalKey='" . (int)$_REQUEST['searchuser'] . "'"; |
195 | 195 | } |
196 | - if ($_REQUEST['action'] != 0) { |
|
196 | + if ($_REQUEST['action'] != 0) { |
|
197 | 197 | $sqladd[] = "action=" . (int)$_REQUEST['action']; |
198 | 198 | } |
199 | - if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") { |
|
199 | + if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") { |
|
200 | 200 | $sqladd[] = "itemid='" . $_REQUEST['itemid'] . "'"; |
201 | 201 | } |
202 | - if ($_REQUEST['itemname'] != '0') { |
|
202 | + if ($_REQUEST['itemname'] != '0') { |
|
203 | 203 | $sqladd[] = "itemname='" . $modx->db->escape($_REQUEST['itemname']) . "'"; |
204 | 204 | } |
205 | - if ($_REQUEST['message'] != "") { |
|
205 | + if ($_REQUEST['message'] != "") { |
|
206 | 206 | $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'"; |
207 | 207 | } |
208 | 208 | // date stuff |
209 | - if ($_REQUEST['datefrom'] != "") { |
|
209 | + if ($_REQUEST['datefrom'] != "") { |
|
210 | 210 | $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']); |
211 | 211 | } |
212 | - if ($_REQUEST['dateto'] != "") { |
|
212 | + if ($_REQUEST['dateto'] != "") { |
|
213 | 213 | $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']); |
214 | 214 | } |
215 | 215 | |
216 | 216 | // If current position is not set, set it to zero |
217 | - if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { |
|
217 | + if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { |
|
218 | 218 | $int_cur_position = 0; |
219 | - } else { |
|
219 | + } else { |
|
220 | 220 | $int_cur_position = $_REQUEST['int_cur_position']; |
221 | 221 | } |
222 | 222 | |
@@ -230,9 +230,9 @@ discard block |
||
230 | 230 | |
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 | -if ($limit < 1) { |
|
233 | +if ($limit < 1) { |
|
234 | 234 | echo '<p>' . $_lang["mgrlog_emptysrch"] . '</p>'; |
235 | -} else { |
|
235 | +} else { |
|
236 | 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 |
@@ -250,14 +250,14 @@ discard block |
||
250 | 250 | $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? "</a> " : " "); |
251 | 251 | $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? "</a> " : " "); |
252 | 252 | $pagesfound = sizeof($array_row_paging); |
253 | - if ($pagesfound > 6) { |
|
253 | + if ($pagesfound > 6) { |
|
254 | 254 | $paging .= $array_row_paging[$current_row - 2]; // ." "; |
255 | 255 | $paging .= $array_row_paging[$current_row - 1]; // ." "; |
256 | 256 | $paging .= $array_row_paging[$current_row]; // ." "; |
257 | 257 | $paging .= $array_row_paging[$current_row + 1]; // ." "; |
258 | 258 | $paging .= $array_row_paging[$current_row + 2]; // ." "; |
259 | - } else { |
|
260 | - for ($i = 0; $i < $pagesfound; $i++) { |
|
259 | + } else { |
|
260 | + for ($i = 0; $i < $pagesfound; $i++) { |
|
261 | 261 | $paging .= $array_row_paging[$i] . " "; |
262 | 262 | } |
263 | 263 | } |
@@ -294,12 +294,12 @@ discard block |
||
294 | 294 | // grab the entire log file... |
295 | 295 | $logentries = array(); |
296 | 296 | $i = 0; |
297 | - while ($logentry = $modx->db->getRow($rs)) { |
|
298 | - if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { |
|
297 | + while ($logentry = $modx->db->getRow($rs)) { |
|
298 | + if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { |
|
299 | 299 | $item = '<div style="text-align:center;">-</div>'; |
300 | - } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { |
|
300 | + } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { |
|
301 | 301 | $item = '<a href="index.php?a=3&id=' . $logentry['itemid'] . '">' . $logentry['itemname'] . '</a>'; |
302 | - } else { |
|
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' |
@@ -336,6 +336,6 @@ discard block |
||
336 | 336 | // @see index.php @ 915 |
337 | 337 | global $action; |
338 | 338 | $action = 1; |
339 | -} else { |
|
339 | +} else { |
|
340 | 340 | echo $_lang["mgrlog_noquery"]; |
341 | 341 | } |
@@ -1,21 +1,21 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
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 | switch((int) $modx->manager->action) { |
7 | - case 35: |
|
8 | - if(!$modx->hasPermission('edit_role')) { |
|
9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | - } |
|
11 | - break; |
|
12 | - case 38: |
|
13 | - if(!$modx->hasPermission('new_role')) { |
|
14 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | - } |
|
16 | - break; |
|
17 | - default: |
|
18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | + case 35: |
|
8 | + if(!$modx->hasPermission('edit_role')) { |
|
9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | + } |
|
11 | + break; |
|
12 | + case 38: |
|
13 | + if(!$modx->hasPermission('new_role')) { |
|
14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | + } |
|
16 | + break; |
|
17 | + default: |
|
18 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | $role = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | // check to see the snippet editor isn't locked |
26 | 26 | if($lockedEl = $modx->elementIsLocked(8, $role)) { |
27 | - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['role'])); |
|
27 | + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['role'])); |
|
28 | 28 | } |
29 | 29 | // end check for lock |
30 | 30 | |
@@ -32,15 +32,15 @@ discard block |
||
32 | 32 | $modx->lockElement(8, $role); |
33 | 33 | |
34 | 34 | if($modx->manager->action == '35') { |
35 | - $rs = $modx->db->select('*', $tbl_user_roles, "id='{$role}'"); |
|
36 | - $roledata = $modx->db->getRow($rs); |
|
37 | - if(!$roledata) { |
|
38 | - $modx->webAlertAndQuit("No role returned!"); |
|
39 | - } |
|
40 | - $_SESSION['itemname'] = $roledata['name']; |
|
35 | + $rs = $modx->db->select('*', $tbl_user_roles, "id='{$role}'"); |
|
36 | + $roledata = $modx->db->getRow($rs); |
|
37 | + if(!$roledata) { |
|
38 | + $modx->webAlertAndQuit("No role returned!"); |
|
39 | + } |
|
40 | + $_SESSION['itemname'] = $roledata['name']; |
|
41 | 41 | } else { |
42 | - $roledata = 0; |
|
43 | - $_SESSION['itemname'] = $_lang["new_role"]; |
|
42 | + $roledata = 0; |
|
43 | + $_SESSION['itemname'] = $_lang["new_role"]; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | // Add lock-element JS-Script |
@@ -107,63 +107,63 @@ discard block |
||
107 | 107 | <div class="form-group"> |
108 | 108 | <h3><?= $_lang['page_data_general'] ?></h3> |
109 | 109 | <?php |
110 | - echo render_form('frames', $_lang['role_frames'], 'disabled'); |
|
111 | - echo render_form('home', $_lang['role_home'], 'disabled'); |
|
112 | - echo render_form('messages', $_lang['role_messages']); |
|
113 | - echo render_form('logout', $_lang['role_logout'], 'disabled'); |
|
114 | - echo render_form('help', $_lang['role_help']); |
|
115 | - echo render_form('action_ok', $_lang['role_actionok'], 'disabled'); |
|
116 | - echo render_form('error_dialog', $_lang['role_errors'], 'disabled'); |
|
117 | - echo render_form('about', $_lang['role_about'], 'disabled'); |
|
118 | - echo render_form('credits', $_lang['role_credits'], 'disabled'); |
|
119 | - echo render_form('change_password', $_lang['role_change_password']); |
|
120 | - echo render_form('save_password', $_lang['role_save_password']); |
|
121 | - ?> |
|
110 | + echo render_form('frames', $_lang['role_frames'], 'disabled'); |
|
111 | + echo render_form('home', $_lang['role_home'], 'disabled'); |
|
112 | + echo render_form('messages', $_lang['role_messages']); |
|
113 | + echo render_form('logout', $_lang['role_logout'], 'disabled'); |
|
114 | + echo render_form('help', $_lang['role_help']); |
|
115 | + echo render_form('action_ok', $_lang['role_actionok'], 'disabled'); |
|
116 | + echo render_form('error_dialog', $_lang['role_errors'], 'disabled'); |
|
117 | + echo render_form('about', $_lang['role_about'], 'disabled'); |
|
118 | + echo render_form('credits', $_lang['role_credits'], 'disabled'); |
|
119 | + echo render_form('change_password', $_lang['role_change_password']); |
|
120 | + echo render_form('save_password', $_lang['role_save_password']); |
|
121 | + ?> |
|
122 | 122 | </div> |
123 | 123 | </div> |
124 | 124 | <div class="col-sm-6 col-lg-3"> |
125 | 125 | <div class="form-group"> |
126 | 126 | <h3><?= $_lang['role_content_management'] ?></h3> |
127 | 127 | <?php |
128 | - echo render_form('view_document', $_lang['role_view_docdata'], 'disabled'); |
|
129 | - echo render_form('new_document', $_lang['role_create_doc']); |
|
130 | - echo render_form('edit_document', $_lang['role_edit_doc']); |
|
131 | - echo render_form('change_resourcetype', $_lang['role_change_resourcetype']); |
|
132 | - echo render_form('save_document', $_lang['role_save_doc']); |
|
133 | - echo render_form('publish_document', $_lang['role_publish_doc']); |
|
134 | - echo render_form('delete_document', $_lang['role_delete_doc']); |
|
135 | - echo render_form('empty_trash', $_lang['role_empty_trash']); |
|
136 | - echo render_form('empty_cache', $_lang['role_cache_refresh']); |
|
137 | - echo render_form('view_unpublished', $_lang['role_view_unpublished']); |
|
138 | - ?> |
|
128 | + echo render_form('view_document', $_lang['role_view_docdata'], 'disabled'); |
|
129 | + echo render_form('new_document', $_lang['role_create_doc']); |
|
130 | + echo render_form('edit_document', $_lang['role_edit_doc']); |
|
131 | + echo render_form('change_resourcetype', $_lang['role_change_resourcetype']); |
|
132 | + echo render_form('save_document', $_lang['role_save_doc']); |
|
133 | + echo render_form('publish_document', $_lang['role_publish_doc']); |
|
134 | + echo render_form('delete_document', $_lang['role_delete_doc']); |
|
135 | + echo render_form('empty_trash', $_lang['role_empty_trash']); |
|
136 | + echo render_form('empty_cache', $_lang['role_cache_refresh']); |
|
137 | + echo render_form('view_unpublished', $_lang['role_view_unpublished']); |
|
138 | + ?> |
|
139 | 139 | </div> |
140 | 140 | </div> |
141 | 141 | <div class="col-sm-6 col-lg-3 form-group"> |
142 | 142 | <div class="form-group"> |
143 | 143 | <h3><?= $_lang['role_file_management'] ?></h3> |
144 | 144 | <?php |
145 | - echo render_form('file_manager', $_lang['role_file_manager']); |
|
146 | - echo render_form('assets_files', $_lang['role_assets_files']); |
|
147 | - echo render_form('assets_images', $_lang['role_assets_images']); |
|
148 | - ?> |
|
145 | + echo render_form('file_manager', $_lang['role_file_manager']); |
|
146 | + echo render_form('assets_files', $_lang['role_assets_files']); |
|
147 | + echo render_form('assets_images', $_lang['role_assets_images']); |
|
148 | + ?> |
|
149 | 149 | </div> |
150 | 150 | <div class="form-group"> |
151 | 151 | <h3><?= $_lang['category_management'] ?></h3> |
152 | 152 | <?php |
153 | - echo render_form('category_manager', $_lang['role_category_manager']); |
|
154 | - ?> |
|
153 | + echo render_form('category_manager', $_lang['role_category_manager']); |
|
154 | + ?> |
|
155 | 155 | </div> |
156 | 156 | </div> |
157 | 157 | <div class="col-sm-6 col-lg-3"> |
158 | 158 | <div class="form-group"> |
159 | 159 | <h3><?= $_lang['role_module_management'] ?></h3> |
160 | 160 | <?php |
161 | - echo render_form('new_module', $_lang['role_new_module']); |
|
162 | - echo render_form('edit_module', $_lang['role_edit_module']); |
|
163 | - echo render_form('save_module', $_lang['role_save_module']); |
|
164 | - echo render_form('delete_module', $_lang['role_delete_module']); |
|
165 | - echo render_form('exec_module', $_lang['role_run_module']); |
|
166 | - ?> |
|
161 | + echo render_form('new_module', $_lang['role_new_module']); |
|
162 | + echo render_form('edit_module', $_lang['role_edit_module']); |
|
163 | + echo render_form('save_module', $_lang['role_save_module']); |
|
164 | + echo render_form('delete_module', $_lang['role_delete_module']); |
|
165 | + echo render_form('exec_module', $_lang['role_run_module']); |
|
166 | + ?> |
|
167 | 167 | </div> |
168 | 168 | </div> |
169 | 169 | </div> |
@@ -173,44 +173,44 @@ discard block |
||
173 | 173 | <div class="form-group"> |
174 | 174 | <h3><?= $_lang['role_template_management'] ?></h3> |
175 | 175 | <?php |
176 | - echo render_form('new_template', $_lang['role_create_template']); |
|
177 | - echo render_form('edit_template', $_lang['role_edit_template']); |
|
178 | - echo render_form('save_template', $_lang['role_save_template']); |
|
179 | - echo render_form('delete_template', $_lang['role_delete_template']); |
|
180 | - ?> |
|
176 | + echo render_form('new_template', $_lang['role_create_template']); |
|
177 | + echo render_form('edit_template', $_lang['role_edit_template']); |
|
178 | + echo render_form('save_template', $_lang['role_save_template']); |
|
179 | + echo render_form('delete_template', $_lang['role_delete_template']); |
|
180 | + ?> |
|
181 | 181 | </div> |
182 | 182 | </div> |
183 | 183 | <div class="col-sm-6 col-lg-3"> |
184 | 184 | <div class="form-group"> |
185 | 185 | <h3><?= $_lang['role_snippet_management'] ?></h3> |
186 | 186 | <?php |
187 | - echo render_form('new_snippet', $_lang['role_create_snippet']); |
|
188 | - echo render_form('edit_snippet', $_lang['role_edit_snippet']); |
|
189 | - echo render_form('save_snippet', $_lang['role_save_snippet']); |
|
190 | - echo render_form('delete_snippet', $_lang['role_delete_snippet']); |
|
191 | - ?> |
|
187 | + echo render_form('new_snippet', $_lang['role_create_snippet']); |
|
188 | + echo render_form('edit_snippet', $_lang['role_edit_snippet']); |
|
189 | + echo render_form('save_snippet', $_lang['role_save_snippet']); |
|
190 | + echo render_form('delete_snippet', $_lang['role_delete_snippet']); |
|
191 | + ?> |
|
192 | 192 | </div> |
193 | 193 | </div> |
194 | 194 | <div class="col-sm-6 col-lg-3"> |
195 | 195 | <div class="form-group"> |
196 | 196 | <h3><?= $_lang['role_chunk_management'] ?></h3> |
197 | 197 | <?php |
198 | - echo render_form('new_chunk', $_lang['role_create_chunk']); |
|
199 | - echo render_form('edit_chunk', $_lang['role_edit_chunk']); |
|
200 | - echo render_form('save_chunk', $_lang['role_save_chunk']); |
|
201 | - echo render_form('delete_chunk', $_lang['role_delete_chunk']); |
|
202 | - ?> |
|
198 | + echo render_form('new_chunk', $_lang['role_create_chunk']); |
|
199 | + echo render_form('edit_chunk', $_lang['role_edit_chunk']); |
|
200 | + echo render_form('save_chunk', $_lang['role_save_chunk']); |
|
201 | + echo render_form('delete_chunk', $_lang['role_delete_chunk']); |
|
202 | + ?> |
|
203 | 203 | </div> |
204 | 204 | </div> |
205 | 205 | <div class="col-sm-6 col-lg-3"> |
206 | 206 | <div class="form-group"> |
207 | 207 | <h3><?= $_lang['role_plugin_management'] ?></h3> |
208 | 208 | <?php |
209 | - echo render_form('new_plugin', $_lang['role_create_plugin']); |
|
210 | - echo render_form('edit_plugin', $_lang['role_edit_plugin']); |
|
211 | - echo render_form('save_plugin', $_lang['role_save_plugin']); |
|
212 | - echo render_form('delete_plugin', $_lang['role_delete_plugin']); |
|
213 | - ?> |
|
209 | + echo render_form('new_plugin', $_lang['role_create_plugin']); |
|
210 | + echo render_form('edit_plugin', $_lang['role_edit_plugin']); |
|
211 | + echo render_form('save_plugin', $_lang['role_save_plugin']); |
|
212 | + echo render_form('delete_plugin', $_lang['role_delete_plugin']); |
|
213 | + ?> |
|
214 | 214 | </div> |
215 | 215 | </div> |
216 | 216 | </div> |
@@ -220,42 +220,42 @@ discard block |
||
220 | 220 | <div class="form-group"> |
221 | 221 | <h3><?= $_lang['role_user_management'] ?></h3> |
222 | 222 | <?php |
223 | - echo render_form('new_user', $_lang['role_new_user']); |
|
224 | - echo render_form('edit_user', $_lang['role_edit_user']); |
|
225 | - echo render_form('save_user', $_lang['role_save_user']); |
|
226 | - echo render_form('delete_user', $_lang['role_delete_user']); |
|
227 | - ?> |
|
223 | + echo render_form('new_user', $_lang['role_new_user']); |
|
224 | + echo render_form('edit_user', $_lang['role_edit_user']); |
|
225 | + echo render_form('save_user', $_lang['role_save_user']); |
|
226 | + echo render_form('delete_user', $_lang['role_delete_user']); |
|
227 | + ?> |
|
228 | 228 | </div> |
229 | 229 | </div> |
230 | 230 | <div class="col-sm-6 col-lg-3"> |
231 | 231 | <div class="form-group"> |
232 | 232 | <h3><?= $_lang['role_web_user_management'] ?></h3> |
233 | 233 | <?php |
234 | - echo render_form('new_web_user', $_lang['role_new_web_user']); |
|
235 | - echo render_form('edit_web_user', $_lang['role_edit_web_user']); |
|
236 | - echo render_form('save_web_user', $_lang['role_save_web_user']); |
|
237 | - echo render_form('delete_web_user', $_lang['role_delete_web_user']); |
|
238 | - ?> |
|
234 | + echo render_form('new_web_user', $_lang['role_new_web_user']); |
|
235 | + echo render_form('edit_web_user', $_lang['role_edit_web_user']); |
|
236 | + echo render_form('save_web_user', $_lang['role_save_web_user']); |
|
237 | + echo render_form('delete_web_user', $_lang['role_delete_web_user']); |
|
238 | + ?> |
|
239 | 239 | </div> |
240 | 240 | </div> |
241 | 241 | <div class="col-sm-6 col-lg-3"> |
242 | 242 | <div class="form-group"> |
243 | 243 | <h3><?= $_lang['role_udperms'] ?></h3> |
244 | 244 | <?php |
245 | - echo render_form('access_permissions', $_lang['role_access_persmissions']); |
|
246 | - echo render_form('web_access_permissions', $_lang['role_web_access_persmissions']); |
|
247 | - ?> |
|
245 | + echo render_form('access_permissions', $_lang['role_access_persmissions']); |
|
246 | + echo render_form('web_access_permissions', $_lang['role_web_access_persmissions']); |
|
247 | + ?> |
|
248 | 248 | </div> |
249 | 249 | </div> |
250 | 250 | <div class="col-sm-6 col-lg-3"> |
251 | 251 | <div class="form-group"> |
252 | 252 | <h3><?= $_lang['role_role_management'] ?></h3> |
253 | 253 | <?php |
254 | - echo render_form('new_role', $_lang['role_new_role']); |
|
255 | - echo render_form('edit_role', $_lang['role_edit_role']); |
|
256 | - echo render_form('save_role', $_lang['role_save_role']); |
|
257 | - echo render_form('delete_role', $_lang['role_delete_role']); |
|
258 | - ?> |
|
254 | + echo render_form('new_role', $_lang['role_new_role']); |
|
255 | + echo render_form('edit_role', $_lang['role_edit_role']); |
|
256 | + echo render_form('save_role', $_lang['role_save_role']); |
|
257 | + echo render_form('delete_role', $_lang['role_delete_role']); |
|
258 | + ?> |
|
259 | 259 | </div> |
260 | 260 | </div> |
261 | 261 | </div> |
@@ -265,23 +265,23 @@ discard block |
||
265 | 265 | <div class="form-group"> |
266 | 266 | <h3><?= $_lang['role_eventlog_management'] ?></h3> |
267 | 267 | <?php |
268 | - echo render_form('view_eventlog', $_lang['role_view_eventlog']); |
|
269 | - echo render_form('delete_eventlog', $_lang['role_delete_eventlog']); |
|
270 | - ?> |
|
268 | + echo render_form('view_eventlog', $_lang['role_view_eventlog']); |
|
269 | + echo render_form('delete_eventlog', $_lang['role_delete_eventlog']); |
|
270 | + ?> |
|
271 | 271 | </div> |
272 | 272 | </div> |
273 | 273 | <div class="col-sm-6 col-lg-3"> |
274 | 274 | <div class="form-group"> |
275 | 275 | <h3><?= $_lang['role_config_management'] ?></h3> |
276 | 276 | <?php |
277 | - echo render_form('logs', $_lang['role_view_logs']); |
|
278 | - echo render_form('settings', $_lang['role_edit_settings']); |
|
279 | - echo render_form('bk_manager', $_lang['role_bk_manager']); |
|
280 | - echo render_form('import_static', $_lang['role_import_static']); |
|
281 | - echo render_form('export_static', $_lang['role_export_static']); |
|
282 | - echo render_form('remove_locks', $_lang['role_remove_locks']); |
|
283 | - echo render_form('display_locks', $_lang['role_display_locks']); |
|
284 | - ?> |
|
277 | + echo render_form('logs', $_lang['role_view_logs']); |
|
278 | + echo render_form('settings', $_lang['role_edit_settings']); |
|
279 | + echo render_form('bk_manager', $_lang['role_bk_manager']); |
|
280 | + echo render_form('import_static', $_lang['role_import_static']); |
|
281 | + echo render_form('export_static', $_lang['role_export_static']); |
|
282 | + echo render_form('remove_locks', $_lang['role_remove_locks']); |
|
283 | + echo render_form('display_locks', $_lang['role_display_locks']); |
|
284 | + ?> |
|
285 | 285 | </div> |
286 | 286 | </div> |
287 | 287 | </div> |
@@ -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(!function_exists('get_lang_keys')) { |
|
2 | +if(!function_exists('get_lang_keys')) { |
|
3 | 3 | /** |
4 | 4 | * get_lang_keys |
5 | 5 | * |
6 | 6 | * @param string $filename |
7 | 7 | * @return array of keys from a language file |
8 | 8 | */ |
9 | - function get_lang_keys($filename) |
|
10 | - { |
|
9 | + function get_lang_keys($filename) |
|
10 | + { |
|
11 | 11 | $file = MODX_MANAGER_PATH . 'includes/lang' . DIRECTORY_SEPARATOR . $filename; |
12 | - if (is_file($file) && is_readable($file)) { |
|
12 | + if (is_file($file) && is_readable($file)) { |
|
13 | 13 | include($file); |
14 | 14 | $out = isset($_lang) ? array_keys($_lang) : array(); |
15 | - } else { |
|
15 | + } else { |
|
16 | 16 | $out = array(); |
17 | 17 | } |
18 | 18 | |
@@ -20,19 +20,19 @@ 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 | * |
27 | 27 | * @param string $key |
28 | 28 | * @return array of languages that define the key in their file |
29 | 29 | */ |
30 | - function get_langs_by_key($key) |
|
31 | - { |
|
30 | + function get_langs_by_key($key) |
|
31 | + { |
|
32 | 32 | global $lang_keys; |
33 | 33 | $lang_return = array(); |
34 | - foreach ($lang_keys as $lang => $keys) { |
|
35 | - if (in_array($key, $keys)) { |
|
34 | + foreach ($lang_keys as $lang => $keys) { |
|
35 | + if (in_array($key, $keys)) { |
|
36 | 36 | $lang_return[] = $lang; |
37 | 37 | } |
38 | 38 | } |
@@ -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 | * |
@@ -51,25 +51,25 @@ discard block |
||
51 | 51 | * @param string $selected_lang specify language to select in option list, default none |
52 | 52 | * @return string html option list |
53 | 53 | */ |
54 | - function get_lang_options($key = '', $selected_lang = '') |
|
55 | - { |
|
54 | + function get_lang_options($key = '', $selected_lang = '') |
|
55 | + { |
|
56 | 56 | global $lang_keys, $_lang; |
57 | 57 | $lang_options = ''; |
58 | - if (!empty($key)) { |
|
58 | + if (!empty($key)) { |
|
59 | 59 | $languages = get_langs_by_key($key); |
60 | 60 | sort($languages); |
61 | 61 | $lang_options .= '<option value="">' . $_lang['language_title'] . '</option>'; |
62 | 62 | |
63 | - foreach ($languages as $language_name) { |
|
63 | + foreach ($languages as $language_name) { |
|
64 | 64 | $uclanguage_name = ucwords(str_replace("_", " ", $language_name)); |
65 | 65 | $lang_options .= '<option value="' . $language_name . '">' . $uclanguage_name . '</option>'; |
66 | 66 | } |
67 | 67 | |
68 | 68 | return $lang_options; |
69 | - } else { |
|
69 | + } else { |
|
70 | 70 | $languages = array_keys($lang_keys); |
71 | 71 | sort($languages); |
72 | - foreach ($languages as $language_name) { |
|
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 | 75 | $lang_options .= '<option value="' . $language_name . '" ' . $sel . '>' . $uclanguage_name . '</option>'; |
@@ -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 |
@@ -88,17 +88,17 @@ discard block |
||
88 | 88 | * @param bool $disabled |
89 | 89 | * @return string |
90 | 90 | */ |
91 | - function form_radio($name, $value, $add = '', $disabled = false) |
|
92 | - { |
|
91 | + function form_radio($name, $value, $add = '', $disabled = false) |
|
92 | + { |
|
93 | 93 | global ${$name}; |
94 | 94 | $var = ${$name}; |
95 | 95 | $checked = ($var == $value) ? ' checked="checked"' : ''; |
96 | - if ($disabled) { |
|
96 | + if ($disabled) { |
|
97 | 97 | $disabled = ' disabled'; |
98 | - } else { |
|
98 | + } else { |
|
99 | 99 | $disabled = ''; |
100 | 100 | } |
101 | - if ($add) { |
|
101 | + if ($add) { |
|
102 | 102 | $add = ' ' . $add; |
103 | 103 | } |
104 | 104 | |
@@ -108,31 +108,31 @@ 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 |
115 | 115 | * @return string |
116 | 116 | */ |
117 | - function wrap_label($str = '', $object) |
|
118 | - { |
|
117 | + function wrap_label($str = '', $object) |
|
118 | + { |
|
119 | 119 | return "<label>{$object}\n{$str}</label>"; |
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 |
127 | 127 | * @return string |
128 | 128 | */ |
129 | - function parseText($tpl = '', $ph = array()) |
|
130 | - { |
|
131 | - if (empty($ph) || empty($tpl)) { |
|
129 | + function parseText($tpl = '', $ph = array()) |
|
130 | + { |
|
131 | + if (empty($ph) || empty($tpl)) { |
|
132 | 132 | return $tpl; |
133 | 133 | } |
134 | 134 | |
135 | - foreach ($ph as $k => $v) { |
|
135 | + foreach ($ph as $k => $v) { |
|
136 | 136 | $k = "[+{$k}+]"; |
137 | 137 | $tpl = str_replace($k, $v, $tpl); |
138 | 138 | } |
@@ -141,13 +141,13 @@ 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 |
148 | 148 | */ |
149 | - function showHide($cond = true) |
|
150 | - { |
|
149 | + function showHide($cond = true) |
|
150 | + { |
|
151 | 151 | global $displayStyle; |
152 | 152 | $showHide = $cond ? $displayStyle : 'none'; |
153 | 153 |