Completed
Push — develop ( d0bb9b...5613ed )
by Maxim
05:28
created
manager/media/rss/rss_cache.inc 1 patch
Braces   +26 added lines, -19 removed lines patch added patch discarded remove patch
@@ -16,12 +16,14 @@  discard block
 block discarded – undo
16 16
  *
17 17
  */
18 18
 
19
-class RSSCache {
19
+class RSSCache
20
+{
20 21
     var $BASE_CACHE = './cache';    // where the cache files are stored
21 22
     var $MAX_AGE    = 3600;         // when are files stale, default one hour
22 23
     var $ERROR      = "";           // accumulate error messages
23 24
 
24
-    function __construct($base='', $age='') {
25
+    function __construct($base='', $age='')
26
+    {
25 27
         if ( $base ) {
26 28
             $this->BASE_CACHE = $base;
27 29
         }
@@ -48,7 +50,8 @@  discard block
 block discarded – undo
48 50
     Input:      url from wich the rss file was fetched
49 51
     Output:     true on sucess
50 52
 \*=======================================================================*/
51
-    function set ($url, $rss) {
53
+    function set ($url, $rss)
54
+    {
52 55
         $this->ERROR = "";
53 56
         $cache_file = $this->file_name( $url );
54 57
         $fp = @fopen( $cache_file, 'w' );
@@ -74,7 +77,8 @@  discard block
 block discarded – undo
74 77
     Input:      url from wich the rss file was fetched
75 78
     Output:     cached object on HIT, false on MISS
76 79
 \*=======================================================================*/
77
-    function get ($url) {
80
+    function get ($url)
81
+    {
78 82
         $this->ERROR = "";
79 83
         $cache_file = $this->file_name( $url );
80 84
 
@@ -110,7 +114,8 @@  discard block
 block discarded – undo
110 114
     Input:      url from wich the rss file was fetched
111 115
     Output:     cached object on HIT, false on MISS
112 116
 \*=======================================================================*/
113
-    function check_cache ( $url ) {
117
+    function check_cache ( $url )
118
+    {
114 119
         $this->ERROR = "";
115 120
         $filename = $this->file_name( $url );
116 121
 
@@ -122,26 +127,24 @@  discard block
 block discarded – undo
122 127
             if ( $this->MAX_AGE > $age ) {
123 128
                 // object exists and is current
124 129
                 return 'HIT';
125
-            }
126
-            else {
130
+            } else {
127 131
                 // object exists but is old
128 132
                 return 'STALE';
129 133
             }
130
-        }
131
-        else {
134
+        } else {
132 135
             // object does not exist
133 136
             return 'MISS';
134 137
         }
135 138
     }
136 139
 
137
-	function cache_age( $cache_key ) {
140
+	function cache_age( $cache_key )
141
+	{
138 142
 		$filename = $this->file_name( $url );
139 143
 		if ( file_exists( $filename ) ) {
140 144
 			$mtime = filemtime( $filename );
141 145
             $age = time() - $mtime;
142 146
 			return $age;
143
-		}
144
-		else {
147
+		} else {
145 148
 			return -1;
146 149
 		}
147 150
 	}
@@ -149,14 +152,16 @@  discard block
 block discarded – undo
149 152
 /*=======================================================================*\
150 153
     Function:   serialize
151 154
 \*=======================================================================*/
152
-    function serialize ( $rss ) {
155
+    function serialize ( $rss )
156
+    {
153 157
         return serialize( $rss );
154 158
     }
155 159
 
156 160
 /*=======================================================================*\
157 161
     Function:   unserialize
158 162
 \*=======================================================================*/
159
-    function unserialize ( $data ) {
163
+    function unserialize ( $data )
164
+    {
160 165
         return unserialize( $data );
161 166
     }
162 167
 
@@ -166,7 +171,8 @@  discard block
 block discarded – undo
166 171
     Input:      url from wich the rss file was fetched
167 172
     Output:     a file name
168 173
 \*=======================================================================*/
169
-    function file_name ($url) {
174
+    function file_name ($url)
175
+    {
170 176
         $filename = md5( $url );
171 177
         return implode( DIRECTORY_SEPARATOR, array( $this->BASE_CACHE, $filename ) );
172 178
     }
@@ -175,7 +181,8 @@  discard block
 block discarded – undo
175 181
     Function:   error
176 182
     Purpose:    register error
177 183
 \*=======================================================================*/
178
-    function error ($errormsg, $lvl=E_USER_WARNING) {
184
+    function error ($errormsg, $lvl=E_USER_WARNING)
185
+    {
179 186
         // append PHP's error message if track_errors enabled
180 187
         if ( isset($php_errormsg) ) {
181 188
             $errormsg .= " ($php_errormsg)";
@@ -183,13 +190,13 @@  discard block
 block discarded – undo
183 190
         $this->ERROR = $errormsg;
184 191
         if ( MAGPIE_DEBUG ) {
185 192
             trigger_error( $errormsg, $lvl);
186
-        }
187
-        else {
193
+        } else {
188 194
             error_log( $errormsg, 0);
189 195
         }
190 196
     }
191 197
 
192
-    function debug ($debugmsg, $lvl=E_USER_NOTICE) {
198
+    function debug ($debugmsg, $lvl=E_USER_NOTICE)
199
+    {
193 200
         if ( MAGPIE_DEBUG ) {
194 201
             $this->error("MagpieRSS [debug] $debugmsg", $lvl);
195 202
         }
Please login to merge, or discard this patch.
install/instprocessor.php 1 patch
Braces   +61 added lines, -38 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if (file_exists(dirname(__FILE__)."/../assets/cache/siteManager.php")) {
3 3
     include_once(dirname(__FILE__)."/../assets/cache/siteManager.php");
4
-}else{
4
+} else {
5 5
     define('MGR_DIR', 'manager');
6 6
 }
7 7
 
@@ -58,13 +58,15 @@  discard block
 block discarded – undo
58 58
 
59 59
 // get base path and url
60 60
 $a = explode("install", str_replace("\\", "/", dirname($_SERVER["PHP_SELF"])));
61
-if (count($a) > 1)
61
+if (count($a) > 1) {
62 62
     array_pop($a);
63
+}
63 64
 $url = implode("install", $a);
64 65
 reset($a);
65 66
 $a = explode("install", str_replace("\\", "/", realpath(dirname(__FILE__))));
66
-if (count($a) > 1)
67
+if (count($a) > 1) {
67 68
     array_pop($a);
69
+}
68 70
 $pth = implode("install", $a);
69 71
 unset ($a);
70 72
 $base_url = $url . (substr($url, -1) != "/" ? "/" : "");
@@ -85,7 +87,9 @@  discard block
 block discarded – undo
85 87
     echo "<span class=\"notok\" style='color:#707070'>".$_lang['setup_database_selection_failed']."</span>".$_lang['setup_database_selection_failed_note']."</p>";
86 88
     $create = true;
87 89
 } else {
88
-	if (function_exists('mysqli_set_charset')) mysqli_set_charset($conn, $database_charset);
90
+	if (function_exists('mysqli_set_charset')) {
91
+	    mysqli_set_charset($conn, $database_charset);
92
+	}
89 93
     mysqli_query($conn, "{$database_connection_method} {$database_connection_charset}");
90 94
     echo '<span class="ok">'.$_lang['ok']."</span></p>";
91 95
 }
@@ -132,7 +136,8 @@  discard block
 block discarded – undo
132 136
      * @param string $propertyString
133 137
      * @return array
134 138
      */
135
-    function parseProperties($propertyString) {
139
+    function parseProperties($propertyString)
140
+    {
136 141
         $parameter= array ();
137 142
         if (!empty ($propertyString)) {
138 143
             $tmpParams= explode("&", $propertyString);
@@ -141,11 +146,14 @@  discard block
 block discarded – undo
141 146
                 if (strpos($tmpParams[$x], '=', 0)) {
142 147
                     $pTmp= explode("=", $tmpParams[$x]);
143 148
                     $pvTmp= explode(";", trim($pTmp[1]));
144
-                    if ($pvTmp[1] == 'list' && $pvTmp[3] != "")
145
-                        $parameter[trim($pTmp[0])]= $pvTmp[3]; //list default
149
+                    if ($pvTmp[1] == 'list' && $pvTmp[3] != "") {
150
+                                            $parameter[trim($pTmp[0])]= $pvTmp[3];
151
+                    }
152
+                    //list default
146 153
                     else
147
-                        if ($pvTmp[1] != 'list' && $pvTmp[2] != "")
148
-                            $parameter[trim($pTmp[0])]= $pvTmp[2];
154
+                        if ($pvTmp[1] != 'list' && $pvTmp[2] != "") {
155
+                                                    $parameter[trim($pTmp[0])]= $pvTmp[2];
156
+                        }
149 157
                 }
150 158
             }
151 159
         }
@@ -216,7 +224,7 @@  discard block
 block discarded – undo
216 224
 // custom or not
217 225
 if (file_exists(dirname(__FILE__)."/../../assets/cache/siteManager.php")) {
218 226
     $mgrdir = 'include_once(dirname(__FILE__)."/../../assets/cache/siteManager.php");';
219
-}else{
227
+} else {
220 228
     $mgrdir = 'define(\'MGR_DIR\', \'manager\');';
221 229
 }
222 230
 
@@ -352,7 +360,9 @@  discard block
 block discarded – undo
352 360
                         echo "<p>" . mysqli_error($sqlParser->conn) . "</p>";
353 361
                         return;
354 362
                     }
355
-                    if(!is_null($save_sql_id_as)) $custom_placeholders[$save_sql_id_as] = @mysqli_insert_id($sqlParser->conn);
363
+                    if(!is_null($save_sql_id_as)) {
364
+                        $custom_placeholders[$save_sql_id_as] = @mysqli_insert_id($sqlParser->conn);
365
+                    }
356 366
                     echo "<p>&nbsp;&nbsp;$name: <span class=\"ok\">" . $_lang['installed'] . "</span></p>";
357 367
                 }
358 368
             }
@@ -446,9 +456,9 @@  discard block
 block discarded – undo
446 456
             $overwrite = mysqli_real_escape_string($conn, $moduleChunk[4]);
447 457
             $filecontent = $moduleChunk[2];
448 458
 
449
-            if (!file_exists($filecontent))
450
-                echo "<p>&nbsp;&nbsp;$name: <span class=\"notok\">" . $_lang['unable_install_chunk'] . " '$filecontent' " . $_lang['not_found'] . ".</span></p>";
451
-            else {
459
+            if (!file_exists($filecontent)) {
460
+                            echo "<p>&nbsp;&nbsp;$name: <span class=\"notok\">" . $_lang['unable_install_chunk'] . " '$filecontent' " . $_lang['not_found'] . ".</span></p>";
461
+            } else {
452 462
 
453 463
                 // Create the category if it does not already exist
454 464
                 $category_id = getCreateDbCategory($category, $sqlParser);
@@ -500,9 +510,9 @@  discard block
 block discarded – undo
500 510
             $guid = mysqli_real_escape_string($conn, $moduleModule[4]);
501 511
             $shared = mysqli_real_escape_string($conn, $moduleModule[5]);
502 512
             $category = mysqli_real_escape_string($conn, $moduleModule[6]);
503
-            if (!file_exists($filecontent))
504
-                echo "<p>&nbsp;&nbsp;$name: <span class=\"notok\">" . $_lang['unable_install_module'] . " '$filecontent' " . $_lang['not_found'] . ".</span></p>";
505
-            else {
513
+            if (!file_exists($filecontent)) {
514
+                            echo "<p>&nbsp;&nbsp;$name: <span class=\"notok\">" . $_lang['unable_install_module'] . " '$filecontent' " . $_lang['not_found'] . ".</span></p>";
515
+            } else {
506 516
 
507 517
                 // Create the category if it does not already exist
508 518
                 $category = getCreateDbCategory($category, $sqlParser);
@@ -552,9 +562,9 @@  discard block
 block discarded – undo
552 562
                 // parse comma-separated legacy names and prepare them for sql IN clause
553 563
                 $leg_names = "'" . implode("','", preg_split('/\s*,\s*/', mysqli_real_escape_string($conn, $modulePlugin[7]))) . "'";
554 564
             }
555
-            if (!file_exists($filecontent))
556
-                echo "<p>&nbsp;&nbsp;$name: <span class=\"notok\">" . $_lang['unable_install_plugin'] . " '$filecontent' " . $_lang['not_found'] . ".</span></p>";
557
-            else {
565
+            if (!file_exists($filecontent)) {
566
+                            echo "<p>&nbsp;&nbsp;$name: <span class=\"notok\">" . $_lang['unable_install_plugin'] . " '$filecontent' " . $_lang['not_found'] . ".</span></p>";
567
+            } else {
558 568
 
559 569
                 // disable legacy versions based on legacy_names provided
560 570
                 if(!empty($leg_names)) {
@@ -573,7 +583,7 @@  discard block
 block discarded – undo
573 583
                     $insert = true;
574 584
                     while($row = mysqli_fetch_assoc($rs)) {
575 585
                         $props = mysqli_real_escape_string($conn, propUpdate($properties,$row['properties']));
576
-                        if($row['description'] == $desc){
586
+                        if($row['description'] == $desc) {
577 587
                             if (! mysqli_query($sqlParser->conn, "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};")) {
578 588
                                 echo "<p>" . mysqli_error($sqlParser->conn) . "</p>";
579 589
                                 return;
@@ -631,9 +641,9 @@  discard block
 block discarded – undo
631 641
             $filecontent = $moduleSnippet[2];
632 642
             $properties = $moduleSnippet[3];
633 643
             $category = mysqli_real_escape_string($conn, $moduleSnippet[4]);
634
-            if (!file_exists($filecontent))
635
-                echo "<p>&nbsp;&nbsp;$name: <span class=\"notok\">" . $_lang['unable_install_snippet'] . " '$filecontent' " . $_lang['not_found'] . ".</span></p>";
636
-            else {
644
+            if (!file_exists($filecontent)) {
645
+                            echo "<p>&nbsp;&nbsp;$name: <span class=\"notok\">" . $_lang['unable_install_snippet'] . " '$filecontent' " . $_lang['not_found'] . ".</span></p>";
646
+            } else {
637 647
 
638 648
                 // Create the category if it does not already exist
639 649
                 $category = getCreateDbCategory($category, $sqlParser);
@@ -741,13 +751,16 @@  discard block
 block discarded – undo
741 751
 }
742 752
 
743 753
 // call back function
744
-if ($callBackFnc != "")
754
+if ($callBackFnc != "") {
745 755
     $callBackFnc ($sqlParser);
756
+}
746 757
 
747 758
 // Setup the MODX API -- needed for the cache processor
748 759
 define('MODX_API_MODE', true);
749 760
 define('MODX_BASE_PATH', $base_path);
750
-if (!defined('MODX_MANAGER_PATH')) define('MODX_MANAGER_PATH', $base_path.MGR_DIR.'/');
761
+if (!defined('MODX_MANAGER_PATH')) {
762
+    define('MODX_MANAGER_PATH', $base_path.MGR_DIR.'/');
763
+}
751 764
 $database_type = 'mysqli';
752 765
 // initiate a new document parser
753 766
 include_once('../'.MGR_DIR.'/includes/document.parser.class.inc.php');
@@ -792,11 +805,12 @@  discard block
 block discarded – undo
792 805
  * @param string $old
793 806
  * @return string
794 807
  */
795
-function propUpdate($new,$old){
808
+function propUpdate($new,$old)
809
+{
796 810
     $newArr = parseProperties($new);
797 811
     $oldArr = parseProperties($old);
798
-    foreach ($oldArr as $k => $v){
799
-        if (isset($v['0']['options'])){
812
+    foreach ($oldArr as $k => $v) {
813
+        if (isset($v['0']['options'])) {
800 814
             $oldArr[$k]['0']['options'] = $newArr[$k]['0']['options'];
801 815
         }
802 816
     }
@@ -811,12 +825,17 @@  discard block
 block discarded – undo
811 825
  * @param bool|mixed $json
812 826
  * @return string
813 827
  */
814
-function parseProperties($propertyString, $json=false) {
828
+function parseProperties($propertyString, $json=false)
829
+{
815 830
     $propertyString = str_replace('{}', '', $propertyString );
816 831
     $propertyString = str_replace('} {', ',', $propertyString );
817 832
 
818
-    if(empty($propertyString)) return array();
819
-    if($propertyString=='{}' || $propertyString=='[]') return array();
833
+    if(empty($propertyString)) {
834
+        return array();
835
+    }
836
+    if($propertyString=='{}' || $propertyString=='[]') {
837
+        return array();
838
+    }
820 839
 
821 840
     $jsonFormat = isJson($propertyString, true);
822 841
     $property = array();
@@ -858,7 +877,7 @@  discard block
 block discarded – undo
858 877
 
859 878
         }
860 879
     // new json-format
861
-    } else if(!empty($jsonFormat)){
880
+    } else if(!empty($jsonFormat)) {
862 881
         $property = $jsonFormat;
863 882
     }
864 883
     if ($json) {
@@ -873,7 +892,8 @@  discard block
 block discarded – undo
873 892
  * @param bool $returnData
874 893
  * @return bool|mixed
875 894
  */
876
-function isJson($string, $returnData=false) {
895
+function isJson($string, $returnData=false)
896
+{
877 897
     $data = json_decode($string, true);
878 898
     return (json_last_error() == JSON_ERROR_NONE) ? ($returnData ? $data : true) : false;
879 899
 }
@@ -883,7 +903,8 @@  discard block
 block discarded – undo
883 903
  * @param SqlParser $sqlParser
884 904
  * @return int
885 905
  */
886
-function getCreateDbCategory($category, $sqlParser) {
906
+function getCreateDbCategory($category, $sqlParser)
907
+{
887 908
     $dbase = $sqlParser->dbname;
888 909
     $dbase = '`' . trim($dbase,'`') . '`';
889 910
     $table_prefix = $sqlParser->prefix;
@@ -911,7 +932,8 @@  discard block
 block discarded – undo
911 932
  * @param string $type
912 933
  * @return string
913 934
  */
914
-function removeDocblock($code, $type) {
935
+function removeDocblock($code, $type)
936
+{
915 937
 
916 938
     $cleaned = preg_replace("/^.*?\/\*\*.*?\*\/\s+/s", '', $code, 1);
917 939
 
@@ -932,8 +954,9 @@  discard block
 block discarded – undo
932 954
         default:
933 955
             return $cleaned;
934 956
     };
935
-    if(substr(trim($cleaned),0,$count) == $include.' MODX_BASE_PATH.\'assets/'.$elm_name.'/')
936
-        return $cleaned;
957
+    if(substr(trim($cleaned),0,$count) == $include.' MODX_BASE_PATH.\'assets/'.$elm_name.'/') {
958
+            return $cleaned;
959
+    }
937 960
 
938 961
     // fileBinding not found - return code incl docblock
939 962
     return $code;
Please login to merge, or discard this patch.
manager/frames/1.php 1 patch
Braces   +29 added lines, -26 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 header("X-XSS-Protection: 0");
@@ -11,22 +11,22 @@  discard block
 block discarded – undo
11 11
 
12 12
 $mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en';
13 13
 
14
-if (!isset($modx->config['manager_menu_height'])) {
14
+if (!isset($modx->config['manager_menu_height'])) {
15 15
     $modx->config['manager_menu_height'] = 2.2; // rem
16 16
 }
17 17
 
18
-if (!isset($modx->config['manager_tree_width'])) {
18
+if (!isset($modx->config['manager_tree_width'])) {
19 19
     $modx->config['manager_tree_width'] = 20; // rem
20 20
 }
21 21
 
22
-if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) {
22
+if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) {
23 23
     $initMainframeAction = $_SESSION['onLoginForwardToAction'];
24 24
     unset($_SESSION['onLoginForwardToAction']);
25
-} else {
25
+} else {
26 26
     $initMainframeAction = 2; // welcome.static
27 27
 }
28 28
 
29
-if (!isset($_SESSION['tree_show_only_folders'])) {
29
+if (!isset($_SESSION['tree_show_only_folders'])) {
30 30
     $_SESSION['tree_show_only_folders'] = 0;
31 31
 }
32 32
 
@@ -35,21 +35,21 @@  discard block
 block discarded – undo
35 35
 $tree_width = $modx->config['manager_tree_width'];
36 36
 $tree_min_width = 0;
37 37
 
38
-if (isset($_COOKIE['MODX_widthSideBar'])) {
38
+if (isset($_COOKIE['MODX_widthSideBar'])) {
39 39
     $MODX_widthSideBar = $_COOKIE['MODX_widthSideBar'];
40
-} else {
40
+} else {
41 41
     $MODX_widthSideBar = $tree_width;
42 42
 }
43 43
 
44
-if (!$MODX_widthSideBar) {
44
+if (!$MODX_widthSideBar) {
45 45
     $body_class .= 'sidebar-closed';
46 46
 }
47 47
 
48
-if (isset($_COOKIE['MODX_themeColor'])) {
48
+if (isset($_COOKIE['MODX_themeColor'])) {
49 49
     $body_class .= ' ' . $_COOKIE['MODX_themeColor'];
50 50
 }
51 51
 
52
-if (isset($modx->pluginCache['ElementsInTree'])) {
52
+if (isset($modx->pluginCache['ElementsInTree'])) {
53 53
     $body_class .= ' ElementsInTree';
54 54
 }
55 55
 
@@ -65,19 +65,19 @@  discard block
 block discarded – undo
65 65
     'type8' => $_lang["lock_element_type_8"]
66 66
 );
67 67
 
68
-foreach ($unlockTranslations as $key => $value) {
68
+foreach ($unlockTranslations as $key => $value) {
69 69
     $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value);
70 70
 }
71 71
 
72 72
 $user = $modx->getUserInfo($modx->getLoginUserID());
73
-if ($user['which_browser'] == 'default') {
73
+if ($user['which_browser'] == 'default') {
74 74
     $user['which_browser'] = $modx->config['which_browser'];
75 75
 }
76 76
 
77 77
 $css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime;
78 78
 
79
-if ($modx->config['manager_theme'] == 'default') {
80
-    if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
79
+if ($modx->config['manager_theme'] == 'default') {
80
+    if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
81 81
         require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php';
82 82
         $minifier = new Formatter\CSSMinify();
83 83
         $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css');
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         $css = $minifier->minify();
95 95
         file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css);
96 96
     }
97
-    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
97
+    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
98 98
         $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime;
99 99
     }
100 100
 }
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
     <?php
249 249
     // invoke OnManagerTopPrerender event
250 250
     $evtOut = $modx->invokeEvent('OnManagerTopPrerender', $_REQUEST);
251
-    if (is_array($evtOut)) {
251
+    if (is_array($evtOut)) {
252 252
         echo implode("\n", $evtOut);
253 253
     }
254 254
     ?>
@@ -419,9 +419,12 @@  discard block
 block discarded – undo
419 419
             <div id="evo-tab-page-home" class="evo-tab-page show">
420 420
                 <iframe id="mainframe" src="index.php?a=<?= $initMainframeAction ?>" scrolling="auto" frameborder="0" onload="modx.main.onload(event);"></iframe>
421 421
             </div>
422
-        <?php else: ?>
422
+        <?php else {
423
+    : ?>
423 424
             <iframe id="mainframe" name="main" src="index.php?a=<?= $initMainframeAction ?>" scrolling="auto" frameborder="0" onload="modx.main.onload(event);"></iframe>
424
-        <?php endif; ?>
425
+        <?php endif;
426
+}
427
+?>
425 428
         <div id="mainloader"></div>
426 429
     </div>
427 430
     <div id="resizer"></div>
@@ -434,11 +437,11 @@  discard block
 block discarded – undo
434 437
             'tree_sortdir',
435 438
             'tree_nodename'
436 439
         );
437
-        foreach ($sortParams as $param) {
438
-            if (isset($_REQUEST[$param])) {
440
+        foreach ($sortParams as $param) {
441
+            if (isset($_REQUEST[$param])) {
439 442
                 $modx->manager->saveLastUserSetting($param, $_REQUEST[$param]);
440 443
                 $_SESSION[$param] = $_REQUEST[$param];
441
-            } else if (!isset($_SESSION[$param])) {
444
+            } else if (!isset($_SESSION[$param])) {
442 445
                 $_SESSION[$param] = $modx->manager->getLastUserSetting($param);
443 446
             }
444 447
         }
@@ -524,9 +527,9 @@  discard block
 block discarded – undo
524 527
      * @param string $text
525 528
      * @param bool $allowed
526 529
      */
527
-    function constructLink($action, $img, $text, $allowed)
528
-    {
529
-        if ((bool)$allowed) {
530
+    function constructLink($action, $img, $text, $allowed)
531
+    {
532
+        if ((bool)$allowed) {
530 533
             echo sprintf('<div class="menuLink" id="item%s" onclick="modx.tree.menuHandler(%s);">', $action, $action);
531 534
             echo sprintf('<i class="%s"></i> %s</div>', $img, $text);
532 535
         }
@@ -631,7 +634,7 @@  discard block
 block discarded – undo
631 634
     ?>
632 635
 
633 636
 </div>
634
-<?php if ($modx->config['show_picker'] != "0") {
637
+<?php if ($modx->config['show_picker'] != "0") {
635 638
     include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php');
636 639
 } ?>
637 640
 </body>
Please login to merge, or discard this patch.
manager/actions/mutate_settings/functions.inc.php 1 patch
Braces   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -5,13 +5,13 @@  discard block
 block discarded – undo
5 5
  * @param string $filename
6 6
  * @return array of keys from a language file
7 7
  */
8
-function get_lang_keys($filename)
9
-{
8
+function get_lang_keys($filename)
9
+{
10 10
     $file = MODX_MANAGER_PATH . 'includes/lang' . DIRECTORY_SEPARATOR . $filename;
11
-    if (is_file($file) && is_readable($file)) {
11
+    if (is_file($file) && is_readable($file)) {
12 12
         include($file);
13 13
         $out = isset($_lang) ? array_keys($_lang) : array();
14
-    } else {
14
+    } else {
15 15
         $out = array();
16 16
     }
17 17
 
@@ -24,12 +24,12 @@  discard block
 block discarded – undo
24 24
  * @param string $key
25 25
  * @return array of languages that define the key in their file
26 26
  */
27
-function get_langs_by_key($key)
28
-{
27
+function get_langs_by_key($key)
28
+{
29 29
     global $lang_keys;
30 30
     $lang_return = array();
31
-    foreach ($lang_keys as $lang => $keys) {
32
-        if (in_array($key, $keys)) {
31
+    foreach ($lang_keys as $lang => $keys) {
32
+        if (in_array($key, $keys)) {
33 33
             $lang_return[] = $lang;
34 34
         }
35 35
     }
@@ -46,25 +46,25 @@  discard block
 block discarded – undo
46 46
  * @param string $selected_lang specify language to select in option list, default none
47 47
  * @return string html option list
48 48
  */
49
-function get_lang_options($key = '', $selected_lang = '')
50
-{
49
+function get_lang_options($key = '', $selected_lang = '')
50
+{
51 51
     global $lang_keys, $_lang;
52 52
     $lang_options = '';
53
-    if (!empty($key)) {
53
+    if (!empty($key)) {
54 54
         $languages = get_langs_by_key($key);
55 55
         sort($languages);
56 56
         $lang_options .= '<option value="">' . $_lang['language_title'] . '</option>';
57 57
 
58
-        foreach ($languages as $language_name) {
58
+        foreach ($languages as $language_name) {
59 59
             $uclanguage_name = ucwords(str_replace("_", " ", $language_name));
60 60
             $lang_options .= '<option value="' . $language_name . '">' . $uclanguage_name . '</option>';
61 61
         }
62 62
 
63 63
         return $lang_options;
64
-    } else {
64
+    } else {
65 65
         $languages = array_keys($lang_keys);
66 66
         sort($languages);
67
-        foreach ($languages as $language_name) {
67
+        foreach ($languages as $language_name) {
68 68
             $uclanguage_name = ucwords(str_replace("_", " ", $language_name));
69 69
             $sel = $language_name === $selected_lang ? ' selected="selected"' : '';
70 70
             $lang_options .= '<option value="' . $language_name . '" ' . $sel . '>' . $uclanguage_name . '</option>';
@@ -81,17 +81,17 @@  discard block
 block discarded – undo
81 81
  * @param bool $disabled
82 82
  * @return string
83 83
  */
84
-function form_radio($name, $value, $add = '', $disabled = false)
85
-{
84
+function form_radio($name, $value, $add = '', $disabled = false)
85
+{
86 86
     global ${$name};
87 87
     $var = ${$name};
88 88
     $checked = ($var == $value) ? ' checked="checked"' : '';
89
-    if ($disabled) {
89
+    if ($disabled) {
90 90
         $disabled = ' disabled';
91
-    } else {
91
+    } else {
92 92
         $disabled = '';
93 93
     }
94
-    if ($add) {
94
+    if ($add) {
95 95
         $add = ' ' . $add;
96 96
     }
97 97
 
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
104 104
  * @param string $object
105 105
  * @return string
106 106
  */
107
-function wrap_label($str = '', $object)
108
-{
107
+function wrap_label($str = '', $object)
108
+{
109 109
     return "<label>{$object}\n{$str}</label>";
110 110
 }
111 111
 
@@ -114,13 +114,13 @@  discard block
 block discarded – undo
114 114
  * @param array $ph
115 115
  * @return string
116 116
  */
117
-function parseText($tpl = '', $ph = array())
118
-{
119
-    if (empty($ph) || empty($tpl)) {
117
+function parseText($tpl = '', $ph = array())
118
+{
119
+    if (empty($ph) || empty($tpl)) {
120 120
         return $tpl;
121 121
     }
122 122
 
123
-    foreach ($ph as $k => $v) {
123
+    foreach ($ph as $k => $v) {
124 124
         $k = "[+{$k}+]";
125 125
         $tpl = str_replace($k, $v, $tpl);
126 126
     }
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
  * @param bool $cond
133 133
  * @return string
134 134
  */
135
-function showHide($cond = true)
136
-{
135
+function showHide($cond = true)
136
+{
137 137
     global $displayStyle;
138 138
     $showHide = $cond ? $displayStyle : 'none';
139 139
 
Please login to merge, or discard this patch.
manager/actions/mutate_module.dynamic.php 1 patch
Braces   +22 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-switch($modx->manager->action) {
5
+switch($modx->manager->action) {
6 6
 	case 107:
7
-		if(!$modx->hasPermission('new_module')) {
7
+		if(!$modx->hasPermission('new_module')) {
8 8
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
9 9
 		}
10 10
 		break;
11 11
 	case 108:
12
-		if(!$modx->hasPermission('edit_module')) {
12
+		if(!$modx->hasPermission('edit_module')) {
13 13
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
14 14
 		}
15 15
 		break;
@@ -33,7 +33,8 @@  discard block
 block discarded – undo
33 33
  *
34 34
  * @return string
35 35
  */
36
-function createGUID() {
36
+function createGUID()
37
+{
37 38
 	srand((double) microtime() * 1000000);
38 39
 	$r = rand();
39 40
 	$u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1);
@@ -42,7 +43,7 @@  discard block
 block discarded – undo
42 43
 }
43 44
 
44 45
 // check to see the module editor isn't locked
45
-if($lockedEl = $modx->elementIsLocked(6, $id)) {
46
+if($lockedEl = $modx->elementIsLocked(6, $id)) {
46 47
 	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module']));
47 48
 }
48 49
 // end check for lock
@@ -50,22 +51,22 @@  discard block
 block discarded – undo
50 51
 // Lock snippet for other users to edit
51 52
 $modx->lockElement(6, $id);
52 53
 
53
-if(isset($_GET['id'])) {
54
+if(isset($_GET['id'])) {
54 55
 	$rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'");
55 56
 	$content = $modx->db->getRow($rs);
56
-	if(!$content) {
57
+	if(!$content) {
57 58
 		$modx->webAlertAndQuit("Module not found for id '{$id}'.");
58 59
 	}
59 60
 	$content['properties'] = str_replace("&", "&amp;", $content['properties']);
60 61
 	$_SESSION['itemname'] = $content['name'];
61
-	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
62
+	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
62 63
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
63 64
 	}
64
-} else {
65
+} else {
65 66
 	$_SESSION['itemname'] = $_lang["new_module"];
66 67
 	$content['wrap'] = '1';
67 68
 }
68
-if($modx->manager->hasFormValues()) {
69
+if($modx->manager->hasFormValues()) {
69 70
 	$modx->manager->loadFormValues();
70 71
 }
71 72
 
@@ -439,7 +440,7 @@  discard block
 block discarded – undo
439 440
 	<?php
440 441
 	// invoke OnModFormPrerender event
441 442
 	$evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
442
-	if(is_array($evtOut)) {
443
+	if(is_array($evtOut)) {
443 444
 		echo implode('', $evtOut);
444 445
 	}
445 446
 
@@ -502,7 +503,7 @@  discard block
 block discarded – undo
502 503
 								<option>&nbsp;</option>
503 504
 								<?php
504 505
 								include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
505
-								foreach(getCategories() as $n => $v) {
506
+								foreach(getCategories() as $n => $v) {
506 507
 									echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n";
507 508
 								}
508 509
 								?>
@@ -654,7 +655,7 @@  discard block
 block discarded – undo
654 655
 					$rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'");
655 656
 					$groupsarray = $modx->db->getColumn('usergroup', $rs);
656 657
 
657
-					if($modx->hasPermission('access_permissions')) {
658
+					if($modx->hasPermission('access_permissions')) {
658 659
 						?>
659 660
 						<!-- User Group Access Permissions -->
660 661
 						<script type="text/javascript">
@@ -682,21 +683,21 @@  discard block
 block discarded – undo
682 683
 					}
683 684
 					$chk = '';
684 685
 					$rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name');
685
-					while($row = $modx->db->getRow($rs)) {
686
+					while($row = $modx->db->getRow($rs)) {
686 687
 						$groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array();
687 688
 						$checked = in_array($row['id'], $groupsarray);
688
-						if($modx->hasPermission('access_permissions')) {
689
-							if($checked) {
689
+						if($modx->hasPermission('access_permissions')) {
690
+							if($checked) {
690 691
 								$notPublic = true;
691 692
 							}
692 693
 							$chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n";
693
-						} else {
694
-							if($checked) {
694
+						} else {
695
+							if($checked) {
695 696
 								$chks = '<input type="hidden" name="usrgroups[]"  value="' . $row['id'] . '" />' . "\n" . $chks;
696 697
 							}
697 698
 						}
698 699
 					}
699
-					if($modx->hasPermission('access_permissions')) {
700
+					if($modx->hasPermission('access_permissions')) {
700 701
 						$chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks;
701 702
 					}
702 703
 					echo $chks;
@@ -718,7 +719,7 @@  discard block
 block discarded – undo
718 719
 		<?php
719 720
 		// invoke OnModFormRender event
720 721
 		$evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
721
-		if(is_array($evtOut)) {
722
+		if(is_array($evtOut)) {
722 723
 			echo implode('', $evtOut);
723 724
 		}
724 725
 		?>
Please login to merge, or discard this patch.
manager/actions/logging.static.php 1 patch
Braces   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if (!$modx->hasPermission('logs')) {
5
+if (!$modx->hasPermission('logs')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -11,17 +11,17 @@  discard block
 block discarded – undo
11 11
  * @param string $checkKey
12 12
  * @return array
13 13
  */
14
-function array_unique_multi($array, $checkKey)
15
-{
14
+function array_unique_multi($array, $checkKey)
15
+{
16 16
     // Use the builtin if we're not a multi-dimensional array
17
-    if (!is_array(current($array)) || empty($checkKey)) {
17
+    if (!is_array(current($array)) || empty($checkKey)) {
18 18
         return array_unique($array);
19 19
     }
20 20
 
21 21
     $ret = array();
22 22
     $checkValues = array(); // contains the unique key Values
23
-    foreach ($array as $key => $current) {
24
-        if (in_array($current[$checkKey], $checkValues)) {
23
+    foreach ($array as $key => $current) {
24
+        if (in_array($current[$checkKey], $checkValues)) {
25 25
             continue;
26 26
         } // duplicate
27 27
 
@@ -36,17 +36,17 @@  discard block
 block discarded – undo
36 36
  * @param string $key
37 37
  * @return array
38 38
  */
39
-function record_sort($array, $key)
40
-{
39
+function record_sort($array, $key)
40
+{
41 41
     $hash = array();
42
-    foreach ($array as $k => $v) {
42
+    foreach ($array as $k => $v) {
43 43
         $hash[$k] = $v[$key];
44 44
     }
45 45
 
46 46
     natsort($hash);
47 47
 
48 48
     $records = array();
49
-    foreach ($hash as $k => $row) {
49
+    foreach ($hash as $k => $row) {
50 50
         $records[$k] = $array[$k];
51 51
     }
52 52
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
                             <?php
74 74
                             // get all users currently in the log
75 75
                             $logs_user = record_sort(array_unique_multi($logs, 'internalKey'), 'username');
76
-                            foreach ($logs_user as $row) {
76
+                            foreach ($logs_user as $row) {
77 77
                                 $selectedtext = $row['internalKey'] == $_REQUEST['searchuser'] ? ' selected="selected"' : '';
78 78
                                 echo "\t\t" . '<option value="' . $row['internalKey'] . '"' . $selectedtext . '>' . $row['username'] . "</option>\n";
79 79
                             }
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
                             // get all available actions in the log
91 91
                             include_once "actionlist.inc.php";
92 92
                             $logs_actions = record_sort(array_unique_multi($logs, 'action'), 'action');
93
-                            foreach ($logs_actions as $row) {
93
+                            foreach ($logs_actions as $row) {
94 94
                                 $action = getAction($row['action']);
95
-                                if ($action == 'Idle') {
95
+                                if ($action == 'Idle') {
96 96
                                     continue;
97 97
                                 }
98 98
                                 $selectedtext = $row['action'] == $_REQUEST['action'] ? ' selected="selected"' : '';
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
                             <?php
111 111
                             // get all itemid currently in logging
112 112
                             $logs_items = record_sort(array_unique_multi($logs, 'itemid'), 'itemid');
113
-                            foreach ($logs_items as $row) {
113
+                            foreach ($logs_items as $row) {
114 114
                                 $selectedtext = $row['itemid'] == $_REQUEST['itemid'] ? ' selected="selected"' : '';
115 115
                                 echo "\t\t" . '<option value="' . $row['itemid'] . '"' . $selectedtext . '>' . $row['itemid'] . "</option>\n";
116 116
                             }
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
                             <?php
127 127
                             // get all itemname currently in logging
128 128
                             $logs_names = record_sort(array_unique_multi($logs, 'itemname'), 'itemname');
129
-                            foreach ($logs_names as $row) {
129
+                            foreach ($logs_names as $row) {
130 130
                                 $selectedtext = $row['itemname'] == $_REQUEST['itemname'] ? ' selected="selected"' : '';
131 131
                                 echo "\t\t" . '<option value="' . $row['itemname'] . '"' . $selectedtext . '>' . $row['itemname'] . "</option>\n";
132 132
                             }
@@ -182,36 +182,36 @@  discard block
 block discarded – undo
182 182
     <div class="container container-body">
183 183
 
184 184
 <?php
185
-if (isset($_REQUEST['log_submit'])) {
185
+if (isset($_REQUEST['log_submit'])) {
186 186
     // get the selections the user made.
187 187
     $sqladd = array();
188
-    if ($_REQUEST['searchuser'] != 0) {
188
+    if ($_REQUEST['searchuser'] != 0) {
189 189
         $sqladd[] = "internalKey='" . (int)$_REQUEST['searchuser'] . "'";
190 190
     }
191
-    if ($_REQUEST['action'] != 0) {
191
+    if ($_REQUEST['action'] != 0) {
192 192
         $sqladd[] = "action=" . (int)$_REQUEST['action'];
193 193
     }
194
-    if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") {
194
+    if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") {
195 195
         $sqladd[] = "itemid='" . $_REQUEST['itemid'] . "'";
196 196
     }
197
-    if ($_REQUEST['itemname'] != '0') {
197
+    if ($_REQUEST['itemname'] != '0') {
198 198
         $sqladd[] = "itemname='" . $modx->db->escape($_REQUEST['itemname']) . "'";
199 199
     }
200
-    if ($_REQUEST['message'] != "") {
200
+    if ($_REQUEST['message'] != "") {
201 201
         $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'";
202 202
     }
203 203
     // date stuff
204
-    if ($_REQUEST['datefrom'] != "") {
204
+    if ($_REQUEST['datefrom'] != "") {
205 205
         $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']);
206 206
     }
207
-    if ($_REQUEST['dateto'] != "") {
207
+    if ($_REQUEST['dateto'] != "") {
208 208
         $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']);
209 209
     }
210 210
 
211 211
     // If current position is not set, set it to zero
212
-    if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) {
212
+    if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) {
213 213
         $int_cur_position = 0;
214
-    } else {
214
+    } else {
215 215
         $int_cur_position = $_REQUEST['int_cur_position'];
216 216
     }
217 217
 
@@ -225,9 +225,9 @@  discard block
 block discarded – undo
225 225
 
226 226
     $rs = $modx->db->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}");
227 227
 
228
-if ($limit < 1) {
228
+if ($limit < 1) {
229 229
     echo '<p>' . $_lang["mgrlog_emptysrch"] . '</p>';
230
-} else {
230
+} else {
231 231
     echo '<p>' . $_lang["mgrlog_sortinst"] . '</p>';
232 232
 
233 233
     include_once "paginate.inc.php";
@@ -246,14 +246,14 @@  discard block
 block discarded – undo
246 246
     $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? "</a> " : " ");
247 247
     $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? "</a> " : " ");
248 248
     $pagesfound = sizeof($array_row_paging);
249
-    if ($pagesfound > 6) {
249
+    if ($pagesfound > 6) {
250 250
         $paging .= $array_row_paging[$current_row - 2]; // ."&nbsp;";
251 251
         $paging .= $array_row_paging[$current_row - 1]; // ."&nbsp;";
252 252
         $paging .= $array_row_paging[$current_row]; // ."&nbsp;";
253 253
         $paging .= $array_row_paging[$current_row + 1]; // ."&nbsp;";
254 254
         $paging .= $array_row_paging[$current_row + 2]; // ."&nbsp;";
255
-    } else {
256
-        for ($i = 0; $i < $pagesfound; $i++) {
255
+    } else {
256
+        for ($i = 0; $i < $pagesfound; $i++) {
257 257
             $paging .= $array_row_paging[$i] . "&nbsp;";
258 258
         }
259 259
     }
@@ -288,12 +288,12 @@  discard block
 block discarded – undo
288 288
                 // grab the entire log file...
289 289
                 $logentries = array();
290 290
                 $i = 0;
291
-                while ($logentry = $modx->db->getRow($rs)) {
292
-                    if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) {
291
+                while ($logentry = $modx->db->getRow($rs)) {
292
+                    if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) {
293 293
                         $item = '<div style="text-align:center;">-</div>';
294
-                    } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) {
294
+                    } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) {
295 295
                         $item = '<a href="index.php?a=3&amp;id=' . $logentry['itemid'] . '">' . $logentry['itemname'] . '</a>';
296
-                    } else {
296
+                    } else {
297 297
                         $item = $logentry['itemname'];
298 298
                     }
299 299
                     //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true'
@@ -328,6 +328,6 @@  discard block
 block discarded – undo
328 328
     // @see index.php @ 915
329 329
     global $action;
330 330
     $action = 1;
331
-} else {
331
+} else {
332 332
     echo $_lang["mgrlog_noquery"];
333 333
 }
Please login to merge, or discard this patch.
manager/actions/help/01About_EVO.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,12 +23,15 @@
 block discarded – undo
23 23
  * @param array $linkArr
24 24
  * @return string
25 25
  */
26
-function createList($sectionHeader, $linkArr) {
26
+function createList($sectionHeader, $linkArr)
27
+{
27 28
 	$output = '<div class="sectionHeader">'.$sectionHeader.'</div><div class="sectionBody">'."\n";
28 29
 	$output .= '<table width="500"  border="0" cellspacing="0" cellpadding="0">'."\n";
29 30
 	$links = '';
30 31
 	foreach($linkArr as $row) {
31
-		if (!is_array($row['link'])) $row['link'] = array($row['link']);
32
+		if (!is_array($row['link'])) {
33
+		    $row['link'] = array($row['link']);
34
+		}
32 35
 		foreach ($row['link'] as $link) {
33 36
 			$links .= $links != '' ? '<br/>' : '';
34 37
 			$links .= '<a href="' . $link . '" target="_blank">' . $link . '</a>';
Please login to merge, or discard this patch.
manager/includes/actionlist.inc.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -139,11 +139,14 @@
 block discarded – undo
139 139
  * @param string $itemid
140 140
  * @return string
141 141
  */
142
-function getAction($actionId, $itemid='') {
142
+function getAction($actionId, $itemid='')
143
+{
143 144
 	global $action_list;
144 145
 
145 146
 	$ret = sprintf($action_list[$actionId], $itemid);
146
-	if (!$ret) $ret = "Idle (unknown)";
147
+	if (!$ret) {
148
+	    $ret = "Idle (unknown)";
149
+	}
147 150
 
148 151
 	return $ret;
149 152
 }
Please login to merge, or discard this patch.
manager/includes/extenders/ex_dbapi.inc.php 1 patch
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,15 +7,17 @@
 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 14
 $out = false;
13 15
 $class = 'DBAPI';
14
-if( ! class_exists($class)){
16
+if( ! class_exists($class)) {
15 17
     include_once MODX_MANAGER_PATH . 'includes/extenders/dbapi.' . $database_type . '.class.inc.php';
16 18
 }
17 19
 
18
-if(class_exists($class)){
20
+if(class_exists($class)) {
19 21
     $this->db= new $class;
20 22
     $out = true;
21 23
 }
Please login to merge, or discard this patch.