@@ -46,7 +46,8 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | function getParents($id, $path = '') |
49 | - { // modx:returns child's parent |
|
49 | + { |
|
50 | +// modx:returns child's parent |
|
50 | 51 | global $modx; |
51 | 52 | if (empty($this->aliases)) { |
52 | 53 | $f = "id, IF(alias='', id, alias) AS alias, parent, alias_visible"; |
@@ -403,7 +404,8 @@ discard block |
||
403 | 404 | $_ = trim($_); |
404 | 405 | } |
405 | 406 | $lastChar = substr($_, -1); |
406 | - if (!in_array($lastChar, $chars)) {// ,320,327,288,284,289 |
|
407 | + if (!in_array($lastChar, $chars)) { |
|
408 | +// ,320,327,288,284,289 |
|
407 | 409 | if (!in_array($prev_token, array(T_FOREACH, T_WHILE, T_FOR, T_BOOLEAN_AND, T_BOOLEAN_OR, T_DOUBLE_ARROW))) { |
408 | 410 | $_ .= ' '; |
409 | 411 | } |
@@ -349,7 +349,8 @@ discard block |
||
349 | 349 | } |
350 | 350 | |
351 | 351 | // Send an email to the user |
352 | -function sendMailMessage($email, $uid, $pwd, $ufn) { |
|
352 | +function sendMailMessage($email, $uid, $pwd, $ufn) |
|
353 | +{ |
|
353 | 354 | global $modx, $_lang, $signupemail_message; |
354 | 355 | global $emailsubject, $emailsender; |
355 | 356 | global $site_name; |
@@ -378,7 +379,8 @@ discard block |
||
378 | 379 | } |
379 | 380 | |
380 | 381 | // Save User Settings |
381 | -function saveUserSettings($id) { |
|
382 | +function saveUserSettings($id) |
|
383 | +{ |
|
382 | 384 | global $modx; |
383 | 385 | $tbl_user_settings = $modx->getFullTableName('user_settings'); |
384 | 386 | |
@@ -462,7 +464,8 @@ discard block |
||
462 | 464 | } |
463 | 465 | |
464 | 466 | // Web alert - sends an alert to web browser |
465 | -function webAlertAndQuit($msg) { |
|
467 | +function webAlertAndQuit($msg) |
|
468 | +{ |
|
466 | 469 | global $id, $modx; |
467 | 470 | $mode = $_POST['mode']; |
468 | 471 | $modx->manager->saveFormValues($mode); |
@@ -470,7 +473,8 @@ discard block |
||
470 | 473 | } |
471 | 474 | |
472 | 475 | // Generate password |
473 | -function generate_password($length = 10) { |
|
476 | +function generate_password($length = 10) |
|
477 | +{ |
|
474 | 478 | $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; |
475 | 479 | $ps_len = strlen($allowable_characters); |
476 | 480 | mt_srand((double) microtime() * 1000000); |
@@ -17,20 +17,24 @@ |
||
17 | 17 | $pth = str_replace("\\","/",$pth); |
18 | 18 | if(isset($_GET["rminstall"])) { |
19 | 19 | if(is_dir($pth)) { |
20 | - if(!rmdirRecursive($pth)) $msg="An error occured while attempting to remove the install folder"; |
|
20 | + if(!rmdirRecursive($pth)) { |
|
21 | + $msg="An error occured while attempting to remove the install folder"; |
|
22 | + } |
|
21 | 23 | } |
22 | 24 | } |
23 | -if($msg) echo "<script>alert('".addslashes($msg)."');</script>"; |
|
25 | +if($msg) { |
|
26 | + echo "<script>alert('".addslashes($msg)."');</script>"; |
|
27 | +} |
|
24 | 28 | echo "<script>window.location='../index.php?a=2';</script>"; |
25 | 29 | |
26 | 30 | // rmdirRecursive - detects symbollic links on unix |
27 | -function rmdirRecursive($path,$followLinks=false) { |
|
31 | +function rmdirRecursive($path,$followLinks=false) |
|
32 | +{ |
|
28 | 33 | $dir = opendir($path) ; |
29 | - while ($entry = readdir($dir)) { |
|
34 | + while ($entry = readdir($dir)) { |
|
30 | 35 | if (is_file("$path/$entry") || ((!$followLinks) && is_link("$path/$entry"))) { |
31 | 36 | @unlink( "$path/$entry" ); |
32 | - } |
|
33 | - elseif (is_dir("$path/$entry") && $entry!='.' && $entry!='..') { |
|
37 | + } elseif (is_dir("$path/$entry") && $entry!='.' && $entry!='..') { |
|
34 | 38 | rmdirRecursive("$path/$entry"); // recursive |
35 | 39 | } |
36 | 40 | } |
@@ -335,7 +335,8 @@ discard block |
||
335 | 335 | } |
336 | 336 | |
337 | 337 | // in case any plugins include a quoted_printable function |
338 | -function save_user_quoted_printable($string) { |
|
338 | +function save_user_quoted_printable($string) |
|
339 | +{ |
|
339 | 340 | $crlf = "\n"; |
340 | 341 | $string = preg_replace('!(\r\n|\r|\n)!', $crlf, $string) . $crlf; |
341 | 342 | $f[] = '/([\000-\010\013\014\016-\037\075\177-\377])/e'; |
@@ -347,7 +348,8 @@ discard block |
||
347 | 348 | } |
348 | 349 | |
349 | 350 | // Send an email to the user |
350 | -function sendMailMessage($email, $uid, $pwd, $ufn) { |
|
351 | +function sendMailMessage($email, $uid, $pwd, $ufn) |
|
352 | +{ |
|
351 | 353 | global $modx, $_lang, $websignupemail_message; |
352 | 354 | global $emailsubject, $emailsender; |
353 | 355 | global $site_name, $site_url; |
@@ -375,7 +377,8 @@ discard block |
||
375 | 377 | } |
376 | 378 | |
377 | 379 | // Save User Settings |
378 | -function saveUserSettings($id) { |
|
380 | +function saveUserSettings($id) |
|
381 | +{ |
|
379 | 382 | global $modx; |
380 | 383 | $tbl_web_user_settings = $modx->getFullTableName('web_user_settings'); |
381 | 384 | |
@@ -404,7 +407,8 @@ discard block |
||
404 | 407 | } |
405 | 408 | |
406 | 409 | // Web alert - sends an alert to web browser |
407 | -function webAlertAndQuit($msg) { |
|
410 | +function webAlertAndQuit($msg) |
|
411 | +{ |
|
408 | 412 | global $id, $modx; |
409 | 413 | $mode = $_POST['mode']; |
410 | 414 | $modx->manager->saveFormValues($mode); |
@@ -412,7 +416,8 @@ discard block |
||
412 | 416 | } |
413 | 417 | |
414 | 418 | // Generate password |
415 | -function generate_password($length = 10) { |
|
419 | +function generate_password($length = 10) |
|
420 | +{ |
|
416 | 421 | $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; |
417 | 422 | $ps_len = strlen($allowable_characters); |
418 | 423 | mt_srand((double) microtime() * 1000000); |
@@ -423,7 +428,8 @@ discard block |
||
423 | 428 | return $pass; |
424 | 429 | } |
425 | 430 | |
426 | -function sanitize($str = '', $safecount = 0) { |
|
431 | +function sanitize($str = '', $safecount = 0) |
|
432 | +{ |
|
427 | 433 | global $modx; |
428 | 434 | $safecount++; |
429 | 435 | if(1000 < $safecount) { |
@@ -292,7 +292,8 @@ discard block |
||
292 | 292 | } |
293 | 293 | |
294 | 294 | // show javascript alert |
295 | -function jsAlert($msg) { |
|
295 | +function jsAlert($msg) |
|
296 | +{ |
|
296 | 297 | global $modx; |
297 | 298 | if($_POST['ajax'] != 1) { |
298 | 299 | echo "<script>window.setTimeout(\"alert('" . addslashes($modx->db->escape($msg)) . "')\",10);history.go(-1)</script>"; |
@@ -301,12 +302,14 @@ discard block |
||
301 | 302 | } |
302 | 303 | } |
303 | 304 | |
304 | -function login($username, $givenPassword, $dbasePassword) { |
|
305 | +function login($username, $givenPassword, $dbasePassword) |
|
306 | +{ |
|
305 | 307 | global $modx; |
306 | 308 | return $modx->phpass->CheckPassword($givenPassword, $dbasePassword); |
307 | 309 | } |
308 | 310 | |
309 | -function loginV1($internalKey, $givenPassword, $dbasePassword, $username) { |
|
311 | +function loginV1($internalKey, $givenPassword, $dbasePassword, $username) |
|
312 | +{ |
|
310 | 313 | global $modx; |
311 | 314 | |
312 | 315 | $user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey); |
@@ -329,7 +332,8 @@ discard block |
||
329 | 332 | return true; |
330 | 333 | } |
331 | 334 | |
332 | -function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) { |
|
335 | +function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) |
|
336 | +{ |
|
333 | 337 | global $modx; |
334 | 338 | |
335 | 339 | if($dbasePassword != md5($givenPassword)) { |
@@ -339,7 +343,8 @@ discard block |
||
339 | 343 | return true; |
340 | 344 | } |
341 | 345 | |
342 | -function updateNewHash($username, $password) { |
|
346 | +function updateNewHash($username, $password) |
|
347 | +{ |
|
343 | 348 | global $modx; |
344 | 349 | |
345 | 350 | $field = array(); |
@@ -347,16 +352,19 @@ discard block |
||
347 | 352 | $modx->db->update($field, '[+prefix+]manager_users', "username='{$username}'"); |
348 | 353 | } |
349 | 354 | |
350 | -function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) { |
|
355 | +function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) |
|
356 | +{ |
|
351 | 357 | global $modx; |
352 | 358 | |
353 | 359 | $failedlogins += 1; |
354 | 360 | |
355 | 361 | $fields = array('failedlogincount' => $failedlogins); |
356 | - if($failedlogins >= $failed_allowed) //block user for too many fail attempts |
|
362 | + if($failedlogins >= $failed_allowed) { |
|
363 | + //block user for too many fail attempts |
|
357 | 364 | { |
358 | 365 | $fields['blockeduntil'] = time() + ($blocked_minutes * 60); |
359 | 366 | } |
367 | + } |
|
360 | 368 | |
361 | 369 | $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'"); |
362 | 370 |
@@ -10,7 +10,8 @@ discard block |
||
10 | 10 | * @param $theme |
11 | 11 | * @param string $hereid |
12 | 12 | */ |
13 | -function makeHTML($indent, $parent, $expandAll, $theme, $hereid = '') { |
|
13 | +function makeHTML($indent, $parent, $expandAll, $theme, $hereid = '') |
|
14 | +{ |
|
14 | 15 | global $modx; |
15 | 16 | global $icons, $iconsPrivate, $_style; |
16 | 17 | global $_lang, $opened, $opened2, $closed2; //added global vars |
@@ -450,7 +451,8 @@ discard block |
||
450 | 451 | return $output; |
451 | 452 | } |
452 | 453 | |
453 | -function getIconInfo($_style) { |
|
454 | +function getIconInfo($_style) |
|
455 | +{ |
|
454 | 456 | if(!isset($_style['tree_page_gif'])) { |
455 | 457 | $_style['tree_page_gif'] = $_style['tree_page']; |
456 | 458 | } |
@@ -477,7 +479,8 @@ discard block |
||
477 | 479 | return $icons; |
478 | 480 | } |
479 | 481 | |
480 | -function getPrivateIconInfo($_style) { |
|
482 | +function getPrivateIconInfo($_style) |
|
483 | +{ |
|
481 | 484 | if(!isset($_style['tree_page_gif_secure'])) { |
482 | 485 | $_style['tree_page_gif_secure'] = $_style['tree_page_secure']; |
483 | 486 | } |
@@ -504,7 +507,8 @@ discard block |
||
504 | 507 | return $iconsPrivate; |
505 | 508 | } |
506 | 509 | |
507 | -function getNodeTitle($nodeNameSource, $row) { |
|
510 | +function getNodeTitle($nodeNameSource, $row) |
|
511 | +{ |
|
508 | 512 | global $modx; |
509 | 513 | |
510 | 514 | switch($nodeNameSource) { |
@@ -550,7 +554,8 @@ discard block |
||
550 | 554 | return $nodetitle; |
551 | 555 | } |
552 | 556 | |
553 | -function isDateNode($nodeNameSource) { |
|
557 | +function isDateNode($nodeNameSource) |
|
558 | +{ |
|
554 | 559 | switch($nodeNameSource) { |
555 | 560 | case 'createdon': |
556 | 561 | case 'editedon': |
@@ -563,13 +568,15 @@ discard block |
||
563 | 568 | } |
564 | 569 | } |
565 | 570 | |
566 | -function checkIsFolder($parent = 0, $isfolder = 1) { |
|
571 | +function checkIsFolder($parent = 0, $isfolder = 1) |
|
572 | +{ |
|
567 | 573 | global $modx; |
568 | 574 | |
569 | 575 | return (int) $modx->db->getValue($modx->db->query('SELECT count(*) FROM ' . $modx->getFullTableName('site_content') . ' WHERE parent=' . $parent . ' AND isfolder=' . $isfolder . ' ')); |
570 | 576 | } |
571 | 577 | |
572 | -function _htmlentities($array) { |
|
578 | +function _htmlentities($array) |
|
579 | +{ |
|
573 | 580 | global $modx; |
574 | 581 | |
575 | 582 | $array = json_encode($array, JSON_UNESCAPED_UNICODE); |
@@ -578,7 +585,8 @@ discard block |
||
578 | 585 | return $array; |
579 | 586 | } |
580 | 587 | |
581 | -function getTplSingleNode() { |
|
588 | +function getTplSingleNode() |
|
589 | +{ |
|
582 | 590 | return '<div id="node[+id+]"><a class="[+treeNodeClass+]" |
583 | 591 | onclick="modx.tree.treeAction(event,[+id+]);" |
584 | 592 | oncontextmenu="modx.tree.showPopup(event,[+id+],\'[+nodetitle_esc+]\');" |
@@ -602,7 +610,8 @@ discard block |
||
602 | 610 | title="[+title+]">[+nodetitleDisplay+][+weblinkDisplay+]</span>[+pageIdDisplay+]</a></div>'; |
603 | 611 | } |
604 | 612 | |
605 | -function getTplFolderNode() { |
|
613 | +function getTplFolderNode() |
|
614 | +{ |
|
606 | 615 | return '<div id="node[+id+]"><a class="[+treeNodeClass+]" |
607 | 616 | onclick="modx.tree.treeAction(event,[+id+]);" |
608 | 617 | oncontextmenu="modx.tree.showPopup(event,[+id+],\'[+nodetitle_esc+]\');" |
@@ -638,7 +647,8 @@ discard block |
||
638 | 647 | title="[+title+]">[+nodetitleDisplay+][+weblinkDisplay+]</span>[+pageIdDisplay+]</a><div>'; |
639 | 648 | } |
640 | 649 | |
641 | -function getTplFolderNodeNotChildren() { |
|
650 | +function getTplFolderNodeNotChildren() |
|
651 | +{ |
|
642 | 652 | return '<div id="node[+id+]"><a class="[+treeNodeClass+]" |
643 | 653 | onclick="modx.tree.treeAction(event,[+id+]);" |
644 | 654 | oncontextmenu="modx.tree.showPopup(event,[+id+],\'[+nodetitle_esc+]\');" |
@@ -670,7 +680,8 @@ discard block |
||
670 | 680 | title="[+title+]">[+nodetitleDisplay+][+weblinkDisplay+]</span>[+pageIdDisplay+]</a><div>'; |
671 | 681 | } |
672 | 682 | |
673 | -function dbug($str, $flag = false) { |
|
683 | +function dbug($str, $flag = false) |
|
684 | +{ |
|
674 | 685 | print('<pre>'); |
675 | 686 | print_r($str); |
676 | 687 | print('</pre>'); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | 'active' |
33 | 33 | ); |
34 | 34 | |
35 | -if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) { |
|
35 | +if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) { |
|
36 | 36 | $sitemenu['elements'] = array( |
37 | 37 | 'elements', |
38 | 38 | 'main', |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | ); |
49 | 49 | } |
50 | 50 | |
51 | -if($modx->hasPermission('exec_module')) { |
|
51 | +if($modx->hasPermission('exec_module')) { |
|
52 | 52 | $sitemenu['modules'] = array( |
53 | 53 | 'modules', |
54 | 54 | 'main', |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | ); |
65 | 65 | } |
66 | 66 | |
67 | -if($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) { |
|
67 | +if($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) { |
|
68 | 68 | $sitemenu['users'] = array( |
69 | 69 | 'users', |
70 | 70 | 'main', |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | ); |
81 | 81 | } |
82 | 82 | |
83 | -if($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) { |
|
83 | +if($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) { |
|
84 | 84 | $sitemenu['tools'] = array( |
85 | 85 | 'tools', |
86 | 86 | 'main', |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | $tab = 0; |
100 | -if($modx->hasPermission('edit_template')) { |
|
100 | +if($modx->hasPermission('edit_template')) { |
|
101 | 101 | $sitemenu['element_templates'] = array( |
102 | 102 | 'element_templates', |
103 | 103 | 'elements', |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | 'dropdown-toggle' |
113 | 113 | ); |
114 | 114 | } |
115 | -if($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
|
115 | +if($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
|
116 | 116 | $sitemenu['element_tplvars'] = array( |
117 | 117 | 'element_tplvars', |
118 | 118 | 'elements', |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | 'dropdown-toggle' |
128 | 128 | ); |
129 | 129 | } |
130 | -if($modx->hasPermission('edit_chunk')) { |
|
130 | +if($modx->hasPermission('edit_chunk')) { |
|
131 | 131 | $sitemenu['element_htmlsnippets'] = array( |
132 | 132 | 'element_htmlsnippets', |
133 | 133 | 'elements', |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | 'dropdown-toggle' |
143 | 143 | ); |
144 | 144 | } |
145 | -if($modx->hasPermission('edit_snippet')) { |
|
145 | +if($modx->hasPermission('edit_snippet')) { |
|
146 | 146 | $sitemenu['element_snippets'] = array( |
147 | 147 | 'element_snippets', |
148 | 148 | 'elements', |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | 'dropdown-toggle' |
158 | 158 | ); |
159 | 159 | } |
160 | -if($modx->hasPermission('edit_plugin')) { |
|
160 | +if($modx->hasPermission('edit_plugin')) { |
|
161 | 161 | $sitemenu['element_plugins'] = array( |
162 | 162 | 'element_plugins', |
163 | 163 | 'elements', |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | } |
175 | 175 | //$sitemenu['element_categories'] = array('element_categories','elements',$_lang['element_categories'],'index.php?a=76&tab=5',$_lang['element_categories'],'','new_template,edit_template,new_snippet,edit_snippet,new_chunk,edit_chunk,new_plugin,edit_plugin','main',1,60,''); |
176 | 176 | |
177 | -if($modx->hasPermission('file_manager')) { |
|
177 | +if($modx->hasPermission('file_manager')) { |
|
178 | 178 | $sitemenu['manage_files'] = array( |
179 | 179 | 'manage_files', |
180 | 180 | 'elements', |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | '' |
190 | 190 | ); |
191 | 191 | } |
192 | -if($modx->hasPermission('category_manager')) { |
|
192 | +if($modx->hasPermission('category_manager')) { |
|
193 | 193 | $sitemenu['manage_categories'] = array( |
194 | 194 | 'manage_categories', |
195 | 195 | 'elements', |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | } |
207 | 207 | |
208 | 208 | // Modules Menu Items |
209 | -if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) { |
|
209 | +if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) { |
|
210 | 210 | $sitemenu['new_module'] = array( |
211 | 211 | 'new_module', |
212 | 212 | 'modules', |
@@ -222,19 +222,19 @@ discard block |
||
222 | 222 | ); |
223 | 223 | } |
224 | 224 | |
225 | -if($modx->hasPermission('exec_module')) { |
|
226 | - if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
225 | +if($modx->hasPermission('exec_module')) { |
|
226 | + if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
227 | 227 | $rs = $modx->db->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member |
228 | 228 | FROM ' . $modx->getFullTableName('site_modules') . ' AS sm |
229 | 229 | LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id |
230 | 230 | LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group |
231 | 231 | WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
232 | 232 | ORDER BY sm.name'); |
233 | - } else { |
|
233 | + } else { |
|
234 | 234 | $rs = $modx->db->select('*', $modx->getFullTableName('site_modules'), 'disabled != 1', 'name'); |
235 | 235 | } |
236 | - if($modx->db->getRecordCount($rs)) { |
|
237 | - while ($row = $modx->db->getRow($rs)) { |
|
236 | + if($modx->db->getRecordCount($rs)) { |
|
237 | + while ($row = $modx->db->getRow($rs)) { |
|
238 | 238 | $sitemenu['module' . $row['id']] = array( |
239 | 239 | 'module' . $row['id'], |
240 | 240 | 'modules', |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | |
255 | 255 | // security menu items (users) |
256 | 256 | |
257 | -if($modx->hasPermission('edit_user')) { |
|
257 | +if($modx->hasPermission('edit_user')) { |
|
258 | 258 | $sitemenu['user_management_title'] = array( |
259 | 259 | 'user_management_title', |
260 | 260 | 'users', |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | ); |
271 | 271 | } |
272 | 272 | |
273 | -if($modx->hasPermission('edit_web_user')) { |
|
273 | +if($modx->hasPermission('edit_web_user')) { |
|
274 | 274 | $sitemenu['web_user_management_title'] = array( |
275 | 275 | 'web_user_management_title', |
276 | 276 | 'users', |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | ); |
287 | 287 | } |
288 | 288 | |
289 | -if($modx->hasPermission('edit_role')) { |
|
289 | +if($modx->hasPermission('edit_role')) { |
|
290 | 290 | $sitemenu['role_management_title'] = array( |
291 | 291 | 'role_management_title', |
292 | 292 | 'users', |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | ); |
303 | 303 | } |
304 | 304 | |
305 | -if($modx->hasPermission('access_permissions')) { |
|
305 | +if($modx->hasPermission('access_permissions')) { |
|
306 | 306 | $sitemenu['manager_permissions'] = array( |
307 | 307 | 'manager_permissions', |
308 | 308 | 'users', |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | ); |
319 | 319 | } |
320 | 320 | |
321 | -if($modx->hasPermission('web_access_permissions')) { |
|
321 | +if($modx->hasPermission('web_access_permissions')) { |
|
322 | 322 | $sitemenu['web_permissions'] = array( |
323 | 323 | 'web_permissions', |
324 | 324 | 'users', |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | '' |
375 | 375 | ); |
376 | 376 | |
377 | -if($modx->hasPermission('bk_manager')) { |
|
377 | +if($modx->hasPermission('bk_manager')) { |
|
378 | 378 | $sitemenu['bk_manager'] = array( |
379 | 379 | 'bk_manager', |
380 | 380 | 'tools', |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | ); |
391 | 391 | } |
392 | 392 | |
393 | -if($modx->hasPermission('remove_locks')) { |
|
393 | +if($modx->hasPermission('remove_locks')) { |
|
394 | 394 | $sitemenu['remove_locks'] = array( |
395 | 395 | 'remove_locks', |
396 | 396 | 'tools', |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | ); |
407 | 407 | } |
408 | 408 | |
409 | -if($modx->hasPermission('import_static')) { |
|
409 | +if($modx->hasPermission('import_static')) { |
|
410 | 410 | $sitemenu['import_site'] = array( |
411 | 411 | 'import_site', |
412 | 412 | 'tools', |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | ); |
423 | 423 | } |
424 | 424 | |
425 | -if($modx->hasPermission('export_static')) { |
|
425 | +if($modx->hasPermission('export_static')) { |
|
426 | 426 | $sitemenu['export_site'] = array( |
427 | 427 | 'export_site', |
428 | 428 | 'tools', |
@@ -439,19 +439,21 @@ discard block |
||
439 | 439 | } |
440 | 440 | |
441 | 441 | $menu = $modx->invokeEvent("OnManagerMenuPrerender", array('menu' => $sitemenu)); |
442 | -if(is_array($menu)) { |
|
442 | +if(is_array($menu)) { |
|
443 | 443 | $newmenu = array(); |
444 | - foreach($menu as $item){ |
|
445 | - if(is_array(unserialize($item))){ |
|
444 | + foreach($menu as $item) { |
|
445 | + if(is_array(unserialize($item))) { |
|
446 | 446 | $newmenu = array_merge($newmenu, unserialize($item)); |
447 | 447 | } |
448 | 448 | } |
449 | - if(count($newmenu)> 0) $sitemenu = $newmenu; |
|
450 | -} |
|
449 | + if(count($newmenu)> 0) { |
|
450 | + $sitemenu = $newmenu; |
|
451 | + } |
|
452 | + } |
|
451 | 453 | |
452 | -if(file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) { |
|
454 | +if(file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) { |
|
453 | 455 | include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php'); |
454 | -} else { |
|
456 | +} else { |
|
455 | 457 | include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php'); |
456 | 458 | } |
457 | 459 | $menu = new EVOmenu(); |
@@ -1,10 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -class DATEPICKER { |
|
4 | - function __construct() { |
|
3 | +class DATEPICKER |
|
4 | +{ |
|
5 | + function __construct() |
|
6 | + { |
|
5 | 7 | } |
6 | 8 | |
7 | - function getDP() { |
|
9 | + function getDP() |
|
10 | + { |
|
8 | 11 | global $modx, $_lang; |
9 | 12 | |
10 | 13 | $tpl = file_get_contents(dirname(__FILE__) . '/datepicker.tpl'); |
@@ -12,17 +12,20 @@ |
||
12 | 12 | * @link http://kcfinder.sunhater.com |
13 | 13 | */ |
14 | 14 | |
15 | -class type_img { |
|
15 | +class type_img |
|
16 | +{ |
|
16 | 17 | |
17 | - public function checkFile($file, array $config) { |
|
18 | + public function checkFile($file, array $config) |
|
19 | + { |
|
18 | 20 | |
19 | 21 | $driver = isset($config['imageDriversPriority']) |
20 | 22 | ? image::getDriver(explode(" ", $config['imageDriversPriority'])) : "gd"; |
21 | 23 | |
22 | 24 | $img = image::factory($driver, $file); |
23 | 25 | |
24 | - if ($img->initError) |
|
25 | - return "Unknown image format/encoding."; |
|
26 | + if ($img->initError) { |
|
27 | + return "Unknown image format/encoding."; |
|
28 | + } |
|
26 | 29 | |
27 | 30 | return true; |
28 | 31 | } |