@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | } |
13 | 13 | |
14 | 14 | // check if user has access permission, except admins |
15 | -if($_SESSION['mgrRole']!=1){ |
|
15 | +if($_SESSION['mgrRole']!=1) { |
|
16 | 16 | $rs = $modx->db->select( |
17 | 17 | 'sma.usergroup,mg.member', |
18 | 18 | $modx->getFullTableName("site_module_access")." sma |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | |
63 | 63 | $output = evalModule($content["modulecode"],$parameter); |
64 | -if ( (int)$_GET['api'] != 1){ |
|
64 | +if ( (int)$_GET['api'] != 1) { |
|
65 | 65 | echo "<style>body,html {overflow:auto!important;height:100%!important}</style>"; // for iframe scroller |
66 | 66 | } |
67 | 67 | echo $output; |
@@ -74,7 +74,8 @@ discard block |
||
74 | 74 | * @param array $params |
75 | 75 | * @return string |
76 | 76 | */ |
77 | -function evalModule($moduleCode,$params){ |
|
77 | +function evalModule($moduleCode,$params) |
|
78 | +{ |
|
78 | 79 | global $modx; |
79 | 80 | $modx->event->params = &$params; // store params inside event object |
80 | 81 | if(is_array($params)) { |
@@ -84,11 +85,9 @@ discard block |
||
84 | 85 | $mod = eval($moduleCode); |
85 | 86 | $msg = ob_get_contents(); |
86 | 87 | ob_end_clean(); |
87 | - if (isset($php_errormsg)) |
|
88 | - { |
|
88 | + if (isset($php_errormsg)) { |
|
89 | 89 | $error_info = error_get_last(); |
90 | - switch($error_info['type']) |
|
91 | - { |
|
90 | + switch($error_info['type']) { |
|
92 | 91 | case E_NOTICE : |
93 | 92 | $error_level = 1; |
94 | 93 | case E_USER_NOTICE : |
@@ -101,8 +100,7 @@ discard block |
||
101 | 100 | default: |
102 | 101 | $error_level = 99; |
103 | 102 | } |
104 | - if($modx->config['error_reporting']==='99' || 2<$error_level) |
|
105 | - { |
|
103 | + if($modx->config['error_reporting']==='99' || 2<$error_level) { |
|
106 | 104 | $modx->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], $_SESSION['itemname'] . ' - Module', $error_info['message'], $error_info['line'], $msg); |
107 | 105 | $modx->event->alert("An error occurred while loading. Please see the event log for more information<p>{$msg}</p>"); |
108 | 106 | } |