Completed
Push — develop ( 663a1f...4a4b5c )
by Agel_Nash
15s
created
manager/includes/extenders/modifiers/mdf_memberof.inc.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -2,22 +2,22 @@
 block discarded – undo
2 2
 $userID = abs($modx->getLoginUserID('web'));
3 3
 $modx->qs_hash = md5($modx->qs_hash."^{$userID}^");
4 4
 
5
-$groupNames = ($this->strlen($opt) > 0 ) ? explode(',',$opt) : array();
5
+$groupNames = ($this->strlen($opt) > 0) ? explode(',', $opt) : array();
6 6
 
7 7
 // if $groupNames is not an array return false
8
-if(!is_array($groupNames)) return 0;
8
+if (!is_array($groupNames)) return 0;
9 9
 
10 10
 // Creates an array with all webgroups the user id is in
11 11
 if (isset($modx->filter->cache['mo'][$userID])) $grpNames = $modx->filter->cache['mo'][$userID];
12 12
 else {
13
-    $from = sprintf("[+prefix+]webgroup_names wgn INNER JOIN [+prefix+]web_groups wg ON wg.webgroup=wgn.id AND wg.webuser='%s'",$userID);
14
-    $rs = $modx->db->select('wgn.name',$from);
15
-    $modx->filter->cache['mo'][$userID] = $grpNames = $modx->db->getColumn('name',$rs);
13
+    $from = sprintf("[+prefix+]webgroup_names wgn INNER JOIN [+prefix+]web_groups wg ON wg.webgroup=wgn.id AND wg.webuser='%s'", $userID);
14
+    $rs = $modx->db->select('wgn.name', $from);
15
+    $modx->filter->cache['mo'][$userID] = $grpNames = $modx->db->getColumn('name', $rs);
16 16
 }
17 17
 
18 18
 // Check if a supplied group matches a webgroup from the array we just created
