Completed
Push — develop ( 923a1c...1e9876 )
by Maxim
47s queued 29s
created
manager/includes/sysalert.display.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 	$sysMsgs = "";
14 14
 	$limit = count($SystemAlertMsgQueque);
15
-	for($i=0;$i<$limit;$i++) {
15
+	for ($i = 0; $i < $limit; $i++) {
16 16
 		$sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>";
17 17
 	}
18 18
 	// reset message queque
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	$_SESSION['SystemAlertMsgQueque'] = array();
21 21
 	$SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
22 22
 
23
-	if($sysMsgs!="") {
23
+	if ($sysMsgs != "") {
24 24
 ?>
25 25
 
26 26
 <?php // fetch the styles
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 			var sysAlert = new Element('div').setProperties({
33 33
 				'class': 'sysAlert'
34 34
 			});
35
-			sysAlert.innerHTML = '<?php echo $modx->db->escape($sysMsgs);?>';
35
+			sysAlert.innerHTML = '<?php echo $modx->db->escape($sysMsgs); ?>';
36 36
 			var boxHtml = new MooPrompt('<?php echo $_lang['sys_alert']; ?>', sysAlert, {
37 37
 				buttons: 1,
38 38
 				button1: 'Ok',
Please login to merge, or discard this patch.
manager/includes/paginate.inc.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
 class Paging
32 32
 {
33 33
 
34
-    var $int_num_result;  // Number of result to show per page (decided by user)
35
-    var $int_nbr_row;     // Total number of items (SQL count from db)
36
-    var $int_cur_position;// Current position in recordset
37
-    var $str_ext_argv;    // Extra argv of query string
34
+    var $int_num_result; // Number of result to show per page (decided by user)
35
+    var $int_nbr_row; // Total number of items (SQL count from db)
36
+    var $int_cur_position; // Current position in recordset
37
+    var $str_ext_argv; // Extra argv of query string
38 38
 
39 39
     // ------------------------------------------------------------------------ Constructor
40 40
     //
@@ -64,14 +64,14 @@  discard block
 block discarded – undo
64 64
         $array_paging['total'] = $this->int_nbr_row;
65 65
 
66 66
         if ($this->int_cur_position != 0) {
67
-            $array_paging['first_link'] = "<a href=\"$PHP_SELF?int_cur_position=0" . $this->str_ext_argv . "\">";
68
-            $array_paging['previous_link'] = "<a href=\"$PHP_SELF?int_cur_position=" . ($this->int_cur_position - $this->int_num_result) . $this->str_ext_argv . "\">";
67
+            $array_paging['first_link'] = "<a href=\"$PHP_SELF?int_cur_position=0".$this->str_ext_argv."\">";
68
+            $array_paging['previous_link'] = "<a href=\"$PHP_SELF?int_cur_position=".($this->int_cur_position - $this->int_num_result).$this->str_ext_argv."\">";
69 69
         }
70 70
 
71 71
         if (($this->int_nbr_row - $this->int_cur_position) > $this->int_num_result) {
72 72
             $int_new_position = $this->int_cur_position + $this->int_num_result;
73
-            $array_paging['last_link'] = "<a href=\"$PHP_SELF?int_cur_position=" . $this->int_nbr_row . $this->str_ext_argv . "\">";
74
-            $array_paging['next_link'] = "<a href=\"$PHP_SELF?int_cur_position=$int_new_position" . $this->str_ext_argv . "\">";
73
+            $array_paging['last_link'] = "<a href=\"$PHP_SELF?int_cur_position=".$this->int_nbr_row.$this->str_ext_argv."\">";
74
+            $array_paging['next_link'] = "<a href=\"$PHP_SELF?int_cur_position=$int_new_position".$this->str_ext_argv."\">";
75 75
         }
76 76
         return $array_paging;
77 77
     } // end function
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
         for ($i = 0; $i < $this->getNumberOfPage(); $i++) {
87 87
             // if current page, do not make a link
88 88
             if ($i == $this->getCurrentPage()) {
89
-                $array_all_page[$i] = "<b>" . ($i + 1) . "</b>&nbsp;";
89
+                $array_all_page[$i] = "<b>".($i + 1)."</b>&nbsp;";
90 90
             } else {
91 91
                 $int_new_position = ($i * $this->int_num_result);
92
-                $array_all_page[$i] = "<a href=\"" . $PHP_SELF . "?int_cur_position=$int_new_position$this->str_ext_argv\">" . ($i + 1) . "</a>&nbsp;";
92
+                $array_all_page[$i] = "<a href=\"".$PHP_SELF."?int_cur_position=$int_new_position$this->str_ext_argv\">".($i + 1)."</a>&nbsp;";
93 93
             }
94 94
         }
95 95
         return $array_all_page;
Please login to merge, or discard this patch.
manager/includes/active_user_locks.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,13 +12,13 @@
 block discarded – undo
12 12
 $modx->invokeEvent('OnManagerPageInit');
13 13
 $ok = false;
14 14
 
15
-if($modx->elementIsLocked($_GET['type'], $_GET['id'], true)) {
15
+if ($modx->elementIsLocked($_GET['type'], $_GET['id'], true)) {
16 16
     $modx->lockElement($_GET['type'], $_GET['id'], true);
17 17
     $ok = true;
18 18
 }
19 19
 
20 20
 header('Content-type: application/json');
21
-if($ok) {
21
+if ($ok) {
22 22
     echo '{status:"ok"}';
23 23
 } else {
24 24
   echo '{status:"null"}';
Please login to merge, or discard this patch.
manager/includes/log.class.inc.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -12,24 +12,24 @@  discard block
 block discarded – undo
12 12
 
13 13
 */
14 14
 
15
-class logHandler {
15
+class logHandler{
16 16
     // Single variable for a log entry
17 17
     var $entry = array();
18 18
 
19
-    function initAndWriteLog($msg="", $internalKey="", $username="", $action="", $itemid="", $itemname="") {
19
+    function initAndWriteLog($msg = "", $internalKey = "", $username = "", $action = "", $itemid = "", $itemname = ""){
20 20
         global $modx;
21 21
         $this->entry['msg'] = $msg; // writes testmessage to the object
22
-        $this->entry['action'] = empty($action)? $modx->manager->action : $action;    // writes the action to the object
22
+        $this->entry['action'] = empty($action) ? $modx->manager->action : $action; // writes the action to the object
23 23
 
24 24
         // User Credentials
25 25
         $this->entry['internalKey'] = $internalKey == "" ? $modx->getLoginUserID() : $internalKey;
26 26
         $this->entry['username'] = $username == "" ? $modx->getLoginUserName() : $username;
27 27
 
28
-        $this->entry['itemId'] = (empty($itemid) && isset($_REQUEST['id'])) ? (int)$_REQUEST['id'] : $itemid;  // writes the id to the object
29
-        if($this->entry['itemId'] == 0) $this->entry['itemId'] = "-"; // to stop items having id 0
28
+        $this->entry['itemId'] = (empty($itemid) && isset($_REQUEST['id'])) ? (int) $_REQUEST['id'] : $itemid; // writes the id to the object
29
+        if ($this->entry['itemId'] == 0) $this->entry['itemId'] = "-"; // to stop items having id 0
30 30
 
31
-        $this->entry['itemName'] = ($itemname == "" && isset($_SESSION['itemname']))? $_SESSION['itemname'] : $itemname; // writes the id to the object
32
-        if($this->entry['itemName'] == "") $this->entry['itemName'] = "-"; // to stop item name being empty
31
+        $this->entry['itemName'] = ($itemname == "" && isset($_SESSION['itemname'])) ? $_SESSION['itemname'] : $itemname; // writes the id to the object
32
+        if ($this->entry['itemName'] == "") $this->entry['itemName'] = "-"; // to stop item name being empty
33 33
 
34 34
         $this->writeToLog();
35 35
         return;
@@ -38,20 +38,20 @@  discard block
 block discarded – undo
38 38
     // function to write to the log
39 39
     // collects all required info, and
40 40
     // writes it to the logging table
41
-    function writeToLog() {
41
+    function writeToLog(){
42 42
         global $modx;
43 43
         $tbl_manager_log = $modx->getFullTableName('manager_log');
44 44
         
45
-        if($this->entry['internalKey'] == "") {
45
+        if ($this->entry['internalKey'] == "") {
46 46
             $modx->webAlertAndQuit("Logging error: internalKey not set.");
47 47
         }
48
-        if(empty($this->entry['action'])) {
48
+        if (empty($this->entry['action'])) {
49 49
             $modx->webAlertAndQuit("Logging error: action not set.");
50 50
         }
51
-        if($this->entry['msg'] == "") {
51
+        if ($this->entry['msg'] == "") {
52 52
             include_once "actionlist.inc.php";
53 53
             $this->entry['msg'] = getAction($this->entry['action'], $this->entry['itemId']);
54
-            if($this->entry['msg'] == "") {
54
+            if ($this->entry['msg'] == "") {
55 55
                 $modx->webAlertAndQuit("Logging error: couldn't find message to write to log.");
56 56
             }
57 57
         }
@@ -63,14 +63,14 @@  discard block
 block discarded – undo
63 63
         $fields['itemid']      = $this->entry['itemId'];
64 64
         $fields['itemname']    = $modx->db->escape($this->entry['itemName']);
65 65
         $fields['message']     = $modx->db->escape($this->entry['msg']);
66
-        $insert_id = $modx->db->insert($fields,$tbl_manager_log);
67
-        if(!$insert_id) {
66
+        $insert_id = $modx->db->insert($fields, $tbl_manager_log);
67
+        if (!$insert_id) {
68 68
             $modx->messageQuit("Logging error: couldn't save log to table! Error code: ".$modx->db->getLastError());
69 69
         } else {
70 70
             $limit = (isset($modx->config['manager_log_limit'])) ? intval($modx->config['manager_log_limit']) : 3000;
71
-            $trim  = (isset($modx->config['manager_log_trim']))  ? intval($modx->config['manager_log_trim']) : 100;
72
-            if(($insert_id % $trim) === 0) {
73
-                $modx->rotate_log('manager_log',$limit,$trim);
71
+            $trim  = (isset($modx->config['manager_log_trim'])) ? intval($modx->config['manager_log_trim']) : 100;
72
+            if (($insert_id % $trim) === 0) {
73
+                $modx->rotate_log('manager_log', $limit, $trim);
74 74
             }
75 75
         }
76 76
     }
Please login to merge, or discard this patch.
manager/includes/config_check.inc.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
2
+if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3 3
 
4 4
 // PROCESSOR FIRST
5
-if($_SESSION['mgrRole'] == 1) {
6
-	if($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) {
5
+if ($_SESSION['mgrRole'] == 1) {
6
+	if ($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) {
7 7
 		$current = $modx->manager->getSystemChecksum($modx->config['check_files_onlogin']);
8
-		if(!empty($current)) {
8
+		if (!empty($current)) {
9 9
 			$modx->manager->setSystemChecksum($current);
10 10
 			$modx->clearCache('full');
11 11
 			$modx->config['sys_files_checksum'] = $current;
@@ -17,14 +17,14 @@  discard block
 block discarded – undo
17 17
 $warningspresent = 0;
18 18
 
19 19
 $sysfiles_check = $modx->manager->checkSystemChecksum();
20
-if ($sysfiles_check!=='0'){
20
+if ($sysfiles_check !== '0') {
21 21
       $warningspresent = 1;
22 22
       $warnings[] = array($_lang['configcheck_sysfiles_mod']);
23 23
 }
24 24
 
25
-if (is_writable("includes/config.inc.php")){
25
+if (is_writable("includes/config.inc.php")) {
26 26
     // Warn if world writable
27
-    if(@fileperms('includes/config.inc.php') & 0x0002) {
27
+    if (@fileperms('includes/config.inc.php') & 0x0002) {
28 28
       $warningspresent = 1;
29 29
       $warnings[] = array($_lang['configcheck_configinc']);
30 30
     }
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
     $warnings[] = array($_lang['configcheck_php_gdzip']);
41 41
 }
42 42
 
43
-if(!isset($modx->config['_hide_configcheck_validate_referer']) || $modx->config['_hide_configcheck_validate_referer'] !== '1') {
44
-    if(isset($_SESSION['mgrPermissions']['settings']) && $_SESSION['mgrPermissions']['settings'] == '1') {
43
+if (!isset($modx->config['_hide_configcheck_validate_referer']) || $modx->config['_hide_configcheck_validate_referer'] !== '1') {
44
+    if (isset($_SESSION['mgrPermissions']['settings']) && $_SESSION['mgrPermissions']['settings'] == '1') {
45 45
         if ($modx->db->getValue($modx->db->select('COUNT(setting_value)', $modx->getFullTableName('system_settings'), "setting_name='validate_referer' AND setting_value='0'"))) {
46 46
             $warningspresent = 1;
47 47
             $warnings[] = array($_lang['configcheck_validate_referer']);
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 }
51 51
 
52 52
 // check for Template Switcher plugin
53
-if(!isset($modx->config['_hide_configcheck_templateswitcher_present']) || $modx->config['_hide_configcheck_templateswitcher_present'] !== '1') {
54
-    if(isset($_SESSION['mgrPermissions']['edit_plugin']) && $_SESSION['mgrPermissions']['edit_plugin'] == '1') {
53
+if (!isset($modx->config['_hide_configcheck_templateswitcher_present']) || $modx->config['_hide_configcheck_templateswitcher_present'] !== '1') {
54
+    if (isset($_SESSION['mgrPermissions']['edit_plugin']) && $_SESSION['mgrPermissions']['edit_plugin'] == '1') {
55 55
         $rs = $modx->db->select('name, disabled', $modx->getFullTableName('site_plugins'), "name IN ('TemplateSwitcher', 'Template Switcher', 'templateswitcher', 'template_switcher', 'template switcher') OR plugincode LIKE '%TemplateSwitcher%'");
56 56
         $row = $modx->db->getRow($rs);
57
-        if($row && $row['disabled'] == 0) {
57
+        if ($row && $row['disabled'] == 0) {
58 58
             $warningspresent = 1;
59 59
             $warnings[] = array($_lang['configcheck_templateswitcher_present']);
60 60
             $tplName = $row['name'];
@@ -115,36 +115,36 @@  discard block
 block discarded – undo
115 115
 }
116 116
 
117 117
 if (!function_exists('checkSiteCache')) {
118
-    function checkSiteCache() {
118
+    function checkSiteCache(){
119 119
         global $modx;
120
-        $checked= true;
121
-        if (file_exists($modx->config['base_path'] . 'assets/cache/siteCache.idx.php')) {
122
-            $checked= @include_once ($modx->config['base_path'] . 'assets/cache/siteCache.idx.php');
120
+        $checked = true;
121
+        if (file_exists($modx->config['base_path'].'assets/cache/siteCache.idx.php')) {
122
+            $checked = @include_once ($modx->config['base_path'].'assets/cache/siteCache.idx.php');
123 123
         }
124 124
         return $checked;
125 125
     }
126 126
 }
127 127
 
128
-if (!is_writable(MODX_BASE_PATH . "assets/cache/")) {
128
+if (!is_writable(MODX_BASE_PATH."assets/cache/")) {
129 129
     $warningspresent = 1;
130 130
     $warnings[] = array($_lang['configcheck_cache']);
131 131
 }
132 132
 
133 133
 if (!checkSiteCache()) {
134 134
     $warningspresent = 1;
135
-    $warnings[]= array($lang['configcheck_sitecache_integrity']);
135
+    $warnings[] = array($lang['configcheck_sitecache_integrity']);
136 136
 }
137 137
 
138
-if (!is_writable(MODX_BASE_PATH . "assets/images/")) {
138
+if (!is_writable(MODX_BASE_PATH."assets/images/")) {
139 139
     $warningspresent = 1;
140 140
     $warnings[] = array($_lang['configcheck_images']);
141 141
 }
142 142
 
143
-if(strpos($modx->config['rb_base_dir'],MODX_BASE_PATH)!==0) {
143
+if (strpos($modx->config['rb_base_dir'], MODX_BASE_PATH) !== 0) {
144 144
     $warningspresent = 1;
145 145
     $warnings[] = array($_lang['configcheck_rb_base_dir']);
146 146
 }
147
-if(strpos($modx->config['filemanager_path'],MODX_BASE_PATH)!==0) {
147
+if (strpos($modx->config['filemanager_path'], MODX_BASE_PATH) !== 0) {
148 148
     $warningspresent = 1;
149 149
     $warnings[] = array($_lang['configcheck_filemanager_path']);
150 150
 }
@@ -152,36 +152,36 @@  discard block
 block discarded – undo
152 152
 // clear file info cache
153 153
 clearstatcache();
154 154
 
155
-if ($warningspresent==1) {
155
+if ($warningspresent == 1) {
156 156
 
157
-if(!isset($modx->config['send_errormail'])) $modx->config['send_errormail']='3';
157
+if (!isset($modx->config['send_errormail'])) $modx->config['send_errormail'] = '3';
158 158
 $config_check_results = "<h3>".$_lang['configcheck_notok']."</h3>";
159 159
 
160
-for ($i=0;$i<count($warnings);$i++) {
160
+for ($i = 0; $i < count($warnings); $i++) {
161 161
     switch ($warnings[$i][0]) {
162 162
         case $_lang['configcheck_configinc'];
163 163
             $warnings[$i][1] = $_lang['configcheck_configinc_msg'];
164
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_configinc']);
164
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1], $_lang['configcheck_configinc']);
165 165
             break;
166 166
         case $_lang['configcheck_installer'] :
167 167
             $warnings[$i][1] = $_lang['configcheck_installer_msg'];
168
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_installer']);
168
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1], $_lang['configcheck_installer']);
169 169
             break;
170 170
         case $_lang['configcheck_cache'] :
171 171
             $warnings[$i][1] = $_lang['configcheck_cache_msg'];
172
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_cache']);
172
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 2, $warnings[$i][1], $_lang['configcheck_cache']);
173 173
             break;
174 174
         case $_lang['configcheck_images'] :
175 175
             $warnings[$i][1] = $_lang['configcheck_images_msg'];
176
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_images']);
176
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 2, $warnings[$i][1], $_lang['configcheck_images']);
177 177
             break;
178 178
         case $_lang['configcheck_sysfiles_mod']:
179 179
             $warnings[$i][1] = $_lang["configcheck_sysfiles_mod_msg"];
180
-			$warnings[$i][2] = '<ul><li>'. join('</li><li>', $sysfiles_check) .'</li></ul>';
181
-			if($modx->hasPermission('settings')) {
182
-				$warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>';
180
+			$warnings[$i][2] = '<ul><li>'.join('</li><li>', $sysfiles_check).'</li></ul>';
181
+			if ($modx->hasPermission('settings')) {
182
+				$warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\''.$_lang["reset_sysfiles_checksum_alert"].'\')">'.$_lang["reset_sysfiles_checksum_button"].'</a></li></ul>';
183 183
 			}
184
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".join(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']);
184
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1]." ".join(', ', $sysfiles_check), $_lang['configcheck_sysfiles_mod']);
185 185
             break;
186 186
         case $_lang['configcheck_lang_difference'] :
187 187
             $warnings[$i][1] = $_lang['configcheck_lang_difference_msg'];
@@ -203,18 +203,18 @@  discard block
 block discarded – undo
203 203
             break;
204 204
         case $_lang['configcheck_validate_referer'] :
205 205
             $msg = $_lang['configcheck_validate_referer_msg'];
206
-            $msg .= '<br />' . sprintf($_lang["configcheck_hide_warning"], 'validate_referer');
206
+            $msg .= '<br />'.sprintf($_lang["configcheck_hide_warning"], 'validate_referer');
207 207
             $warnings[$i][1] = "<span id=\"validate_referer_warning_wrapper\">{$msg}</span>\n";
208 208
             break;
209 209
         case $_lang['configcheck_templateswitcher_present'] :
210 210
             $msg = $_lang["configcheck_templateswitcher_present_msg"];
211
-            if(isset($_SESSION['mgrPermissions']['save_plugin']) && $_SESSION['mgrPermissions']['save_plugin'] == '1') {
212
-                $msg .= '<br />' . $_lang["configcheck_templateswitcher_present_disable"];
211
+            if (isset($_SESSION['mgrPermissions']['save_plugin']) && $_SESSION['mgrPermissions']['save_plugin'] == '1') {
212
+                $msg .= '<br />'.$_lang["configcheck_templateswitcher_present_disable"];
213 213
             }
214
-            if(isset($_SESSION['mgrPermissions']['delete_plugin']) && $_SESSION['mgrPermissions']['delete_plugin'] == '1') {
215
-                $msg .= '<br />' . $_lang["configcheck_templateswitcher_present_delete"];
214
+            if (isset($_SESSION['mgrPermissions']['delete_plugin']) && $_SESSION['mgrPermissions']['delete_plugin'] == '1') {
215
+                $msg .= '<br />'.$_lang["configcheck_templateswitcher_present_delete"];
216 216
             }
217
-            $msg .= '<br />' . sprintf($_lang["configcheck_hide_warning"], 'templateswitcher_present');
217
+            $msg .= '<br />'.sprintf($_lang["configcheck_hide_warning"], 'templateswitcher_present');
218 218
             $warnings[$i][1] = "<span id=\"templateswitcher_present_warning_wrapper\">{$msg}</span>\n";
219 219
             break;
220 220
         case $_lang['configcheck_rb_base_dir'] :
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
             $warnings[$i][1] = $_lang['configcheck_default_msg'];
228 228
     }
229 229
 
230
-    $admin_warning = $_SESSION['mgrRole']!=1 ? $_lang['configcheck_admin'] : "" ;
230
+    $admin_warning = $_SESSION['mgrRole'] != 1 ? $_lang['configcheck_admin'] : "";
231 231
     $config_check_results .= "
232 232
             <fieldset>
233 233
             <p><strong>".$_lang['configcheck_warning']."</strong> '".$warnings[$i][0]."'</p>
@@ -236,11 +236,11 @@  discard block
 block discarded – undo
236 236
             ".(isset($warnings[$i][2]) ? '<div style="padding-left:1em">'.$warnings[$i][2].'</div>' : '')."
237 237
             </fieldset>
238 238
 ";
239
-        if ($i!=count($warnings)-1) {
239
+        if ($i != count($warnings) - 1) {
240 240
             $config_check_results .= "<br />";
241 241
         }
242 242
     }
243
-    $_SESSION["mgrConfigCheck"]=true;
243
+    $_SESSION["mgrConfigCheck"] = true;
244 244
 } else {
245 245
     $config_check_results = $_lang['configcheck_ok'];
246 246
 }
Please login to merge, or discard this patch.
manager/includes/menu.class.inc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -65,14 +65,14 @@  discard block
 block discarded – undo
65 65
                 $countChild++;
66 66
                 $id = $value[0];
67 67
                 $ph['id'] = $id;
68
-                $ph['li_class'] = $this->get_li_class($id) . $value[10];
68
+                $ph['li_class'] = $this->get_li_class($id).$value[10];
69 69
                 $ph['href'] = $value[3];
70 70
                 $ph['alt'] = $value[4];
71 71
                 $ph['target'] = $value[7];
72 72
                 $ph['onclick'] = $value[5];
73 73
                 $ph['a_class'] = $this->get_a_class($id);
74 74
                 $ph['LinkAttr'] = $this->getLinkAttr($id);
75
-                $ph['itemName'] = $value[2] . $this->getItemName($id);
75
+                $ph['itemName'] = $value[2].$this->getItemName($id);
76 76
 
77 77
                 $ph['DrawSub'] = '';
78 78
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     function get_li_class($id)
112 112
     {
113 113
         if (isset($this->menu[$id])) {
114
-            return $this->defaults['parentClass'] . ' ';
114
+            return $this->defaults['parentClass'].' ';
115 115
         } else {
116 116
             return '';
117 117
         }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     function get_a_class($id)
121 121
     {
122 122
         if (isset($this->menu[$id])) {
123
-            return ' class="' . $this->defaults['parentLinkClass'] . '"';
123
+            return ' class="'.$this->defaults['parentLinkClass'].'"';
124 124
         } else {
125 125
             return '';
126 126
         }
Please login to merge, or discard this patch.
manager/includes/template.parser.class.inc.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -7,9 +7,9 @@  discard block
 block discarded – undo
7 7
  *
8 8
  */
9 9
 
10
-Class TemplateParser {
10
+Class TemplateParser{
11 11
 
12
-	function __construct() {
12
+	function __construct(){
13 13
 	}
14 14
 
15 15
 	/**
@@ -17,46 +17,46 @@  discard block
 block discarded – undo
17 17
 	 * @param array $data
18 18
 	 * @return string
19 19
 	 */
20
-	public function output($config = array(), $data = array()) {
20
+	public function output($config = array(), $data = array()){
21 21
 		global $modx;
22 22
 
23 23
 		$output = '';
24 24
 		$action = !empty($config['action']) ? $config['action'] : (!empty($_REQUEST['a']) ? $_REQUEST['a'] : '');
25
-		$tab = isset($config['tab']) ? ' AND tab IN(' . $config['tab'] . ')' : '';
25
+		$tab = isset($config['tab']) ? ' AND tab IN('.$config['tab'].')' : '';
26 26
 
27
-		if($action) {
27
+		if ($action) {
28 28
 			$sql = $modx->db->query('SELECT t1.*, IF(t1.alias=\'\',t1.name,t1.alias) AS alias, t2.category AS category_name
29
-			FROM ' . $modx->getFullTableName('system_templates') . ' AS t1
30
-			INNER JOIN ' . $modx->getFullTableName('categories') . ' AS t2 ON t2.id=t1.category
31
-			WHERE t1.action IN(' . $action . ') ' . $tab . '
29
+			FROM ' . $modx->getFullTableName('system_templates').' AS t1
30
+			INNER JOIN ' . $modx->getFullTableName('categories').' AS t2 ON t2.id=t1.category
31
+			WHERE t1.action IN(' . $action.') '.$tab.'
32 32
 			ORDER BY t1.tab ASC, t1.rank ASC');
33 33
 
34
-			if($modx->db->getRecordCount($sql)) {
34
+			if ($modx->db->getRecordCount($sql)) {
35 35
 				$tabs = array();
36
-				while($row = $modx->db->getRow($sql)) {
37
-					if(!$row['value'] && !empty($data[$row['name']])) {
36
+				while ($row = $modx->db->getRow($sql)) {
37
+					if (!$row['value'] && !empty($data[$row['name']])) {
38 38
 						$row['value'] = $data[$row['name']];
39 39
 					}
40 40
 					$tabs[$row['tab']]['category_name'] = $row['category_name'];
41 41
 					$tabs[$row['tab']][$row['name']] = TemplateParser::render($row);
42 42
 				}
43 43
 
44
-				if(!empty($config['toArray'])) {
44
+				if (!empty($config['toArray'])) {
45 45
 					$output = $tabs;
46 46
 				} else {
47
-					$output .= '<div class="tab-pane" id="pane_' . $action . '">';
47
+					$output .= '<div class="tab-pane" id="pane_'.$action.'">';
48 48
 					$output .= '
49 49
 					<script type="text/javascript">
50
-						var pane_' . $action . ' = new WebFXTabPane(document.getElementById("pane_' . $action . '"), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false') . ');
50
+						var pane_' . $action.' = new WebFXTabPane(document.getElementById("pane_'.$action.'"), '.($modx->config['remember_last_tab'] == 1 ? 'true' : 'false').');
51 51
 					</script>';
52 52
 
53
-					foreach($tabs as $idTab => $tab) {
54
-						$output .= '<div class="tab-page" id="tab_' . $action . '_' . $idTab . '">';
53
+					foreach ($tabs as $idTab => $tab) {
54
+						$output .= '<div class="tab-page" id="tab_'.$action.'_'.$idTab.'">';
55 55
 						$output .= '
56
-						<h2 class="tab">' . (!empty($config['tabs'][$idTab]) ? $config['tabs'][$idTab] : $tab['category_name']) . '</h2>
57
-						<script type="text/javascript">pane_' . $action . '.addTabPage(document.getElementById("tab_' . $action . '_' . $idTab . '"));</script>';
56
+						<h2 class="tab">' . (!empty($config['tabs'][$idTab]) ? $config['tabs'][$idTab] : $tab['category_name']).'</h2>
57
+						<script type="text/javascript">pane_' . $action.'.addTabPage(document.getElementById("tab_'.$action.'_'.$idTab.'"));</script>';
58 58
 						unset($tab['category_name']);
59
-						foreach($tab as $item) {
59
+						foreach ($tab as $item) {
60 60
 							$output .= $item;
61 61
 						}
62 62
 						$output .= '</div>';
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 		return $output;
70 70
 	}
71 71
 
72
-	private function render($data) {
72
+	private function render($data){
73 73
 		global $modx, $_lang, $_country_lang;
74 74
 
75 75
 		$data['lang.name'] = (isset($_lang[$data['alias']]) ? $_lang[$data['alias']] : $data['alias']);
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 		$output = '';
80 80
 		$output .= '<div class="form-group row">';
81 81
 
82
-		switch($data['type']) {
82
+		switch ($data['type']) {
83 83
 
84 84
 			case 'text':
85 85
 				$output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>
@@ -113,18 +113,18 @@  discard block
 block discarded – undo
113 113
 				$output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>';
114 114
 				$output .= '<div class="col-sm-7">';
115 115
 				$output .= '<select name="[+name+]" class="form-control" id="[+name+]" onChange="documentDirty=true;">';
116
-				if($data['name'] == 'country' && isset($_country_lang)) {
116
+				if ($data['name'] == 'country' && isset($_country_lang)) {
117 117
 					$chosenCountry = isset($_POST['country']) ? $_POST['country'] : $data['country'];
118
-					$output .= '<option value=""' . (!isset($chosenCountry) ? ' selected' : '') . '>&nbsp;</option>';
119
-					foreach($_country_lang as $key => $value) {
120
-						$output .= '<option value="' . $key . '"' . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . '>' . $value . '</option>';
118
+					$output .= '<option value=""'.(!isset($chosenCountry) ? ' selected' : '').'>&nbsp;</option>';
119
+					foreach ($_country_lang as $key => $value) {
120
+						$output .= '<option value="'.$key.'"'.(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').'>'.$value.'</option>';
121 121
 					}
122 122
 				} else {
123
-					if($data['elements']) {
123
+					if ($data['elements']) {
124 124
 						$elements = explode('||', $data['elements']);
125
-						foreach($elements as $key => $value) {
125
+						foreach ($elements as $key => $value) {
126 126
 							$value = explode('==', $value);
127
-							$output .= '<option value="' . $value[1] . '">' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]) . '</option>';
127
+							$output .= '<option value="'.$value[1].'">'.(isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]).'</option>';
128 128
 						}
129 129
 					}
130 130
 				}
@@ -138,11 +138,11 @@  discard block
 block discarded – undo
138 138
 				$output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>';
139 139
 				$output .= '<div class="col-sm-7">';
140 140
 				$output .= '<input type="checkbox" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />';
141
-				if($data['elements']) {
141
+				if ($data['elements']) {
142 142
 					$elements = explode('||', $data['elements']);
143
-					foreach($elements as $key => $value) {
143
+					foreach ($elements as $key => $value) {
144 144
 						$value = explode('==', $value);
145
-						$output .= '<br /><input type="checkbox" name="' . $value[0] . '" class="form-control" id="' . $value[0] . '" value="' . $value[1] . '" onChange="documentDirty=true;"[+readonly+] /> ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]);
145
+						$output .= '<br /><input type="checkbox" name="'.$value[0].'" class="form-control" id="'.$value[0].'" value="'.$value[1].'" onChange="documentDirty=true;"[+readonly+] /> '.(isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]);
146 146
 					}
147 147
 				}
148 148
 				$output .= $data['content'];
@@ -154,11 +154,11 @@  discard block
 block discarded – undo
154 154
 				$output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>';
155 155
 				$output .= '<div class="col-sm-7">';
156 156
 				$output .= '<input type="radio" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />';
157
-				if($data['elements']) {
157
+				if ($data['elements']) {
158 158
 					$elements = explode('||', $data['elements']);
159
-					foreach($elements as $key => $value) {
159
+					foreach ($elements as $key => $value) {
160 160
 						$value = explode('==', $value);
161
-						$output .= '<br /><input type="radio" name="[+name+]" class="form-control" id="[+name+]_' . $key . '" value="' . $value[1] . '" onChange="documentDirty=true;"[+readonly+] /> ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]);
161
+						$output .= '<br /><input type="radio" name="[+name+]" class="form-control" id="[+name+]_'.$key.'" value="'.$value[1].'" onChange="documentDirty=true;"[+readonly+] /> '.(isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]);
162 162
 					}
163 163
 				}
164 164
 				$output .= $data['content'];
Please login to merge, or discard this patch.
manager/includes/debug.inc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
2
+if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3 3
 
4 4
 // show debug information
5
-if(isset($enable_debug) && $enable_debug==true) {
5
+if (isset($enable_debug) && $enable_debug == true) {
6 6
 	?>
7 7
 	<script language="javascript">
8 8
 	//document.onload = removeDebug();
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	}
34 34
 	</style>
35 35
 	<?php
36
-	$mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tend = $mtime; $totaltime = ($tend - $tstart);
36
+	$mtime = microtime(); $mtime = explode(" ", $mtime); $mtime = $mtime[1] + $mtime[0]; $tend = $mtime; $totaltime = ($tend - $tstart);
37 37
 	?>
38 38
 	<div class='debug' id='debug' name='debug' onClick="removeDebugDiv();">
39 39
 		<table border="0" cellspacing="0" cellpadding="0">
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 		  </tr>
43 43
 		  <tr>
44 44
 			<td width="70">Time taken</td>
45
-			<td width="80"><?php echo printf ("%6.5f s", $totaltime); ?></td>
45
+			<td width="80"><?php echo printf("%6.5f s", $totaltime); ?></td>
46 46
 		  </tr>
47 47
 		</table>
48 48
 	</div>
Please login to merge, or discard this patch.
manager/includes/controls/contextmenu.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -3,59 +3,59 @@
 block discarded – undo
3 3
 global $ContextMenuCnt;
4 4
 $ContextMenuCnt = 0;
5 5
 
6
-class ContextMenu {
6
+class ContextMenu{
7 7
 	var $id;
8 8
 
9
-	function __construct($id = '', $width = 120, $visible = false) {
9
+	function __construct($id = '', $width = 120, $visible = false){
10 10
 		global $ContextMenuCnt;
11 11
 		$ContextMenuCnt++;
12 12
 		$this->html = "";
13 13
 		$this->visible = $visible ? $visible : false;
14 14
 		$this->width = is_numeric($width) ? intval($width) : 120;
15
-		$this->id = $id ? $id : "cntxMnu" . $ContextMenuCnt;    // set id
15
+		$this->id = $id ? $id : "cntxMnu".$ContextMenuCnt; // set id
16 16
 	}
17 17
 
18
-	function addItem($text, $action = "", $img = "", $disabled = 0) {
18
+	function addItem($text, $action = "", $img = "", $disabled = 0){
19 19
 		global $base_url, $_style;
20
-        if($disabled) {
20
+        if ($disabled) {
21 21
             return;
22 22
         }
23
-		if(!$img) {
24
-			$img = $base_url . $_style['tx'];
23
+		if (!$img) {
24
+			$img = $base_url.$_style['tx'];
25 25
 		}
26
-		if(substr($action, 0, 3) == "js:") {
26
+		if (substr($action, 0, 3) == "js:") {
27 27
 			$action = substr($action, 3);
28
-		} else if(substr($action, 0, 3) == "hl:") {
29
-			$action = "window.location.href='" . substr($action, 3) . "'";
28
+		} else if (substr($action, 0, 3) == "hl:") {
29
+			$action = "window.location.href='".substr($action, 3)."'";
30 30
 		} else {
31
-			$action = "window.location.href='" . $action . "'";
31
+			$action = "window.location.href='".$action."'";
32 32
 		}
33
-		$action = " onmouseover=\"this.className='cntxMnuItemOver';\" onmouseout=\"this.className='cntxMnuItem';\" onclick=\"$action; hideCntxMenu('" . $this->id . "');\"";
34
-		$this->html .= "<div class='" . ($disabled ? "cntxMnuItemDisabled" : "cntxMnuItem") . "' $action>";
35
-        if(substr($img, 0, 5) == 'fa fa') {
36
-            $img = '<i class="' . $img . '"></i>';
37
-        } else if(substr($img, 0, 1) != '<') {
38
-            $img = '<img src="' . $img . '" />';
33
+		$action = " onmouseover=\"this.className='cntxMnuItemOver';\" onmouseout=\"this.className='cntxMnuItem';\" onclick=\"$action; hideCntxMenu('".$this->id."');\"";
34
+		$this->html .= "<div class='".($disabled ? "cntxMnuItemDisabled" : "cntxMnuItem")."' $action>";
35
+        if (substr($img, 0, 5) == 'fa fa') {
36
+            $img = '<i class="'.$img.'"></i>';
37
+        } else if (substr($img, 0, 1) != '<') {
38
+            $img = '<img src="'.$img.'" />';
39 39
         }
40
-		$this->html .= $img . '&nbsp;' . $text . '</div>';
40
+		$this->html .= $img.'&nbsp;'.$text.'</div>';
41 41
 	}
42 42
 
43
-	function addSeparator() {
43
+	function addSeparator(){
44 44
 		$this->html .= "
45 45
 			<div class='cntxMnuSeparator'></div>
46 46
 		";
47 47
 	}
48 48
 
49
-	function render() {
49
+	function render(){
50 50
 		global $ContextMenuScript;
51 51
 
52
-		$html = $ContextMenuScript . "<div id='" . $this->id . "' class='contextMenu' style='width:" . $this->width . "px; visibility:" . ($this->visible ? 'visible' : 'hidden') . "'>" . $this->html . "</div>";
52
+		$html = $ContextMenuScript."<div id='".$this->id."' class='contextMenu' style='width:".$this->width."px; visibility:".($this->visible ? 'visible' : 'hidden')."'>".$this->html."</div>";
53 53
 		$ContextMenuScript = ""; // reset css
54 54
 		return $html;
55 55
 	}
56 56
 
57
-	function getClientScriptObject() {
58
-		return "getCntxMenu('" . $this->id . "')";
57
+	function getClientScriptObject(){
58
+		return "getCntxMenu('".$this->id."')";
59 59
 	}
60 60
 }
61 61
 
Please login to merge, or discard this patch.