19
-foreach($groupNames as $k=>$v) {
20
-    if(in_array(trim($v),$grpNames)) return 1;
19
+foreach ($groupNames as $k=>$v) {
20
+    if (in_array(trim($v), $grpNames)) return 1;
21 21
 }
22 22
 
23 23
 // If we get here the above logic did not find a match, so return false
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -5,11 +5,14 @@  discard block
 block discarded – undo
5 5
 $groupNames = ($this->strlen($opt) > 0 ) ? explode(',',$opt) : array();
6 6
 
7 7
 // if $groupNames is not an array return false
8
-if(!is_array($groupNames)) return 0;
8
+if(!is_array($groupNames)) {
9
+    return 0;
10
+}
9 11
 
10 12
 // Creates an array with all webgroups the user id is in
11
-if (isset($modx->filter->cache['mo'][$userID])) $grpNames = $modx->filter->cache['mo'][$userID];
12
-else {
13
+if (isset($modx->filter->cache['mo'][$userID])) {
14
+    $grpNames = $modx->filter->cache['mo'][$userID];
15
+} else {
13 16
     $from = sprintf("[+prefix+]webgroup_names wgn INNER JOIN [+prefix+]web_groups wg ON wg.webgroup=wgn.id AND wg.webuser='%s'",$userID);
14 17
     $rs = $modx->db->select('wgn.name',$from);
15 18
     $modx->filter->cache['mo'][$userID] = $grpNames = $modx->db->getColumn('name',$rs);
@@ -17,8 +20,10 @@  discard block
 block discarded – undo
17 20
 
18 21
 // Check if a supplied group matches a webgroup from the array we just created
19 22
 foreach($groupNames as $k=>$v) {
20
-    if(in_array(trim($v),$grpNames)) return 1;
21
-}
23
+    if(in_array(trim($v),$grpNames)) {
24
+        return 1;
25
+    }
26
+    }
22 27
 
23 28
 // If we get here the above logic did not find a match, so return false
24 29
 return 0;
Please login to merge, or discard this patch.
manager/includes/extenders/message.quit.inc.php 2 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -19,60 +19,60 @@
 block discarded – undo
19 19
 </head><body>
20 20
 ";
21 21
 if($is_error) {
22
-	$parsedMessageString .= "<h3 style='color:red;background:#e0e0e0;padding:2px;'>&nbsp;MODX Parse Error </h3>
22
+    $parsedMessageString .= "<h3 style='color:red;background:#e0e0e0;padding:2px;'>&nbsp;MODX Parse Error </h3>
23 23
 	<table border='0' cellpadding='1' cellspacing='0'>
24 24
 	<tr><td colspan='3'>MODX encountered the following error while attempting to parse the requested resource:</td></tr>
25 25
 	<tr><td colspan='3'><b style='color:red;'>&laquo; $msg &raquo;</b></td></tr>";
26 26
 } else {
27
-	$parsedMessageString .= "<h3 style='color:#003399; background:#eeeeee;padding:2px;'>&nbsp;MODX Debug/ stop message </h3>
27
+    $parsedMessageString .= "<h3 style='color:#003399; background:#eeeeee;padding:2px;'>&nbsp;MODX Debug/ stop message </h3>
28 28
 	<table border='0' cellpadding='1' cellspacing='0'>
29 29
 	<tr><td colspan='3'>The MODX parser recieved the following debug/ stop message:</td></tr>
30 30
 	<tr><td colspan='3'><b style='color:#003399;'>&laquo; $msg &raquo;</b></td></tr>";
31 31
 }
32 32
 
33 33
 if(!empty($query)) {
34
-	$parsedMessageString .= "<tr><td colspan='3'><hr size='1' width='98%' style='color:#e0e0e0'/><b style='color:#999;font-size: 9px;border-left:1px solid #c0c0c0; margin-left:10px;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SQL:&nbsp;<span id='sqlHolder'>$query</span></b><hr size='1' width='98%' style='color:#e0e0e0'/>
34
+    $parsedMessageString .= "<tr><td colspan='3'><hr size='1' width='98%' style='color:#e0e0e0'/><b style='color:#999;font-size: 9px;border-left:1px solid #c0c0c0; margin-left:10px;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SQL:&nbsp;<span id='sqlHolder'>$query</span></b><hr size='1' width='98%' style='color:#e0e0e0'/>
35 35
 	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='javascript:copyToClip();' style='color:#821517;font-size: 9px; text-decoration: none'>[Copy SQL to ClipBoard]</a><textarea id='holdtext' style='display:none;'></textarea></td></tr>";
36 36
 }
37 37
 
38 38
 if($text!='') {
39 39
 
40
-	$errortype = array (
41
-		E_ERROR          => "Error",
42
-		E_WARNING        => "Warning",
43
-		E_PARSE          => "Parsing Error",
44
-		E_NOTICE          => "Notice",
45
-		E_CORE_ERROR      => "Core Error",
46
-		E_CORE_WARNING    => "Core Warning",
47
-		E_COMPILE_ERROR  => "Compile Error",
48
-		E_COMPILE_WARNING => "Compile Warning",
49
-		E_USER_ERROR      => "User Error",
50
-		E_USER_WARNING    => "User Warning",
51
-		E_USER_NOTICE    => "User Notice",
52
-	);
40
+    $errortype = array (
41
+        E_ERROR          => "Error",
42
+        E_WARNING        => "Warning",
43
+        E_PARSE          => "Parsing Error",
44
+        E_NOTICE          => "Notice",
45
+        E_CORE_ERROR      => "Core Error",
46
+        E_CORE_WARNING    => "Core Warning",
47
+        E_COMPILE_ERROR  => "Compile Error",
48
+        E_COMPILE_WARNING => "Compile Warning",
49
+        E_USER_ERROR      => "User Error",
50
+        E_USER_WARNING    => "User Warning",
51
+        E_USER_NOTICE    => "User Notice",
52
+    );
53 53
 
54
-	$parsedMessageString .= "<tr><td>&nbsp;</td></tr><tr><td colspan='3'><b>PHP error debug</b></td></tr>";
54
+    $parsedMessageString .= "<tr><td>&nbsp;</td></tr><tr><td colspan='3'><b>PHP error debug</b></td></tr>";
55 55
 
56
-	$parsedMessageString .= "<tr><td valign='top'>&nbsp;&nbsp;Error: </td>";
57
-	$parsedMessageString .= "<td colspan='2'>$text</td><td>&nbsp;</td>";
58
-	$parsedMessageString .= "</tr>";
56
+    $parsedMessageString .= "<tr><td valign='top'>&nbsp;&nbsp;Error: </td>";
57
+    $parsedMessageString .= "<td colspan='2'>$text</td><td>&nbsp;</td>";
58
+    $parsedMessageString .= "</tr>";
59 59
 
60
-	$parsedMessageString .= "<tr><td valign='top'>&nbsp;&nbsp;Error type/ Nr.: </td>";
61
-	$parsedMessageString .= "<td colspan='2'>".$errortype[$nr]." - $nr</b></td><td>&nbsp;</td>";
62
-	$parsedMessageString .= "</tr>";
60
+    $parsedMessageString .= "<tr><td valign='top'>&nbsp;&nbsp;Error type/ Nr.: </td>";
61
+    $parsedMessageString .= "<td colspan='2'>".$errortype[$nr]." - $nr</b></td><td>&nbsp;</td>";
62
+    $parsedMessageString .= "</tr>";
63 63
 
64
-	$parsedMessageString .= "<tr><td>&nbsp;&nbsp;File: </td>";
65
-	$parsedMessageString .= "<td colspan='2'>$file</td><td>&nbsp;</td>";
66
-	$parsedMessageString .= "</tr>";
64
+    $parsedMessageString .= "<tr><td>&nbsp;&nbsp;File: </td>";
65
+    $parsedMessageString .= "<td colspan='2'>$file</td><td>&nbsp;</td>";
66
+    $parsedMessageString .= "</tr>";
67 67
 
68
-	$parsedMessageString .= "<tr><td>&nbsp;&nbsp;Line: </td>";
69
-	$parsedMessageString .= "<td colspan='2'>$line</td><td>&nbsp;</td>";
70
-	$parsedMessageString .= "</tr>";
71
-	if($source!='') {
72
-		$parsedMessageString .= "<tr><td valign='top'>&nbsp;&nbsp;Line $line source: </td>";
73
-		$parsedMessageString .= "<td colspan='2'>$source</td><td>&nbsp;</td>";
74
-		$parsedMessageString .= "</tr>";
75
-	}
68
+    $parsedMessageString .= "<tr><td>&nbsp;&nbsp;Line: </td>";
69
+    $parsedMessageString .= "<td colspan='2'>$line</td><td>&nbsp;</td>";
70
+    $parsedMessageString .= "</tr>";
71
+    if($source!='') {
72
+        $parsedMessageString .= "<tr><td valign='top'>&nbsp;&nbsp;Line $line source: </td>";
73
+        $parsedMessageString .= "<td colspan='2'>$source</td><td>&nbsp;</td>";
74
+        $parsedMessageString .= "</tr>";
75
+    }
76 76
 }
77 77
 
78 78
 $parsedMessageString .= "<tr><td>&nbsp;</td></tr><tr><td colspan='3'><b>Parser timing</b></td></tr>";
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
  * Message Quit Template
4 4
  *
5 5
  */
6
-if(( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) && IN_PARSER_MODE!="true") {
6
+if ((!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) && IN_PARSER_MODE != "true") {
7 7
     die("<b>INCLUDE ACCESS ERROR</b><br /><br />Direct access to this file prohibited.");
8 8
 }
9 9
 
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 </script>
21 21
 </head><body>
22 22
 ";
23
-if($is_error) {
23
+if ($is_error) {
24 24
 	$parsedMessageString .= "<h3 style='color:red;background:#e0e0e0;padding:2px;'>&nbsp;MODX Parse Error </h3>
25 25
 	<table border='0' cellpadding='1' cellspacing='0'>
26 26
 	<tr><td colspan='3'>MODX encountered the following error while attempting to parse the requested resource:</td></tr>
@@ -32,14 +32,14 @@  discard block
 block discarded – undo
32 32
 	<tr><td colspan='3'><b style='color:#003399;'>&laquo; $msg &raquo;</b></td></tr>";
33 33
 }
34 34
 
35
-if(!empty($query)) {
35
+if (!empty($query)) {
36 36
 	$parsedMessageString .= "<tr><td colspan='3'><hr size='1' width='98%' style='color:#e0e0e0'/><b style='color:#999;font-size: 9px;border-left:1px solid #c0c0c0; margin-left:10px;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SQL:&nbsp;<span id='sqlHolder'>$query</span></b><hr size='1' width='98%' style='color:#e0e0e0'/>
37 37
 	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='javascript:copyToClip();' style='color:#821517;font-size: 9px; text-decoration: none'>[Copy SQL to ClipBoard]</a><textarea id='holdtext' style='display:none;'></textarea></td></tr>";
38 38
 }
39 39
 
40
-if($text!='') {
40
+if ($text != '') {
41 41
 
42
-	$errortype = array (
42
+	$errortype = array(
43 43
 		E_ERROR          => "Error",
44 44
 		E_WARNING        => "Warning",
45 45
 		E_PARSE          => "Parsing Error",
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	$parsedMessageString .= "<tr><td>&nbsp;&nbsp;Line: </td>";
71 71
 	$parsedMessageString .= "<td colspan='2'>$line</td><td>&nbsp;</td>";
72 72
 	$parsedMessageString .= "</tr>";
73
-	if($source!='') {
73
+	if ($source != '') {
74 74
 		$parsedMessageString .= "<tr><td valign='top'>&nbsp;&nbsp;Line $line source: </td>";
75 75
 		$parsedMessageString .= "<td colspan='2'>$source</td><td>&nbsp;</td>";
76 76
 		$parsedMessageString .= "</tr>";
Please login to merge, or discard this patch.
manager/includes/extenders/ex_phpcompat.inc.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,13 +5,13 @@
 block discarded – undo
5 5
  * Time: 12:25
6 6
  */
7 7
 
8
-if (isset($this->phpcompat) && is_object($this->phpcompat)){
8
+if (isset($this->phpcompat) && is_object($this->phpcompat)) {
9 9
     return true;
10 10
 }
11 11
 
12
-if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/phpcompat.class.inc.php')){
12
+if (!include_once(MODX_MANAGER_PATH.'includes/extenders/phpcompat.class.inc.php')) {
13 13
     return false;
14
-}else{
14
+} else {
15 15
     $this->phpcompat = new PHPCOMPAT;
16 16
     return true;
17 17
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,13 +5,13 @@
 block discarded – undo
5 5
  * Time: 12:25
6 6
  */
7 7
 
8
-if (isset($this->phpcompat) && is_object($this->phpcompat)){
8
+if (isset($this->phpcompat) && is_object($this->phpcompat)) {
9 9
     return true;
10 10
 }
11 11
 
12
-if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/phpcompat.class.inc.php')){
12
+if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/phpcompat.class.inc.php')) {
13 13
     return false;
14
-}else{
14
+} else {
15 15
     $this->phpcompat = new PHPCOMPAT;
16 16
     return true;
17 17
 }
Please login to merge, or discard this patch.
manager/includes/extenders/ex_phpass.inc.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,13 +5,13 @@
 block discarded – undo
5 5
  * Time: 19:14
6 6
  */
7 7
 
8
-if (isset($this->phpass) && is_object($this->phpass)){
8
+if (isset($this->phpass) && is_object($this->phpass)) {
9 9
     return true;
10 10
 }
11 11
 
12
-if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/phpass.class.inc.php')){
12
+if (!include_once(MODX_MANAGER_PATH.'includes/extenders/phpass.class.inc.php')) {
13 13
     return false;
14
-}else{
14
+} else {
15 15
     $this->phpass = new PasswordHash;
16 16
     return true;
17 17
 }
18 18
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,13 +5,13 @@
 block discarded – undo
5 5
  * Time: 19:14
6 6
  */
7 7
 
8
-if (isset($this->phpass) && is_object($this->phpass)){
8
+if (isset($this->phpass) && is_object($this->phpass)) {
9 9
     return true;
10 10
 }
11 11
 
12
-if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/phpass.class.inc.php')){
12
+if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/phpass.class.inc.php')) {
13 13
     return false;
14
-}else{
14
+} else {
15 15
     $this->phpass = new PasswordHash;
16 16
     return true;
17 17
 }
18 18
\ No newline at end of file
Please login to merge, or discard this patch.
manager/includes/extenders/deprecated.functions.inc.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     function getUserData() {
41 41
         $client['ip'] = $_SERVER['REMOTE_ADDR'];
42 42
         $client['ua'] = $_SERVER['HTTP_USER_AGENT'];
43
-    	return $client;
43
+        return $client;
44 44
     }
45 45
     
46 46
     # Returns true, install or interact when inside manager
@@ -60,12 +60,12 @@  discard block
 block discarded – undo
60 60
 
61 61
     // deprecated
62 62
     function putChunk($chunkName) { // alias name >.<
63
-    	global $modx;
63
+        global $modx;
64 64
         return $modx->getChunk($chunkName);
65 65
     }
66 66
 
67 67
     function getDocGroups() {
68
-    	global $modx;
68
+        global $modx;
69 69
         return $modx->getUserDocGroups();
70 70
     } // deprecated
71 71
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     } // deprecated
75 75
     
76 76
     function userLoggedIn() {
77
-    	global $modx;
77
+        global $modx;
78 78
         $userdetails= array ();
79 79
         if ($modx->isFrontend() && isset ($_SESSION['webValidated'])) {
80 80
             // web user
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     
99 99
     function getFormVars($method= "", $prefix= "", $trim= "", $REQUEST_METHOD) {
100 100
         //  function to retrieve form results into an associative array
101
-    	global $modx;
101
+        global $modx;
102 102
         $results= array ();
103 103
         $method= strtoupper($method);
104 104
         if ($method == "")
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      * @param string $url URL to redirect to
131 131
      */
132 132
     function webAlert($msg, $url= "") {
133
-    	global $modx;
133
+        global $modx;
134 134
         $msg= addslashes($modx->db->escape($msg));
135 135
         if (substr(strtolower($url), 0, 11) == "javascript:") {
136 136
             $act= "__WebAlert();";
Please login to merge, or discard this patch.
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -1,43 +1,43 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 $this->old = new OldFunctions();
3
-class OldFunctions {
3
+class OldFunctions{
4 4
 
5
-    function dbConnect()                 {global $modx;       $modx->db->connect();$modx->rs = $modx->db->conn;}
6
-    function dbQuery($sql)               {global $modx;return $modx->db->query($sql);}
7
-    function recordCount($rs)            {global $modx;return $modx->db->getRecordCount($rs);}
8
-    function fetchRow($rs,$mode='assoc') {global $modx;return $modx->db->getRow($rs, $mode);}
9
-    function affectedRows($rs)           {global $modx;return $modx->db->getAffectedRows($rs);}
10
-    function insertId($rs)               {global $modx;return $modx->db->getInsertId($rs);}
11
-    function dbClose()                   {global $modx;       $modx->db->disconnect();}
5
+    function dbConnect(){global $modx; $modx->db->connect(); $modx->rs = $modx->db->conn; }
6
+    function dbQuery($sql){global $modx; return $modx->db->query($sql); }
7
+    function recordCount($rs){global $modx; return $modx->db->getRecordCount($rs); }
8
+    function fetchRow($rs, $mode = 'assoc'){global $modx; return $modx->db->getRow($rs, $mode); }
9
+    function affectedRows($rs){global $modx; return $modx->db->getAffectedRows($rs); }
10
+    function insertId($rs){global $modx; return $modx->db->getInsertId($rs); }
11
+    function dbClose(){global $modx; $modx->db->disconnect(); }
12 12
 
13
-    function makeList($array, $ulroot= 'root', $ulprefix= 'sub_', $type= '', $ordered= false, $tablevel= 0) {
13
+    function makeList($array, $ulroot = 'root', $ulprefix = 'sub_', $type = '', $ordered = false, $tablevel = 0){
14 14
         // first find out whether the value passed is an array
15 15
         if (!is_array($array)) {
16 16
             return "<ul><li>Bad list</li></ul>";
17 17
         }
18 18
         if (!empty ($type)) {
19
-            $typestr= " style='list-style-type: $type'";
19
+            $typestr = " style='list-style-type: $type'";
20 20
         } else {
21
-            $typestr= "";
21
+            $typestr = "";
22 22
         }
23
-        $tabs= "";
24
-        for ($i= 0; $i < $tablevel; $i++) {
23
+        $tabs = "";
24
+        for ($i = 0; $i < $tablevel; $i++) {
25 25
             $tabs .= "\t";
26 26
         }
27
-        $listhtml= $ordered == true ? $tabs . "<ol class='$ulroot'$typestr>\n" : $tabs . "<ul class='$ulroot'$typestr>\n";
27
+        $listhtml = $ordered == true ? $tabs."<ol class='$ulroot'$typestr>\n" : $tabs."<ul class='$ulroot'$typestr>\n";
28 28
         foreach ($array as $key => $value) {
29 29
             if (is_array($value)) {
30
-                $listhtml .= $tabs . "\t<li>" . $key . "\n" . $this->makeList($value, $ulprefix . $ulroot, $ulprefix, $type, $ordered, $tablevel +2) . $tabs . "\t</li>\n";
30
+                $listhtml .= $tabs."\t<li>".$key."\n".$this->makeList($value, $ulprefix.$ulroot, $ulprefix, $type, $ordered, $tablevel + 2).$tabs."\t</li>\n";
31 31
             } else {
32
-                $listhtml .= $tabs . "\t<li>" . $value . "</li>\n";
32
+                $listhtml .= $tabs."\t<li>".$value."</li>\n";
33 33
             }
34 34
         }
35
-        $listhtml .= $ordered == true ? $tabs . "</ol>\n" : $tabs . "</ul>\n";
35
+        $listhtml .= $ordered == true ? $tabs."</ol>\n" : $tabs."</ul>\n";
36 36
         return $listhtml;
37 37
     }
38 38
 
39 39
 
40
-    function getUserData() {
40
+    function getUserData(){
41 41
         $client['ip'] = $_SERVER['REMOTE_ADDR'];
42 42
         $client['ua'] = $_SERVER['HTTP_USER_AGENT'];
43 43
     	return $client;
@@ -45,80 +45,80 @@  discard block
 block discarded – undo
45 45
 
46 46
     # Returns true, install or interact when inside manager
47 47
     // deprecated
48
-    function insideManager() {
49
-        $m= false;
50
-        if( defined('IN_MANAGER_MODE') && IN_MANAGER_MODE === true) {
51
-            $m= true;
48
+    function insideManager(){
49
+        $m = false;
50
+        if (defined('IN_MANAGER_MODE') && IN_MANAGER_MODE === true) {
51
+            $m = true;
52 52
             if (defined('SNIPPET_INTERACTIVE_MODE') && SNIPPET_INTERACTIVE_MODE == 'true')
53
-                $m= "interact";
53
+                $m = "interact";
54 54
             else
55 55
                 if (defined('SNIPPET_INSTALL_MODE') && SNIPPET_INSTALL_MODE == 'true')
56
-                    $m= "install";
56
+                    $m = "install";
57 57
         }
58 58
         return $m;
59 59
     }
60 60
 
61 61
     // deprecated
62
-    function putChunk($chunkName) { // alias name >.<
62
+    function putChunk($chunkName){ // alias name >.<
63 63
     	global $modx;
64 64
         return $modx->getChunk($chunkName);
65 65
     }
66 66
 
67
-    function getDocGroups() {
67
+    function getDocGroups(){
68 68
     	global $modx;
69 69
         return $modx->getUserDocGroups();
70 70
     } // deprecated
71 71
 
72
-    function changePassword($o, $n) {
72
+    function changePassword($o, $n){
73 73
         return changeWebUserPassword($o, $n);
74 74
     } // deprecated
75 75
 
76
-    function userLoggedIn() {
76
+    function userLoggedIn(){
77 77
     	global $modx;
78
-        $userdetails= array ();
78
+        $userdetails = array();
79 79
         if ($modx->isFrontend() && isset ($_SESSION['webValidated'])) {
80 80
             // web user
81
-            $userdetails['loggedIn']= true;
82
-            $userdetails['id']= $_SESSION['webInternalKey'];
83
-            $userdetails['username']= $_SESSION['webShortname'];
84
-            $userdetails['usertype']= 'web'; // added by Raymond
81
+            $userdetails['loggedIn'] = true;
82
+            $userdetails['id'] = $_SESSION['webInternalKey'];
83
+            $userdetails['username'] = $_SESSION['webShortname'];
84
+            $userdetails['usertype'] = 'web'; // added by Raymond
85 85
             return $userdetails;
86 86
         } else
87 87
             if ($modx->isBackend() && isset ($_SESSION['mgrValidated'])) {
88 88
                 // manager user
89
-                $userdetails['loggedIn']= true;
90
-                $userdetails['id']= $_SESSION['mgrInternalKey'];
91
-                $userdetails['username']= $_SESSION['mgrShortname'];
92
-                $userdetails['usertype']= 'manager'; // added by Raymond
89
+                $userdetails['loggedIn'] = true;
90
+                $userdetails['id'] = $_SESSION['mgrInternalKey'];
91
+                $userdetails['username'] = $_SESSION['mgrShortname'];
92
+                $userdetails['usertype'] = 'manager'; // added by Raymond
93 93
                 return $userdetails;
94 94
             } else {
95 95
                 return false;
96 96
             }
97 97
     }
98 98
 
99
-    function getFormVars($method= "", $prefix= "", $trim= "", $REQUEST_METHOD) {
99
+    function getFormVars($method = "", $prefix = "", $trim = "", $REQUEST_METHOD){
100 100
         //  function to retrieve form results into an associative array
101 101
     	global $modx;
102
-        $results= array ();
103
-        $method= strtoupper($method);
102
+        $results = array();
103
+        $method = strtoupper($method);
104 104
         if ($method == "")
105
-            $method= $REQUEST_METHOD;
105
+            $method = $REQUEST_METHOD;
106 106
         if ($method == "POST")
107
-            $method= & $_POST;
108
-        elseif ($method == "GET") $method= & $_GET;
107
+            $method = & $_POST;
108
+        elseif ($method == "GET") $method = & $_GET;
109 109
         else
110 110
             return false;
111 111
         reset($method);
112 112
         foreach ($method as $key => $value) {
113 113
             if (($prefix != "") && (substr($key, 0, strlen($prefix)) == $prefix)) {
114 114
                 if ($trim) {
115
-                    $pieces= explode($prefix, $key, 2);
116
-                    $key= $pieces[1];
117
-                    $results[$key]= $value;
115
+                    $pieces = explode($prefix, $key, 2);
116
+                    $key = $pieces[1];
117
+                    $results[$key] = $value;
118 118
                 } else
119
-                    $results[$key]= $value;
119
+                    $results[$key] = $value;
120 120
             }
121
-            elseif ($prefix == "") $results[$key]= $value;
121
+            elseif ($prefix == "") $results[$key] = $value;
122 122
         }
123 123
         return $results;
124 124
     }
@@ -129,16 +129,16 @@  discard block
 block discarded – undo
129 129
      * @param string $msg Message to show
130 130
      * @param string $url URL to redirect to
131 131
      */
132
-    function webAlert($msg, $url= "") {
132
+    function webAlert($msg, $url = ""){
133 133
     	global $modx;
134
-        $msg= addslashes($modx->db->escape($msg));
134
+        $msg = addslashes($modx->db->escape($msg));
135 135
         if (substr(strtolower($url), 0, 11) == "javascript:") {
136
-            $act= "__WebAlert();";
137
-            $fnc= "function __WebAlert(){" . substr($url, 11) . "};";
136
+            $act = "__WebAlert();";
137
+            $fnc = "function __WebAlert(){".substr($url, 11)."};";
138 138
         } else {
139
-            $act= ($url ? "window.location.href='" . addslashes($url) . "';" : "");
139
+            $act = ($url ? "window.location.href='".addslashes($url)."';" : "");
140 140
         }
141
-        $html= "<script>$fnc window.setTimeout(\"alert('$msg');$act\",100);</script>";
141
+        $html = "<script>$fnc window.setTimeout(\"alert('$msg');$act\",100);</script>";
142 142
         if ($modx->isFrontend())
143 143
             $modx->regClientScript($html);
144 144
         else {
Please login to merge, or discard this patch.
Braces   +66 added lines, -35 removed lines patch added patch discarded remove patch
@@ -1,16 +1,32 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 $this->old = new OldFunctions();
3
-class OldFunctions {
3
+class OldFunctions
4
+{
4 5
 
5
-    function dbConnect()                 {global $modx;       $modx->db->connect();$modx->rs = $modx->db->conn;}
6
-    function dbQuery($sql)               {global $modx;return $modx->db->query($sql);}
7
-    function recordCount($rs)            {global $modx;return $modx->db->getRecordCount($rs);}
8
-    function fetchRow($rs,$mode='assoc') {global $modx;return $modx->db->getRow($rs, $mode);}
9
-    function affectedRows($rs)           {global $modx;return $modx->db->getAffectedRows($rs);}
10
-    function insertId($rs)               {global $modx;return $modx->db->getInsertId($rs);}
11
-    function dbClose()                   {global $modx;       $modx->db->disconnect();}
6
+    function dbConnect()
7
+    {
8
+global $modx;       $modx->db->connect();$modx->rs = $modx->db->conn;}
9
+    function dbQuery($sql)
10
+    {
11
+global $modx;return $modx->db->query($sql);}
12
+    function recordCount($rs)
13
+    {
14
+global $modx;return $modx->db->getRecordCount($rs);}
15
+    function fetchRow($rs,$mode='assoc')
16
+    {
17
+global $modx;return $modx->db->getRow($rs, $mode);}
18
+    function affectedRows($rs)
19
+    {
20
+global $modx;return $modx->db->getAffectedRows($rs);}
21
+    function insertId($rs)
22
+    {
23
+global $modx;return $modx->db->getInsertId($rs);}
24
+    function dbClose()
25
+    {
26
+global $modx;       $modx->db->disconnect();}
12 27
 
13
-    function makeList($array, $ulroot= 'root', $ulprefix= 'sub_', $type= '', $ordered= false, $tablevel= 0) {
28
+    function makeList($array, $ulroot= 'root', $ulprefix= 'sub_', $type= '', $ordered= false, $tablevel= 0)
29
+    {
14 30
         // first find out whether the value passed is an array
15 31
         if (!is_array($array)) {
16 32
             return "<ul><li>Bad list</li></ul>";
@@ -37,7 +53,8 @@  discard block
 block discarded – undo
37 53
     }
38 54
 
39 55
 
40
-    function getUserData() {
56
+    function getUserData()
57
+    {
41 58
         $client['ip'] = $_SERVER['REMOTE_ADDR'];
42 59
         $client['ua'] = $_SERVER['HTTP_USER_AGENT'];
43 60
     	return $client;
@@ -45,35 +62,42 @@  discard block
 block discarded – undo
45 62
 
46 63
     # Returns true, install or interact when inside manager
47 64
     // deprecated
48
-    function insideManager() {
65
+    function insideManager()
66
+    {
49 67
         $m= false;
50 68
         if( defined('IN_MANAGER_MODE') && IN_MANAGER_MODE === true) {
51 69
             $m= true;
52
-            if (defined('SNIPPET_INTERACTIVE_MODE') && SNIPPET_INTERACTIVE_MODE == 'true')
53
-                $m= "interact";
54
-            else
55
-                if (defined('SNIPPET_INSTALL_MODE') && SNIPPET_INSTALL_MODE == 'true')
56
-                    $m= "install";
70
+            if (defined('SNIPPET_INTERACTIVE_MODE') && SNIPPET_INTERACTIVE_MODE == 'true') {
71
+                            $m= "interact";
72
+            } else
73
+                if (defined('SNIPPET_INSTALL_MODE') && SNIPPET_INSTALL_MODE == 'true') {
74
+                                    $m= "install";
75
+                }
57 76
         }
58 77
         return $m;
59 78
     }
60 79
 
61 80
     // deprecated
62
-    function putChunk($chunkName) { // alias name >.<
81
+    function putChunk($chunkName)
82
+    {
83
+// alias name >.<
63 84
     	global $modx;
64 85
         return $modx->getChunk($chunkName);
65 86
     }
66 87
 
67
-    function getDocGroups() {
88
+    function getDocGroups()
89
+    {
68 90
     	global $modx;
69 91
         return $modx->getUserDocGroups();
70 92
     } // deprecated
71 93
 
72
-    function changePassword($o, $n) {
94
+    function changePassword($o, $n)
95
+    {
73 96
         return changeWebUserPassword($o, $n);
74 97
     } // deprecated
75 98
 
76
-    function userLoggedIn() {
99
+    function userLoggedIn()
100
+    {
77 101
     	global $modx;
78 102
         $userdetails= array ();
79 103
         if ($modx->isFrontend() && isset ($_SESSION['webValidated'])) {
@@ -96,18 +120,22 @@  discard block
 block discarded – undo
96 120
             }
97 121
     }
98 122
 
99
-    function getFormVars($method= "", $prefix= "", $trim= "", $REQUEST_METHOD) {
123
+    function getFormVars($method= "", $prefix= "", $trim= "", $REQUEST_METHOD)
124
+    {
100 125
         //  function to retrieve form results into an associative array
101 126
     	global $modx;
102 127
         $results= array ();
103 128
         $method= strtoupper($method);
104
-        if ($method == "")
105
-            $method= $REQUEST_METHOD;
106
-        if ($method == "POST")
107
-            $method= & $_POST;
108
-        elseif ($method == "GET") $method= & $_GET;
109
-        else
110
-            return false;
129
+        if ($method == "") {
130
+                    $method= $REQUEST_METHOD;
131
+        }
132
+        if ($method == "POST") {
133
+                    $method= & $_POST;
134
+        } elseif ($method == "GET") {
135
+            $method= & $_GET;
136
+        } else {
137
+                    return false;
138
+        }
111 139
         reset($method);
112 140
         foreach ($method as $key => $value) {
113 141
             if (($prefix != "") && (substr($key, 0, strlen($prefix)) == $prefix)) {
@@ -115,10 +143,12 @@  discard block
 block discarded – undo
115 143
                     $pieces= explode($prefix, $key, 2);
116 144
                     $key= $pieces[1];
117 145
                     $results[$key]= $value;
118
-                } else
119
-                    $results[$key]= $value;
146
+                } else {
147
+                                    $results[$key]= $value;
148
+                }
149
+            } elseif ($prefix == "") {
150
+                $results[$key]= $value;
120 151
             }
121
-            elseif ($prefix == "") $results[$key]= $value;
122 152
         }
123 153
         return $results;
124 154
     }
@@ -129,7 +159,8 @@  discard block
 block discarded – undo
129 159
      * @param string $msg Message to show
130 160
      * @param string $url URL to redirect to
131 161
      */
132
-    function webAlert($msg, $url= "") {
162
+    function webAlert($msg, $url= "")
163
+    {
133 164
     	global $modx;
134 165
         $msg= addslashes($modx->db->escape($msg));
135 166
         if (substr(strtolower($url), 0, 11) == "javascript:") {
@@ -139,9 +170,9 @@  discard block
 block discarded – undo
139 170
             $act= ($url ? "window.location.href='" . addslashes($url) . "';" : "");
140 171
         }
141 172
         $html= "<script>$fnc window.setTimeout(\"alert('$msg');$act\",100);</script>";
142
-        if ($modx->isFrontend())
143
-            $modx->regClientScript($html);
144
-        else {
173
+        if ($modx->isFrontend()) {
174
+                    $modx->regClientScript($html);
175
+        } else {
145 176
             echo $html;
146 177
         }
147 178
     }
Please login to merge, or discard this patch.
manager/includes/extenders/ex_export_site.inc.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
  * Time: 14:24
6 6
  */
7 7
 
8
-if(include_once(MODX_MANAGER_PATH . 'includes/extenders/export.class.inc.php'))
8
+if (include_once(MODX_MANAGER_PATH.'includes/extenders/export.class.inc.php'))
9 9
 {
10 10
     $this->export = new EXPORT_SITE;
11 11
     return true;
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,8 +5,7 @@
 block discarded – undo
5 5
  * Time: 14:24
6 6
  */
7 7
 
8
-if(include_once(MODX_MANAGER_PATH . 'includes/extenders/export.class.inc.php'))
9
-{
8
+if(include_once(MODX_MANAGER_PATH . 'includes/extenders/export.class.inc.php')) {
10 9
     $this->export = new EXPORT_SITE;
11 10
     return true;
12 11
 } else {
Please login to merge, or discard this patch.
manager/includes/extenders/ex_dbapi.inc.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@
 block discarded – undo
9 9
 
10 10
 if (empty($database_type)) $database_type = 'mysql';
11 11
 
12
-if (!include_once MODX_MANAGER_PATH . 'includes/extenders/dbapi.' . $database_type . '.class.inc.php'){
12
+if (!include_once MODX_MANAGER_PATH.'includes/extenders/dbapi.'.$database_type.'.class.inc.php') {
13 13
     return false;
14
-}else{
15
-    $this->db= new DBAPI;
14
+} else {
15
+    $this->db = new DBAPI;
16 16
     return true;
17 17
 }
Please login to merge, or discard this patch.
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,11 +7,13 @@
 block discarded – undo
7 7
 
8 8
 global $database_type;
9 9
 
10
-if (empty($database_type)) $database_type = 'mysql';
10
+if (empty($database_type)) {
11
+    $database_type = 'mysql';
12
+}
11 13
 
12
-if (!include_once MODX_MANAGER_PATH . 'includes/extenders/dbapi.' . $database_type . '.class.inc.php'){
14
+if (!include_once MODX_MANAGER_PATH . 'includes/extenders/dbapi.' . $database_type . '.class.inc.php') {
13 15
     return false;
14
-}else{
16
+} else {
15 17
     $this->db= new DBAPI;
16 18
     return true;
17 19
 }
Please login to merge, or discard this patch.
manager/includes/extenders/phpcompat.class.inc.php 3 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -2,26 +2,26 @@
 block discarded – undo
2 2
 // todo file_put_contents(), strftime(), mb_*()
3 3
 class PHPCOMPAT
4 4
 {
5
-	function __construct()
6
-	{
7
-	}
5
+    function __construct()
6
+    {
7
+    }
8 8
 	
9
-	function htmlspecialchars($str='', $flags = ENT_COMPAT, $encode='')
10
-	{
11
-		global $modx;
9
+    function htmlspecialchars($str='', $flags = ENT_COMPAT, $encode='')
10
+    {
11
+        global $modx;
12 12
 		
13
-		if($str=='') return '';
13
+        if($str=='') return '';
14 14
 		
15
-		if($encode=='') $encode = $modx->config['modx_charset'];
15
+        if($encode=='') $encode = $modx->config['modx_charset'];
16 16
 		
17
-		$ent_str = htmlspecialchars($str, $flags, $encode);
17
+        $ent_str = htmlspecialchars($str, $flags, $encode);
18 18
 		
19
-		if(!empty($str) && empty($ent_str))
20
-		{
21
-			$detect_order = implode(',', mb_detect_order());
22
-			$ent_str = mb_convert_encoding($str, $encode, $detect_order); 
23
-		}
19
+        if(!empty($str) && empty($ent_str))
20
+        {
21
+            $detect_order = implode(',', mb_detect_order());
22
+            $ent_str = mb_convert_encoding($str, $encode, $detect_order); 
23
+        }
24 24
 		
25
-		return $ent_str;
26
-	}
25
+        return $ent_str;
26
+    }
27 27
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,17 +6,17 @@
 block discarded – undo
6 6
 	{
7 7
 	}
8 8
 	
9
-	function htmlspecialchars($str='', $flags = ENT_COMPAT, $encode='')
9
+	function htmlspecialchars($str = '', $flags = ENT_COMPAT, $encode = '')
10 10
 	{
11 11
 		global $modx;
12 12
 		
13
-		if($str=='') return '';
13
+		if ($str == '') return '';
14 14
 		
15
-		if($encode=='') $encode = $modx->config['modx_charset'];
15
+		if ($encode == '') $encode = $modx->config['modx_charset'];
16 16
 		
17 17
 		$ent_str = htmlspecialchars($str, $flags, $encode);
18 18
 		
19
-		if(!empty($str) && empty($ent_str))
19
+		if (!empty($str) && empty($ent_str))
20 20
 		{
21 21
 			$detect_order = implode(',', mb_detect_order());
22 22
 			$ent_str = mb_convert_encoding($str, $encode, $detect_order); 
Please login to merge, or discard this patch.
Braces   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,14 +10,17 @@
 block discarded – undo
10 10
 	{
11 11
 		global $modx;
12 12
 		
13
-		if($str=='') return '';
13
+		if($str=='') {
14
+		    return '';
15
+		}
14 16
 		
15
-		if($encode=='') $encode = $modx->config['modx_charset'];
17
+		if($encode=='') {
18
+		    $encode = $modx->config['modx_charset'];
19
+		}
16 20
 		
17 21
 		$ent_str = htmlspecialchars($str, $flags, $encode);
18 22
 		
19
-		if(!empty($str) && empty($ent_str))
20
-		{
23
+		if(!empty($str) && empty($ent_str)) {
21 24
 			$detect_order = implode(',', mb_detect_order());
22 25
 			$ent_str = mb_convert_encoding($str, $encode, $detect_order); 
23 26
 		}
Please login to merge, or discard this patch.
manager/includes/extenders/ex_modxmailer.inc.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@
 block discarded – undo
6 6
  * Time: 14:17
7 7
  */
8 8
 
9
-if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/modxmailer.class.inc.php')){
9
+if (!include_once(MODX_MANAGER_PATH.'includes/extenders/modxmailer.class.inc.php')) {
10 10
     return false;
11
-}else{
11
+} else {
12 12
     $this->mail = new MODxMailer;
13 13
     $this->mail->init($this);
14 14
     return true;
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@
 block discarded – undo
6 6
  * Time: 14:17
7 7
  */
8 8
 
9
-if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/modxmailer.class.inc.php')){
9
+if (!include_once(MODX_MANAGER_PATH . 'includes/extenders/modxmailer.class.inc.php')) {
10 10
     return false;
11
-}else{
11
+} else {
12 12
     $this->mail = new MODxMailer;
13 13
     $this->mail->init($this);
14 14
     return true;
Please login to merge, or discard this patch.