Completed
Push — develop ( 923a1c...1e9876 )
by Maxim
47s queued 29s
created
manager/actions/category_mgr/inc/Categories.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 {
7 7
     var $db       = '';
8 8
     var $db_tbl   = array();    
9
-    var $elements = array( 'templates', 'tmplvars', 'htmlsnippets', 'snippets', 'plugins', 'modules' );
9
+    var $elements = array('templates', 'tmplvars', 'htmlsnippets', 'snippets', 'plugins', 'modules');
10 10
 
11 11
     function __construct()
12 12
     {
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
         $this->db                   = & $modx->db;
16 16
         $this->db_tbl['categories'] = $modx->getFullTableName('categories');
17 17
         
18
-        foreach( $this->elements as $element )
18
+        foreach ($this->elements as $element)
19 19
         {
20
-            $this->db_tbl[$element] = $modx->getFullTableName('site_' . $element );
20
+            $this->db_tbl[$element] = $modx->getFullTableName('site_'.$element);
21 21
         }
22 22
     }
23 23
 
@@ -37,44 +37,44 @@  discard block
 block discarded – undo
37 37
             )
38 38
         );
39 39
 
40
-        if( !empty( $categories ) )
40
+        if (!empty($categories))
41 41
         {
42 42
             return $categories;
43 43
         }
44 44
         return false;
45 45
     }
46 46
 
47
-    function getCategory( $search, $where = 'category' )
47
+    function getCategory($search, $where = 'category')
48 48
     {
49 49
         $category = $this->db->getRow(
50 50
             $this->db->select(
51 51
                 '*',
52 52
                 $this->db_tbl['categories'],
53
-                "`" . $where . "` = '" . $search . "'"
53
+                "`".$where."` = '".$search."'"
54 54
             )
55 55
         );
56 56
         return $category;
57 57
     }
58 58
 
59
-    function getCategoryValue( $value, $search, $where = 'category' )
59
+    function getCategoryValue($value, $search, $where = 'category')
60 60
     {
61 61
         $_value = $this->db->getValue(
62 62
             $this->db->select(
63
-                '`' . $value . '`',
63
+                '`'.$value.'`',
64 64
                 $this->db_tbl['categories'],
65
-                "`" . $where . "` = '" . $search . "'"
65
+                "`".$where."` = '".$search."'"
66 66
             )
67 67
         );
68 68
         return $_value;
69 69
     }
70 70
 
71
-    function getAssignedElements( $category_id, $element )
71
+    function getAssignedElements($category_id, $element)
72 72
     {
73
-        if( in_array( $element, $this->elements, true ) )
73
+        if (in_array($element, $this->elements, true))
74 74
         {
75 75
             
76 76
             $fields = '`name`,`description`';
77
-            if( $element === 'templates' )
77
+            if ($element === 'templates')
78 78
             {
79 79
                 $fields = '`templatename`,`description`';
80 80
             }
@@ -85,15 +85,15 @@  discard block
 block discarded – undo
85 85
                 $this->db->select( 
86 86
                     $fields,
87 87
                     $this->db_tbl[$element],
88
-                    "`category` = '" . $category_id . "'"
88
+                    "`category` = '".$category_id."'"
89 89
                 )
90 90
             );
91 91
             
92 92
             // correct the name of templates
93
-            if( $element === 'templates' )
93
+            if ($element === 'templates')
94 94
             {
95 95
                 $_elements_count = count($elements);
96
-                for( $i=0; $i < $_elements_count; $i++ )
96
+                for ($i = 0; $i < $_elements_count; $i++)
97 97
                 {
98 98
                     $elements[$i]['name'] = $elements[$i]['templatename'];
99 99
                 }
@@ -103,60 +103,60 @@  discard block
 block discarded – undo
103 103
         return false;
104 104
     }
105 105
 
106
-    function getAllAssignedElements( $category_id )
106
+    function getAllAssignedElements($category_id)
107 107
     {
108 108
         $elements = array();
109
-        foreach( $this->elements as $element )
109
+        foreach ($this->elements as $element)
110 110
         {
111
-            $elements[$element] = $this->getAssignedElements( $category_id, $element );
111
+            $elements[$element] = $this->getAssignedElements($category_id, $element);
112 112
         }
113 113
         return $elements;
114 114
     }
115 115
 
116
-    function deleteCategory( $category_id )
116
+    function deleteCategory($category_id)
117 117
     {
118 118
         $_update = array('category' => 0);
119
-        foreach( $this->elements as $element )
119
+        foreach ($this->elements as $element)
120 120
         {
121 121
             $this->db->update(
122 122
                 $_update,
123 123
                 $this->db_tbl[$element],
124
-                "`category` = '" . $category_id . "'"
124
+                "`category` = '".$category_id."'"
125 125
             );
126 126
         }
127 127
         
128 128
         $this->db->delete(
129 129
             $this->db_tbl['categories'],
130
-            "`id` = '" . $category_id . "'"
130
+            "`id` = '".$category_id."'"
131 131
         );
132 132
         
133
-        if( $this->db->getAffectedRows() === 1 )
133
+        if ($this->db->getAffectedRows() === 1)
134 134
         {
135 135
             return true;    
136 136
         }
137 137
         return false;
138 138
     }
139 139
 
140
-    function updateCategory( $category_id, $data = array() )
140
+    function updateCategory($category_id, $data = array())
141 141
     {
142
-        if( empty( $data )
143
-            || empty( $category_id ) )
142
+        if (empty($data)
143
+            || empty($category_id))
144 144
         {
145 145
             return false;
146 146
         }
147 147
         
148 148
         $_update = array(
149
-            'category' => $this->db->escape( $data['category'] ),
150
-            'rank'     => (int)$data['rank']
149
+            'category' => $this->db->escape($data['category']),
150
+            'rank'     => (int) $data['rank']
151 151
         );
152 152
 
153 153
         $this->db->update(
154 154
             $_update,
155 155
             $this->db_tbl['categories'],
156
-            "`id` = '" . (int)$category_id . "'"
156
+            "`id` = '".(int) $category_id."'"
157 157
         );
158 158
 
159
-        if( $this->db->getAffectedRows() === 1 )
159
+        if ($this->db->getAffectedRows() === 1)
160 160
         {
161 161
             return true;
162 162
         }
@@ -164,16 +164,16 @@  discard block
 block discarded – undo
164 164
         return false;
165 165
     }
166 166
 
167
-    function addCategory( $category_name, $category_rank )
167
+    function addCategory($category_name, $category_rank)
168 168
     {
169
-        if( $this->isCategoryExists( $category_name ) )
169
+        if ($this->isCategoryExists($category_name))
170 170
         {
171 171
             return false;
172 172
         }
173 173
 
174 174
         $_insert = array(
175
-            'category' => $this->db->escape( $category_name ),
176
-            'rank'     => (int)$category_rank
175
+            'category' => $this->db->escape($category_name),
176
+            'rank'     => (int) $category_rank
177 177
         );
178 178
         
179 179
         $this->db->insert(
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
             $this->db_tbl['categories']
182 182
         );
183 183
         
184
-        if( $this->db->getAffectedRows() === 1 )
184
+        if ($this->db->getAffectedRows() === 1)
185 185
         {
186 186
             return $this->db->getInsertId();
187 187
         }
@@ -190,19 +190,19 @@  discard block
 block discarded – undo
190 190
         return false;
191 191
     }
192 192
 
193
-    function isCategoryExists( $category_name )
193
+    function isCategoryExists($category_name)
194 194
     {
195
-        $category = $this->db->escape( $category_name );
195
+        $category = $this->db->escape($category_name);
196 196
 
197 197
         $category_id = $this->db->getValue(
198 198
             $this->db->select(
199 199
                 '`id`',
200 200
                 $this->db_tbl['categories'],
201
-                "`category` = '" . $category . "'"
201
+                "`category` = '".$category."'"
202 202
             )
203 203
         );
204 204
         
205
-        if( $this->db->getAffectedRows() === 1 )
205
+        if ($this->db->getAffectedRows() === 1)
206 206
         {
207 207
             return $category_id;
208 208
         }
Please login to merge, or discard this patch.
manager/actions/category_mgr/inc/request_trigger.inc.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -2,16 +2,16 @@  discard block
 block discarded – undo
2 2
 /**
3 3
  * Ajax Requests
4 4
  */
5
-if(IN_MANAGER_MODE != "true") {
5
+if (IN_MANAGER_MODE != "true") {
6 6
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
7 7
 }
8 8
 
9
-if( isset( $_REQUEST[$cm->get('request_key')]['ajax'] ) )
9
+if (isset($_REQUEST[$cm->get('request_key')]['ajax']))
10 10
 {
11 11
     $_data  = $_REQUEST[$cm->get('request_key')];
12 12
     $output = '';
13 13
     $task   = $_data['task'];
14
-    switch( $task )
14
+    switch ($task)
15 15
     {
16 16
         /**
17 17
          * get categories
@@ -19,19 +19,19 @@  discard block
 block discarded – undo
19 19
         case 'categorize_load_elements':
20 20
             $elements = $_data['elements'];
21 21
             
22
-            if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) )
22
+            if ($uncategorized_elements = $cm->getAssignedElements(0, $_data['elements']))
23 23
             { 
24 24
                $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements);
25 25
             }
26 26
             
27
-            foreach( $cm->getCategories() as $category )
27
+            foreach ($cm->getCategories() as $category)
28 28
             {
29
-                $category['elements'] = $cm->getAssignedElements( $category['id'], $_data['elements'] );
29
+                $category['elements'] = $cm->getAssignedElements($category['id'], $_data['elements']);
30 30
                 $output .= $cm->renderView('chunks/categorize/category', $category);
31 31
             }            
32 32
             break;
33 33
     }
34
-    exit( $output );
34
+    exit($output);
35 35
 }
36 36
 /**
37 37
  * Categorize elements
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
  * @see http://modxcms.com/forums/index.php/topic,40430.msg251476.html#msg251476 
42 42
  * 
43 43
  */
44
-if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) )
44
+if (isset($_POST[$cm->get('request_key')]['categorize']['submit']))
45 45
 {  
46 46
     $_data = $_POST[$cm->get('request_key')]['categorize'];
47 47
     $_changes = 0;
@@ -54,15 +54,15 @@  discard block
 block discarded – undo
54 54
         'categorize'
55 55
     );
56 56
     
57
-    if( !isset( $_data['elements'] ) )
57
+    if (!isset($_data['elements']))
58 58
     {
59
-        $cm->addMessage( $cm->txt('cm_unknown_error'), 'categorize' );
59
+        $cm->addMessage($cm->txt('cm_unknown_error'), 'categorize');
60 60
         return;
61 61
     }
62 62
 
63
-    foreach( $_data['elements'] as $element_id => $data )
63
+    foreach ($_data['elements'] as $element_id => $data)
64 64
     {
65
-        if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) )
65
+        if ($cm->updateElement($_data['elementsgroup'], $element_id, $data['category_id']))
66 66
         {
67 67
             $cm->addMessage(
68 68
                 sprintf( 
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
         }
79 79
     }
80 80
     
81
-    if( $_changes === 0 )
81
+    if ($_changes === 0)
82 82
     {
83
-        $cm->addMessage( $cm->txt('cm_no_categorization'), 'categorize' );
83
+        $cm->addMessage($cm->txt('cm_no_categorization'), 'categorize');
84 84
         return;
85 85
     }
86 86
     else
@@ -98,29 +98,29 @@  discard block
 block discarded – undo
98 98
 /**
99 99
  * Add a new category
100 100
  */
101
-if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) )
101
+if (isset($_POST[$cm->get('request_key')]['add']['submit']))
102 102
 {
103 103
     $_data    = $_POST[$cm->get('request_key')]['add']['data'];
104
-    $category = trim( html_entity_decode($_data['name']) );
104
+    $category = trim(html_entity_decode($_data['name']));
105 105
     $rank     = (int) $_data['rank'];
106 106
 
107
-    if( empty( $category ) )
107
+    if (empty($category))
108 108
     {
109
-       $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' );
109
+       $cm->addMessage($cm->txt('cm_enter_name_for_category'), 'add');
110 110
        return;
111 111
     }
112 112
 
113
-    if( $cm->isCategoryExists( $category ) )
113
+    if ($cm->isCategoryExists($category))
114 114
     {
115
-       $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' ); 
115
+       $cm->addMessage(sprintf($cm->txt('cm_category_x_exists'), $category), 'add'); 
116 116
        return;
117 117
     }
118 118
     
119
-    if( $cm->addCategory( $category, $rank ) !== 0 )
119
+    if ($cm->addCategory($category, $rank) !== 0)
120 120
     {
121 121
         $cm->addMessage(
122 122
             sprintf( 
123
-                $cm->txt( 'cm_category_x_saved_at_position_y' ),
123
+                $cm->txt('cm_category_x_saved_at_position_y'),
124 124
                 $category,
125 125
                 $rank
126 126
             ),
@@ -129,26 +129,26 @@  discard block
 block discarded – undo
129 129
     }
130 130
     else
131 131
     {
132
-        $cm->addMessage( $cm->txt('cm_unknown_error'), 'add' );
132
+        $cm->addMessage($cm->txt('cm_unknown_error'), 'add');
133 133
     }    
134 134
 }
135 135
 
136 136
 /**
137 137
  * Sort categories
138 138
  */
139
-if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) )
139
+if (isset($_POST[$cm->get('request_key')]['sort']['submit']))
140 140
 {
141 141
     $categories = $_POST[$cm->get('request_key')]['sort']['data'];
142 142
     $_changes   = 0;
143 143
     
144
-    foreach( $categories as $category_id => $_data  ) 
144
+    foreach ($categories as $category_id => $_data) 
145 145
     {
146 146
         $data = array(
147
-            'category' => urldecode( $_data['category'] ),
147
+            'category' => urldecode($_data['category']),
148 148
             'rank'     => $_data['rank']
149 149
         );
150 150
         
151
-        if( $cm->updateCategory( $category_id, $data ) )
151
+        if ($cm->updateCategory($category_id, $data))
152 152
         {
153 153
             $cm->addMessage(
154 154
                 sprintf( 
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
         }
163 163
     }
164 164
         
165
-    if( $_changes === 0 )
165
+    if ($_changes === 0)
166 166
     {
167
-        $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'sort');
167
+        $cm->addMessage($cm->txt('cm_no_changes'), 'sort');
168 168
     }
169 169
     else
170 170
     {
@@ -181,21 +181,21 @@  discard block
 block discarded – undo
181 181
 /**
182 182
  * Edit categories
183 183
  */
184
-if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) )
184
+if (isset($_POST[$cm->get('request_key')]['edit']['submit']))
185 185
 {
186 186
     $categories = $_POST[$cm->get('request_key')]['edit']['data'];
187 187
     $_changes   = 0;
188 188
 
189
-    foreach( $categories as $category_id => $_data  ) 
189
+    foreach ($categories as $category_id => $_data) 
190 190
     {
191
-        if( isset( $_data['delete'] ) )
191
+        if (isset($_data['delete']))
192 192
         {
193
-            if( $cm->deleteCategory( $category_id ) )
193
+            if ($cm->deleteCategory($category_id))
194 194
             {
195 195
                 $cm->addMessage(
196 196
                     sprintf(
197 197
                         $cm->txt('cm_category_x_deleted'),
198
-                        urldecode( $_data['origin'] )
198
+                        urldecode($_data['origin'])
199 199
                     ),
200 200
                     'edit'
201 201
                 );
@@ -205,16 +205,16 @@  discard block
 block discarded – undo
205 205
         }
206 206
         
207 207
         $data = array(
208
-            'category' => trim( html_entity_decode( $_data['category'] ) ),
208
+            'category' => trim(html_entity_decode($_data['category'])),
209 209
             'rank'     => $_data['rank']
210 210
         );
211 211
         
212
-        if( $cm->updateCategory( $category_id, $data ) )
212
+        if ($cm->updateCategory($category_id, $data))
213 213
         {
214 214
             $cm->addMessage(
215 215
                 sprintf( 
216 216
                     $cm->txt('cm_category_x_renamed_to_y'),
217
-                    urldecode( $_data['origin'] ),
217
+                    urldecode($_data['origin']),
218 218
                     $data['category']
219 219
                 ),
220 220
                 'edit'
@@ -223,26 +223,26 @@  discard block
 block discarded – undo
223 223
         }
224 224
     }
225 225
 
226
-    if( $_changes === 0 )
226
+    if ($_changes === 0)
227 227
     {
228
-        $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'edit');
228
+        $cm->addMessage($cm->txt('cm_no_changes'), 'edit');
229 229
     }
230 230
 }
231 231
 
232 232
 /**
233 233
  * Delete singel category by $_GET
234 234
  */
235
-if( isset( $_GET[$cm->get('request_key')]['delete'] ) 
236
-    && !empty( $_GET[$cm->get('request_key')]['delete'] ) )
235
+if (isset($_GET[$cm->get('request_key')]['delete']) 
236
+    && !empty($_GET[$cm->get('request_key')]['delete']))
237 237
 {
238
-    $category_id = (int)$_GET[$cm->get('request_key')]['delete'];
238
+    $category_id = (int) $_GET[$cm->get('request_key')]['delete'];
239 239
     
240
-    if( $cm->deleteCategory( $category_id ) )
240
+    if ($cm->deleteCategory($category_id))
241 241
     {
242 242
         $cm->addMessage(
243 243
             sprintf(
244 244
                 $cm->txt('cm_category_x_deleted'), 
245
-                urldecode( $_GET[$cm->get('request_key')]['category'] )
245
+                urldecode($_GET[$cm->get('request_key')]['category'])
246 246
             ), 
247 247
             'edit'
248 248
         );
@@ -251,15 +251,15 @@  discard block
 block discarded – undo
251 251
 /**
252 252
  * Translate phrases
253 253
  */
254
-if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) )
254
+if (isset($_POST[$cm->get('request_key')]['translate']['submit']))
255 255
 { 
256 256
     $translations = $_POST[$cm->get('request_key')]['translate']['data'];
257 257
 
258
-    foreach( $translations as $native_phrase => $translation )
258
+    foreach ($translations as $native_phrase => $translation)
259 259
     {
260
-        $native_phrase = urldecode( $native_phrase );
260
+        $native_phrase = urldecode($native_phrase);
261 261
 
262
-        if( empty( $translation ) )
262
+        if (empty($translation))
263 263
         {
264 264
             $translation = $native_phrase;
265 265
             
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
         }
274 274
 
275 275
         //$cm->c('Translator')->setType('phrase');
276
-        $cm->c('Translator')->addTranslation( $native_phrase, $translation, 'phrase' );
276
+        $cm->c('Translator')->addTranslation($native_phrase, $translation, 'phrase');
277 277
         
278 278
         $cm->addMessage(
279 279
             sprintf(
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
         );
286 286
     }
287 287
 
288
-    if( empty( $cm->new_translations ) )
288
+    if (empty($cm->new_translations))
289 289
     {   
290 290
        //$_REQUEST['webfxtab_manage-categories-pane'] = 0;
291 291
        // unset( $_COOKIE['webfxtab_manage-categories-pane'] );
Please login to merge, or discard this patch.
manager/actions/web_access_permissions.dynamic.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -1,30 +1,30 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE != "true") {
2
+if (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('web_access_permissions')) {
5
+if (!$modx->hasPermission('web_access_permissions')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 // find all document groups, for the select :)
10 10
 $rs = $modx->db->select('*', $modx->getFullTableName('documentgroup_names'), '', 'name');
11
-if($modx->db->getRecordCount($rs) < 1) {
11
+if ($modx->db->getRecordCount($rs) < 1) {
12 12
 	$docgroupselector = "[no groups to add]";
13 13
 } else {
14
-	$docgroupselector = '<select name="docgroup">' . "\n";
15
-	while($row = $modx->db->getRow($rs)) {
16
-		$docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n";
14
+	$docgroupselector = '<select name="docgroup">'."\n";
15
+	while ($row = $modx->db->getRow($rs)) {
16
+		$docgroupselector .= "\t".'<option value="'.$row['id'].'">'.$row['name']."</option>\n";
17 17
 	}
18 18
 	$docgroupselector .= "</select>\n";
19 19
 }
20 20
 
21 21
 $rs = $modx->db->select('*', $modx->getFullTableName('webgroup_names'), '', 'name');
22
-if($modx->db->getRecordCount($rs) < 1) {
22
+if ($modx->db->getRecordCount($rs) < 1) {
23 23
 	$usrgroupselector = '[no user groups]';
24 24
 } else {
25
-	$usrgroupselector = '<select name="usergroup">' . "\n";
26
-	while($row = $modx->db->getRow($rs)) {
27
-		$usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n";
25
+	$usrgroupselector = '<select name="usergroup">'."\n";
26
+	while ($row = $modx->db->getRow($rs)) {
27
+		$usrgroupselector .= "\t".'<option value="'.$row['id'].'">'.$row['name']."</option>\n";
28 28
 	}
29 29
 	$usrgroupselector .= "</select>\n";
30 30
 }
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	<div class="alert alert-info"><?= $_lang['access_permissions_introtext'] ?></div>
61 61
 </div>
62 62
 
63
-<div class="container"><?= ($use_udperms != 1 ? '<div class="alert alert-danger">' . $_lang['access_permissions_off'] . '</div>' : '') ?></div>
63
+<div class="container"><?= ($use_udperms != 1 ? '<div class="alert alert-danger">'.$_lang['access_permissions_off'].'</div>' : '') ?></div>
64 64
 
65 65
 
66 66
 <div class="tab-pane" id="wuapPane">
@@ -88,10 +88,10 @@  discard block
 block discarded – undo
88 88
 				</form>
89 89
 			</div>
90 90
 			<?php
91
-			$rs = $modx->db->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getFullTableName('webgroup_names') . " AS groupnames
92
-			LEFT JOIN " . $modx->getFullTableName('web_groups') . " AS groups ON groups.webgroup = groupnames.id
93
-			LEFT JOIN " . $modx->getFullTableName('web_users') . " AS users ON users.id = groups.webuser", '', 'groupnames.name, user_name');
94
-			if($modx->db->getRecordCount($rs) < 1) {
91
+			$rs = $modx->db->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getFullTableName('webgroup_names')." AS groupnames
92
+			LEFT JOIN " . $modx->getFullTableName('web_groups')." AS groups ON groups.webgroup = groupnames.id
93
+			LEFT JOIN " . $modx->getFullTableName('web_users')." AS users ON users.id = groups.webuser", '', 'groupnames.name, user_name');
94
+			if ($modx->db->getRecordCount($rs) < 1) {
95 95
 				?>
96 96
 				<div class="text-danger"><?= $_lang['no_groups_found'] ?></div>
97 97
 				<?php
@@ -100,9 +100,9 @@  discard block
 block discarded – undo
100 100
 			<div class="form-group">
101 101
 				<?php
102 102
 				$pid = '';
103
-				while($row = $modx->db->getRow($rs)) {
104
-					if($pid != $row['id']) {
105
-						if($pid != '') {
103
+				while ($row = $modx->db->getRow($rs)) {
104
+					if ($pid != $row['id']) {
105
+						if ($pid != '') {
106 106
 							echo '</div><div class="form-group">';
107 107
 						}
108 108
 						?>
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 						<?= $_lang['web_access_permissions_users_in_group'] ?>
122 122
 						<?php
123 123
 					}
124
-					if(!$row['user_id']) {
124
+					if (!$row['user_id']) {
125 125
 						?>
126 126
 						<i><?= $_lang['access_permissions_no_users_in_group'] ?></i>
127 127
 						<?php
@@ -159,10 +159,10 @@  discard block
 block discarded – undo
159 159
 				</form>
160 160
 			</div>
161 161
 			<?php
162
-			$rs = $modx->db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getFullTableName('documentgroup_names') . " AS dgnames
163
-			LEFT JOIN " . $modx->getFullTableName('document_groups') . " AS dg ON dg.document_group = dgnames.id
164
-			LEFT JOIN " . $modx->getFullTableName('site_content') . " AS sc ON sc.id = dg.document", '', 'dgnames.name, sc.id');
165
-			if($modx->db->getRecordCount($rs) < 1) {
162
+			$rs = $modx->db->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getFullTableName('documentgroup_names')." AS dgnames
163
+			LEFT JOIN " . $modx->getFullTableName('document_groups')." AS dg ON dg.document_group = dgnames.id
164
+			LEFT JOIN " . $modx->getFullTableName('site_content')." AS sc ON sc.id = dg.document", '', 'dgnames.name, sc.id');
165
+			if ($modx->db->getRecordCount($rs) < 1) {
166 166
 				?>
167 167
 				<div class="text-danger"><?= $_lang['no_groups_found'] ?></div>
168 168
 				<?php
@@ -171,9 +171,9 @@  discard block
 block discarded – undo
171 171
 			<div class="form-group">
172 172
 				<?php
173 173
 				$pid = '';
174
-				while($row = $modx->db->getRow($rs)) {
175
-					if($pid != $row['id']) {
176
-						if($pid != '') {
174
+				while ($row = $modx->db->getRow($rs)) {
175
+					if ($pid != $row['id']) {
176
+						if ($pid != '') {
177 177
 							echo '</div><div class="form-group">';
178 178
 						}
179 179
 						?>
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 						<?= $_lang['access_permissions_resources_in_group'] ?>
193 193
 						<?php
194 194
 					}
195
-					if(!$row['doc_id']) {
195
+					if (!$row['doc_id']) {
196 196
 						?>
197 197
 						<i><?= $_lang['access_permissions_no_resources_in_group'] ?></i>
198 198
 						<?php
@@ -217,10 +217,10 @@  discard block
 block discarded – undo
217 217
 		<div class="container container-body">
218 218
 			<p class="element-edit-message-tab alert alert-warning"><?= $_lang['access_permissions_links_tab'] ?></p>
219 219
 			<?php
220
-			$rs = $modx->db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getFullTableName('webgroup_names') . " AS groupnames
221
-			LEFT JOIN " . $modx->getFullTableName('webgroup_access') . " AS groupacc ON groupacc.webgroup = groupnames.id
222
-			LEFT JOIN " . $modx->getFullTableName('documentgroup_names') . " AS dgnames ON dgnames.id = groupacc.documentgroup", '', 'name, dg_name');
223
-			if($modx->db->getRecordCount($rs) < 1) {
220
+			$rs = $modx->db->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getFullTableName('webgroup_names')." AS groupnames
221
+			LEFT JOIN " . $modx->getFullTableName('webgroup_access')." AS groupacc ON groupacc.webgroup = groupnames.id
222
+			LEFT JOIN " . $modx->getFullTableName('documentgroup_names')." AS dgnames ON dgnames.id = groupacc.documentgroup", '', 'name, dg_name');
223
+			if ($modx->db->getRecordCount($rs) < 1) {
224 224
 				?>
225 225
 				<div class="text-danger"><?= $_lang['no_groups_found'] ?></div>
226 226
 				<?php
@@ -242,23 +242,23 @@  discard block
 block discarded – undo
242 242
 				<ul>
243 243
 					<?php
244 244
 					$pid = '';
245
-					while($row = $modx->db->getRow($rs)) {
246
-						if($row['id'] != $pid) {
247
-							if($pid != '') {
245
+					while ($row = $modx->db->getRow($rs)) {
246
+						if ($row['id'] != $pid) {
247
+							if ($pid != '') {
248 248
 								echo '</ul></li>';
249 249
 							} // close previous one
250 250
 							?>
251 251
 							<li><b><?= $row['name'] ?></b></li>
252 252
 							<?php
253
-							if(!$row['dg_id']) {
254
-								echo '<i>' . $_lang['no_groups_found'] . '</i></li>';
253
+							if (!$row['dg_id']) {
254
+								echo '<i>'.$_lang['no_groups_found'].'</i></li>';
255 255
 								$pid = '';
256 256
 								continue;
257 257
 							} else {
258 258
 								echo '<ul>';
259 259
 							}
260 260
 						}
261
-						if(!$row['dg_id']) {
261
+						if (!$row['dg_id']) {
262 262
 							continue;
263 263
 						}
264 264
 						?>
Please login to merge, or discard this patch.
manager/actions/eventlog.dynamic.php 1 patch
Spacing   +11 added lines, -11 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") {
2
+if (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('view_eventlog')) {
5
+if (!$modx->hasPermission('view_eventlog')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -15,12 +15,12 @@  discard block
 block discarded – undo
15 15
 $modx->manager->initPageViewState();
16 16
 
17 17
 // get and save search string
18
-if($_REQUEST['op'] == 'reset') {
18
+if ($_REQUEST['op'] == 'reset') {
19 19
 	$sqlQuery = $query = '';
20 20
 	$_PAGE['vs']['search'] = '';
21 21
 } else {
22 22
 	$sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search'];
23
-	if(!is_numeric($sqlQuery)) {
23
+	if (!is_numeric($sqlQuery)) {
24 24
 		$sqlQuery = $modx->db->escape($query);
25 25
 	}
26 26
 	$_PAGE['vs']['search'] = $query;
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 $_PAGE['vs']['lm'] = $listmode;
32 32
 
33 33
 // context menu
34
-include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php";
34
+include_once MODX_MANAGER_PATH."includes/controls/contextmenu.php";
35 35
 $cm = new ContextMenu("cntxm", 150);
36 36
 $cm->addItem($_lang['view_log'], "js:menuAction(1)", $_style['actions_preview']);
37 37
 $cm->addSeparator();
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
 					<?php
128 128
 					$ds = $modx->db->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el 
129 129
 			LEFT JOIN {$tbl_manager_users} AS mu ON mu.id=el.user AND el.usertype=0
130
-			LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "" . (is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '') . "(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC");
131
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
130
+			LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "".(is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '')."(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC");
131
+					include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php";
132 132
 					$grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
133 133
 					$grd->pagerClass = '';
134 134
 					$grd->pageClass = 'page-item';
@@ -139,14 +139,14 @@  discard block
 block discarded – undo
139 139
 					$grd->itemClass = "tableItem";
140 140
 					$grd->altItemClass = "tableAltItem";
141 141
 					$grd->fields = "type,source,createdon,eventid,username";
142
-					$grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid'];
142
+					$grd->columns = $_lang['type']." ,".$_lang['source']." ,".$_lang['date']." ,".$_lang['event_id']." ,".$_lang['sysinfo_userid'];
143 143
 					$grd->colWidths = "1%,,1%,1%,1%";
144 144
 					$grd->colAligns = "center,,,center,center";
145
-					$grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang['click_to_context'] . "'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='" . $_lang['click_to_view_details'] . "'>[+source+]</a>||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p';
146
-					if($listmode == '1') {
145
+					$grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='".$_lang['click_to_context']."'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='".$_lang['click_to_view_details']."'>[+source+]</a>||date: ".$modx->toDateFormat(null, 'formatOnly').' %I:%M %p';
146
+					if ($listmode == '1') {
147 147
 						$grd->pageSize = 0;
148 148
 					}
149
-					if($_REQUEST['op'] == 'reset') {
149
+					if ($_REQUEST['op'] == 'reset') {
150 150
 						$grd->pageNumber = 1;
151 151
 					}
152 152
 					// render grid
Please login to merge, or discard this patch.
manager/actions/import_site.static.php 1 patch
Spacing   +82 added lines, -82 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") {
2
+if (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('import_static')) {
5
+if (!$modx->hasPermission('import_static')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
 	<div class="tab-page">
44 44
 		<div class="container container-body">
45 45
 			<?php
46
-			if(!isset($_POST['import'])) {
47
-				echo "<div class=\"element-edit-message\">" . $_lang['import_site_message'] . "</div>";
46
+			if (!isset($_POST['import'])) {
47
+				echo "<div class=\"element-edit-message\">".$_lang['import_site_message']."</div>";
48 48
 				?>
49 49
 				<form action="index.php" method="post" name="importFrm">
50 50
 					<input type="hidden" name="import" value="import" />
@@ -101,14 +101,14 @@  discard block
 block discarded – undo
101 101
 	</div>
102 102
 
103 103
 <?php
104
-function run() {
104
+function run(){
105 105
 	global $modx;
106 106
 
107 107
 	$tbl_site_content = $modx->getFullTableName('site_content');
108 108
 	$output = '';
109 109
 	$maxtime = $_POST['maxtime'];
110 110
 
111
-	if(!is_numeric($maxtime)) {
111
+	if (!is_numeric($maxtime)) {
112 112
 		$maxtime = 30;
113 113
 	}
114 114
 
@@ -119,17 +119,17 @@  discard block
 block discarded – undo
119 119
 	$mtime = $mtime[1] + $mtime[0];
120 120
 	$importstart = $mtime;
121 121
 
122
-	if($_POST['reset'] == 'on') {
122
+	if ($_POST['reset'] == 'on') {
123 123
 		$modx->db->truncate($tbl_site_content);
124 124
 		$modx->db->query("ALTER TABLE {$tbl_site_content} AUTO_INCREMENT = 1");
125 125
 	}
126 126
 
127 127
 	$parent = intval($_POST['parent']);
128 128
 
129
-	if(is_dir(MODX_BASE_PATH . 'temp/import')) {
130
-		$filedir = MODX_BASE_PATH . 'temp/import/';
131
-	} elseif(is_dir(MODX_BASE_PATH . 'assets/import')) {
132
-		$filedir = MODX_BASE_PATH . 'assets/import/';
129
+	if (is_dir(MODX_BASE_PATH.'temp/import')) {
130
+		$filedir = MODX_BASE_PATH.'temp/import/';
131
+	} elseif (is_dir(MODX_BASE_PATH.'assets/import')) {
132
+		$filedir = MODX_BASE_PATH.'assets/import/';
133 133
 	}
134 134
 
135 135
 	$filesfound = 0;
@@ -138,10 +138,10 @@  discard block
 block discarded – undo
138 138
 	$files = pop_index($files);
139 139
 
140 140
 	// no. of files to import
141
-	$output .= sprintf('<p>' . $_lang['import_files_found'] . '</p>', $filesfound);
141
+	$output .= sprintf('<p>'.$_lang['import_files_found'].'</p>', $filesfound);
142 142
 
143 143
 	// import files
144
-	if(0 < count($files)) {
144
+	if (0 < count($files)) {
145 145
 		$rs = $modx->db->update(array('isfolder' => 1), $tbl_site_content, "id='{$parent}'");
146 146
 		importFiles($parent, $filedir, $files, 'root');
147 147
 	}
@@ -151,16 +151,16 @@  discard block
 block discarded – undo
151 151
 	$mtime = $mtime[1] + $mtime[0];
152 152
 	$importend = $mtime;
153 153
 	$totaltime = ($importend - $importstart);
154
-	$output .= sprintf('<p>' . $_lang['import_site_time'] . '</p>', round($totaltime, 3));
154
+	$output .= sprintf('<p>'.$_lang['import_site_time'].'</p>', round($totaltime, 3));
155 155
 
156
-	if($_POST['convert_link'] == 'on') {
156
+	if ($_POST['convert_link'] == 'on') {
157 157
 		convertLink();
158 158
 	}
159 159
 
160 160
 	return $output;
161 161
 }
162 162
 
163
-function importFiles($parent, $filedir, $files, $mode) {
163
+function importFiles($parent, $filedir, $files, $mode){
164 164
 	global $modx;
165 165
 	global $_lang, $allowedfiles;
166 166
 	global $search_default, $cache_default, $publish_default;
@@ -170,21 +170,21 @@  discard block
 block discarded – undo
170 170
 
171 171
 	$createdon = time();
172 172
 	$createdby = $modx->getLoginUserID();
173
-	if(!is_array($files)) {
173
+	if (!is_array($files)) {
174 174
 		return;
175 175
 	}
176
-	if($_POST['object'] == 'all') {
176
+	if ($_POST['object'] == 'all') {
177 177
 		$modx->config['default_template'] = '0';
178 178
 		$richtext = '0';
179 179
 	} else {
180 180
 		$richtext = '1';
181 181
 	}
182 182
 
183
-	foreach($files as $id => $value) {
184
-		if(is_array($value)) {
183
+	foreach ($files as $id => $value) {
184
+		if (is_array($value)) {
185 185
 			// create folder
186 186
 			$alias = $id;
187
-			printf('<span>' . $_lang['import_site_importing_document'] . '</span>', $alias);
187
+			printf('<span>'.$_lang['import_site_importing_document'].'</span>', $alias);
188 188
 			$field = array();
189 189
 			$field['type'] = 'document';
190 190
 			$field['contentType'] = 'text/html';
@@ -199,12 +199,12 @@  discard block
 block discarded – undo
199 199
 			$field['isfolder'] = 1;
200 200
 			$field['menuindex'] = 1;
201 201
 			$find = false;
202
-			foreach(array(
202
+			foreach (array(
203 203
 						'index.html',
204 204
 						'index.htm'
205 205
 					) as $filename) {
206
-				$filepath = $filedir . $alias . '/' . $filename;
207
-				if($find === false && file_exists($filepath)) {
206
+				$filepath = $filedir.$alias.'/'.$filename;
207
+				if ($find === false && file_exists($filepath)) {
208 208
 					$file = getFileContent($filepath);
209 209
 					list($pagetitle, $content, $description) = treatContent($file, $filename, $alias);
210 210
 
@@ -216,17 +216,17 @@  discard block
 block discarded – undo
216 216
 					$field['createdon'] = $date;
217 217
 					$field['editedon'] = $date;
218 218
 					$newid = $modx->db->insert($field, $tbl_site_content);
219
-					if($newid) {
219
+					if ($newid) {
220 220
 						$find = true;
221
-						echo ' - <span class="success">' . $_lang['import_site_success'] . '</span><br />' . "\n";
222
-						importFiles($newid, $filedir . $alias . '/', $value, 'sub');
221
+						echo ' - <span class="success">'.$_lang['import_site_success'].'</span><br />'."\n";
222
+						importFiles($newid, $filedir.$alias.'/', $value, 'sub');
223 223
 					} else {
224
-						echo '<span class="fail">' . $_lang["import_site_failed"] . "</span> " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError();
224
+						echo '<span class="fail">'.$_lang["import_site_failed"]."</span> ".$_lang["import_site_failed_db_error"].$modx->db->getLastError();
225 225
 						exit;
226 226
 					}
227 227
 				}
228 228
 			}
229
-			if($find === false) {
229
+			if ($find === false) {
230 230
 				$date = time();
231 231
 				$field['pagetitle'] = '---';
232 232
 				$field['content'] = '';
@@ -234,30 +234,30 @@  discard block
 block discarded – undo
234 234
 				$field['editedon'] = $date;
235 235
 				$field['hidemenu'] = '1';
236 236
 				$newid = $modx->db->insert($field, $tbl_site_content);
237
-				if($newid) {
237
+				if ($newid) {
238 238
 					$find = true;
239
-					echo ' - <span class="success">' . $_lang['import_site_success'] . '</span><br />' . "\n";
240
-					importFiles($newid, $filedir . $alias . '/', $value, 'sub');
239
+					echo ' - <span class="success">'.$_lang['import_site_success'].'</span><br />'."\n";
240
+					importFiles($newid, $filedir.$alias.'/', $value, 'sub');
241 241
 				} else {
242
-					echo '<span class="fail">' . $_lang["import_site_failed"] . "</span> " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError();
242
+					echo '<span class="fail">'.$_lang["import_site_failed"]."</span> ".$_lang["import_site_failed_db_error"].$modx->db->getLastError();
243 243
 					exit;
244 244
 				}
245 245
 			}
246 246
 		} else {
247 247
 			// create document
248
-			if($mode == 'sub' && $value == 'index.html') {
248
+			if ($mode == 'sub' && $value == 'index.html') {
249 249
 				continue;
250 250
 			}
251 251
 			$filename = $value;
252 252
 			$fparts = explode('.', $value);
253 253
 			$alias = $fparts[0];
254 254
 			$ext = (count($fparts) > 1) ? $fparts[count($fparts) - 1] : "";
255
-			printf("<span>" . $_lang['import_site_importing_document'] . "</span>", $filename);
255
+			printf("<span>".$_lang['import_site_importing_document']."</span>", $filename);
256 256
 
257
-			if(!in_array($ext, $allowedfiles)) {
258
-				echo ' - <span class="fail">' . $_lang["import_site_skip"] . '</span><br />' . "\n";
257
+			if (!in_array($ext, $allowedfiles)) {
258
+				echo ' - <span class="fail">'.$_lang["import_site_skip"].'</span><br />'."\n";
259 259
 			} else {
260
-				$filepath = $filedir . $filename;
260
+				$filepath = $filedir.$filename;
261 261
 				$file = getFileContent($filepath);
262 262
 				list($pagetitle, $content, $description) = treatContent($file, $filename, $alias);
263 263
 
@@ -282,18 +282,18 @@  discard block
 block discarded – undo
282 282
 				$field['isfolder'] = 0;
283 283
 				$field['menuindex'] = ($alias == 'index') ? 0 : 2;
284 284
 				$newid = $modx->db->insert($field, $tbl_site_content);
285
-				if($newid) {
286
-					echo ' - <span class="success">' . $_lang['import_site_success'] . '</span><br />' . "\n";
285
+				if ($newid) {
286
+					echo ' - <span class="success">'.$_lang['import_site_success'].'</span><br />'."\n";
287 287
 				} else {
288
-					echo '<span class="fail">' . $_lang["import_site_failed"] . "</span> " . $_lang["import_site_failed_db_error"] . $modx->db->getLastError();
288
+					echo '<span class="fail">'.$_lang["import_site_failed"]."</span> ".$_lang["import_site_failed_db_error"].$modx->db->getLastError();
289 289
 					exit;
290 290
 				}
291 291
 
292 292
 				$is_site_start = false;
293
-				if($filename == 'index.html') {
293
+				if ($filename == 'index.html') {
294 294
 					$is_site_start = true;
295 295
 				}
296
-				if($is_site_start == true && $_POST['reset'] == 'on') {
296
+				if ($is_site_start == true && $_POST['reset'] == 'on') {
297 297
 					$modx->db->update(array('setting_value' => $newid), $tbl_system_settings, "setting_name='site_start'");
298 298
 					$modx->db->update(array('menuindex' => 0), $tbl_site_content, "id='{$newid}'");
299 299
 				}
@@ -302,85 +302,85 @@  discard block
 block discarded – undo
302 302
 	}
303 303
 }
304 304
 
305
-function getFiles($directory, $listing = array(), $count = 0) {
305
+function getFiles($directory, $listing = array(), $count = 0){
306 306
 	global $_lang;
307 307
 	global $filesfound;
308 308
 	$dummy = $count;
309
-	if($files = scandir($directory)) {
310
-		foreach($files as $file) {
311
-			if($file == '.' || $file == '..') {
309
+	if ($files = scandir($directory)) {
310
+		foreach ($files as $file) {
311
+			if ($file == '.' || $file == '..') {
312 312
 				continue;
313
-			} elseif($h = @opendir($directory . $file . "/")) {
313
+			} elseif ($h = @opendir($directory.$file."/")) {
314 314
 				closedir($h);
315 315
 				$count = -1;
316
-				$listing[$file] = getFiles($directory . $file . "/", array(), $count + 1);
317
-			} elseif(strpos($file, '.htm') !== false) {
316
+				$listing[$file] = getFiles($directory.$file."/", array(), $count + 1);
317
+			} elseif (strpos($file, '.htm') !== false) {
318 318
 				$listing[$dummy] = $file;
319 319
 				$dummy = $dummy + 1;
320 320
 				$filesfound++;
321 321
 			}
322 322
 		}
323 323
 	} else {
324
-		echo '<p><span class="fail">' . $_lang["import_site_failed"] . "</span> " . $_lang["import_site_failed_no_open_dir"] . $directory . ".</p>";
324
+		echo '<p><span class="fail">'.$_lang["import_site_failed"]."</span> ".$_lang["import_site_failed_no_open_dir"].$directory.".</p>";
325 325
 	}
326 326
 	return ($listing);
327 327
 }
328 328
 
329
-function getFileContent($filepath) {
329
+function getFileContent($filepath){
330 330
 	global $_lang;
331 331
 	// get the file
332
-	if(!$buffer = file_get_contents($filepath)) {
333
-		echo '<p><span class="fail">' . $_lang['import_site_failed'] . "</span> " . $_lang["import_site_failed_no_retrieve_file"] . $filepath . ".</p>";
332
+	if (!$buffer = file_get_contents($filepath)) {
333
+		echo '<p><span class="fail">'.$_lang['import_site_failed']."</span> ".$_lang["import_site_failed_no_retrieve_file"].$filepath.".</p>";
334 334
 	} else {
335 335
 		return $buffer;
336 336
 	}
337 337
 }
338 338
 
339
-function pop_index($array) {
339
+function pop_index($array){
340 340
 	$new_array = array();
341
-	foreach($array as $k => $v) {
342
-		if($v !== 'index.html' && $v !== 'index.htm') {
341
+	foreach ($array as $k => $v) {
342
+		if ($v !== 'index.html' && $v !== 'index.htm') {
343 343
 			$new_array[$k] = $v;
344 344
 		} else {
345 345
 			array_unshift($new_array, $v);
346 346
 		}
347 347
 	}
348
-	foreach($array as $k => $v) {
349
-		if(is_array($v)) {
348
+	foreach ($array as $k => $v) {
349
+		if (is_array($v)) {
350 350
 			$new_array[$k] = $v;
351 351
 		}
352 352
 	}
353 353
 	return $new_array;
354 354
 }
355 355
 
356
-function treatContent($src, $filename, $alias) {
356
+function treatContent($src, $filename, $alias){
357 357
 	global $modx;
358 358
 
359 359
 	$src = mb_convert_encoding($src, $modx->config['modx_charset'], 'UTF-8,SJIS-win,eucJP-win,SJIS,EUC-JP,ASCII');
360 360
 
361
-	if(preg_match("@<title>(.*)</title>@i", $src, $matches)) {
361
+	if (preg_match("@<title>(.*)</title>@i", $src, $matches)) {
362 362
 		$pagetitle = ($matches[1] !== '') ? $matches[1] : $filename;
363 363
 		$pagetitle = str_replace('[*pagetitle*]', '', $pagetitle);
364 364
 	} else {
365 365
 		$pagetitle = $alias;
366 366
 	}
367
-	if(!$pagetitle) {
367
+	if (!$pagetitle) {
368 368
 		$pagetitle = $alias;
369 369
 	}
370 370
 
371
-	if(preg_match('@<meta[^>]+"description"[^>]+content=[\'"](.*)[\'"].+>@i', $src, $matches)) {
371
+	if (preg_match('@<meta[^>]+"description"[^>]+content=[\'"](.*)[\'"].+>@i', $src, $matches)) {
372 372
 		$description = ($matches[1] !== '') ? $matches[1] : $filename;
373 373
 		$description = str_replace('[*description*]', '', $description);
374 374
 	} else {
375 375
 		$description = '';
376 376
 	}
377 377
 
378
-	if((preg_match("@<body[^>]*>(.*)[^<]+</body>@is", $src, $matches)) && $_POST['object'] == 'body') {
378
+	if ((preg_match("@<body[^>]*>(.*)[^<]+</body>@is", $src, $matches)) && $_POST['object'] == 'body') {
379 379
 		$content = $matches[1];
380 380
 	} else {
381 381
 		$content = $src;
382 382
 		$s = '/(<meta[^>]+charset\s*=)[^>"\'=]+(.+>)/i';
383
-		$r = '$1' . $modx->config['modx_charset'] . '$2';
383
+		$r = '$1'.$modx->config['modx_charset'].'$2';
384 384
 		$content = preg_replace($s, $r, $content);
385 385
 		$content = preg_replace('@<title>.*</title>@i', "<title>[*pagetitle*]</title>", $content);
386 386
 	}
@@ -394,38 +394,38 @@  discard block
 block discarded – undo
394 394
 	);
395 395
 }
396 396
 
397
-function convertLink() {
397
+function convertLink(){
398 398
 	global $modx;
399 399
 	$tbl_site_content = $modx->getFullTableName('site_content');
400 400
 
401 401
 	$rs = $modx->db->select('id,content', $tbl_site_content);
402
-	while($row = $modx->db->getRow($rs)) {
402
+	while ($row = $modx->db->getRow($rs)) {
403 403
 		$id = $row['id'];
404 404
 		$array = explode('<a href=', $row['content']);
405 405
 		$c = 0;
406
-		foreach($array as $v) {
407
-			if($v[0] === '"') {
406
+		foreach ($array as $v) {
407
+			if ($v[0] === '"') {
408 408
 				$v = substr($v, 1);
409 409
 				list($href, $v) = explode('"', $v, 2);
410 410
 				$_ = $href;
411
-				if(strpos($_, $modx->config['site_url']) !== false) {
412
-					$_ = $modx->config['base_url'] . str_replace($modx->config['site_url'], '', $_);
411
+				if (strpos($_, $modx->config['site_url']) !== false) {
412
+					$_ = $modx->config['base_url'].str_replace($modx->config['site_url'], '', $_);
413 413
 				}
414
-				if($_[0] === '/') {
414
+				if ($_[0] === '/') {
415 415
 					$_ = substr($_, 1);
416 416
 				}
417 417
 				$_ = str_replace('/index.html', '.html', $_);
418 418
 				$level = substr_count($_, '../');
419
-				if(1 < $level) {
420
-					if(!isset($p[$id])) {
419
+				if (1 < $level) {
420
+					if (!isset($p[$id])) {
421 421
 						$p[$id] = $modx->getParentIds($id);
422 422
 					}
423 423
 					$k = array_keys($p[$id]);
424
-					while(0 < $level) {
424
+					while (0 < $level) {
425 425
 						$dir = array_shift($k);
426 426
 						$level--;
427 427
 					}
428
-					if($dir != '') {
428
+					if ($dir != '') {
429 429
 						$dir .= '/';
430 430
 					}
431 431
 				} else {
@@ -433,18 +433,18 @@  discard block
 block discarded – undo
433 433
 				}
434 434
 
435 435
 				$_ = trim($_, './');
436
-				if(strpos($_, '/') !== false) {
436
+				if (strpos($_, '/') !== false) {
437 437
 					$_ = substr($_, strrpos($_, '/'));
438 438
 				}
439
-				$_ = $dir . str_replace('.html', '', $_);
440
-				if(!isset($target[$_])) {
439
+				$_ = $dir.str_replace('.html', '', $_);
440
+				if (!isset($target[$_])) {
441 441
 					$target[$_] = $modx->getIdFromAlias($_);
442 442
 				}
443 443
 				$target[$_] = trim($target[$_]);
444
-				if(!empty($target[$_])) {
445
-					$href = '[~' . $target[$_] . '~]';
444
+				if (!empty($target[$_])) {
445
+					$href = '[~'.$target[$_].'~]';
446 446
 				}
447
-				$array[$c] = '<a href="' . $href . '"' . $v;
447
+				$array[$c] = '<a href="'.$href.'"'.$v;
448 448
 			}
449 449
 			$c++;
450 450
 		}
Please login to merge, or discard this patch.
manager/actions/mutate_templates.dynamic.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE != "true") {
2
+if (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
 
6
-switch($modx->manager->action) {
6
+switch ($modx->manager->action) {
7 7
 	case 16:
8
-		if(!$modx->hasPermission('edit_template')) {
8
+		if (!$modx->hasPermission('edit_template')) {
9 9
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10 10
 		}
11 11
 		break;
12 12
 	case 19:
13
-		if(!$modx->hasPermission('new_template')) {
13
+		if (!$modx->hasPermission('new_template')) {
14 14
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15 15
 		}
16 16
 		break;
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 $tbl_site_templates = $modx->getFullTableName('site_templates');
24 24
 
25 25
 // check to see the snippet editor isn't locked
26
-if($lockedEl = $modx->elementIsLocked(1, $id)) {
26
+if ($lockedEl = $modx->elementIsLocked(1, $id)) {
27 27
 	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template']));
28 28
 }
29 29
 // end check for lock
@@ -32,15 +32,15 @@  discard block
 block discarded – undo
32 32
 $modx->lockElement(1, $id);
33 33
 
34 34
 $content = array();
35
-if(!empty($id)) {
35
+if (!empty($id)) {
36 36
 	$rs = $modx->db->select('*', $tbl_site_templates, "id='{$id}'");
37 37
 	$content = $modx->db->getRow($rs);
38
-	if(!$content) {
38
+	if (!$content) {
39 39
 		$modx->webAlertAndQuit("No database record has been found for this template.");
40 40
 	}
41 41
 
42 42
 	$_SESSION['itemname'] = $content['templatename'];
43
-	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
43
+	if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
44 44
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
45 45
 	}
46 46
 } else {
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	$content['category'] = intval($_REQUEST['catid']);
49 49
 }
50 50
 
51
-if($modx->manager->hasFormValues()) {
51
+if ($modx->manager->hasFormValues()) {
52 52
 	$modx->manager->loadFormValues();
53 53
 }
54 54
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 // Add lock-element JS-Script
59 59
 $lockElementId = $id;
60 60
 $lockElementType = 1;
61
-require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php');
61
+require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php');
62 62
 ?>
63 63
 <script type="text/javascript">
64 64
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	<?php
101 101
 	// invoke OnTempFormPrerender event
102 102
 	$evtOut = $modx->invokeEvent("OnTempFormPrerender", array("id" => $id));
103
-	if(is_array($evtOut)) {
103
+	if (is_array($evtOut)) {
104 104
 		echo implode("", $evtOut);
105 105
 	}
106 106
 	?>
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	<input type="hidden" name="mode" value="<?= $modx->manager->action ?>">
110 110
 
111 111
 	<h1>
112
-		<i class="fa fa-newspaper-o"></i><?= ($content['templatename'] ? $content['templatename'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_template']) ?><i class="fa fa-question-circle help"></i>
112
+		<i class="fa fa-newspaper-o"></i><?= ($content['templatename'] ? $content['templatename'].'<small>('.$content['id'].')</small>' : $_lang['new_template']) ?><i class="fa fa-question-circle help"></i>
113 113
 	</h1>
114 114
 
115 115
 	<?= $_style['actionbuttons']['dynamic']['element'] ?>
@@ -132,15 +132,15 @@  discard block
 block discarded – undo
132 132
 					<div class="row form-row">
133 133
 						<label class="col-md-3 col-lg-2">
134 134
 							<?= $_lang['template_name'] ?>
135
-							<?php if($id == $modx->config['default_template']) {
136
-								echo '<small class="form-text text-danger">' . mb_strtolower(rtrim($_lang['defaulttemplate_title'], ':'), $modx_manager_charset) . '</small>';
135
+							<?php if ($id == $modx->config['default_template']) {
136
+								echo '<small class="form-text text-danger">'.mb_strtolower(rtrim($_lang['defaulttemplate_title'], ':'), $modx_manager_charset).'</small>';
137 137
 							} ?>
138 138
 						</label>
139 139
 						<div class="col-md-9 col-lg-10">
140 140
 							<div class="form-control-name clearfix">
141 141
 								<input name="templatename" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['templatename']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;">
142
-								<?php if($modx->hasPermission('save_role')): ?>
143
-									<label class="custom-control" title="<?= $_lang['lock_template'] . "\n" . $_lang['lock_template_msg'] ?>" tooltip>
142
+								<?php if ($modx->hasPermission('save_role')): ?>
143
+									<label class="custom-control" title="<?= $_lang['lock_template']."\n".$_lang['lock_template_msg'] ?>" tooltip>
144 144
 										<input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> />
145 145
 										<i class="fa fa-lock"></i>
146 146
 									</label>
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
 							<select name="categoryid" class="form-control" onchange="documentDirty=true;">
163 163
 								<option>&nbsp;</option>
164 164
 								<?php
165
-								include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
166
-								foreach(getCategories() as $n => $v) {
167
-									echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($v["category"]) . "</option>";
165
+								include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
166
+								foreach (getCategories() as $n => $v) {
167
+									echo "<option value='".$v['id']."'".($content["category"] == $v["id"] ? " selected='selected'" : "").">".$modx->htmlspecialchars($v["category"])."</option>";
168 168
 								}
169 169
 								?>
170 170
 							</select>
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 						</div>
178 178
 					</div>
179 179
 				</div>
180
-				<?php if($modx->hasPermission('save_role')): ?>
180
+				<?php if ($modx->hasPermission('save_role')): ?>
181 181
 					<div class="form-group">
182 182
 						<label>
183 183
 							<input name="selectable" type="checkbox"<?= ($selectable == 1 ? ' checked="checked"' : '') ?> /> <?= $_lang['template_selectable'] ?></label>
@@ -198,30 +198,30 @@  discard block
 block discarded – undo
198 198
 
199 199
 			<?php
200 200
 			$selectedTvs = array();
201
-			if(!isset($_POST['assignedTv'])) {
201
+			if (!isset($_POST['assignedTv'])) {
202 202
 				$rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv
203 203
                 LEFT JOIN %s tr ON tv.id=tr.tmplvarid
204 204
                 LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "templateid='{$id}'", "tr.rank DESC, tv.rank DESC, tvcaption DESC, tvid DESC"     // workaround for correct sort of none-existing ranks
205 205
 				);
206
-				while($row = $modx->db->getRow($rs)) {
206
+				while ($row = $modx->db->getRow($rs)) {
207 207
 					$selectedTvs[$row['tvid']] = $row;
208 208
 				}
209
-				$selectedTvs = array_reverse($selectedTvs, true);       // reverse ORDERBY DESC
209
+				$selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC
210 210
 			}
211 211
 
212 212
 			$unselectedTvs = array();
213 213
 			$rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv
214 214
 	    LEFT JOIN %s tr ON tv.id=tr.tmplvarid
215 215
 	    LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "", "category, tvcaption");
216
-			while($row = $modx->db->getRow($rs)) {
216
+			while ($row = $modx->db->getRow($rs)) {
217 217
 				$unselectedTvs[$row['tvid']] = $row;
218 218
 			}
219 219
 
220 220
 			// Catch checkboxes if form not validated
221
-			if(isset($_POST['assignedTv'])) {
221
+			if (isset($_POST['assignedTv'])) {
222 222
 				$selectedTvs = array();
223
-				foreach($_POST['assignedTv'] as $tvid) {
224
-					if(isset($unselectedTvs[$tvid])) {
223
+				foreach ($_POST['assignedTv'] as $tvid) {
224
+					if (isset($unselectedTvs[$tvid])) {
225 225
 						$selectedTvs[$tvid] = $unselectedTvs[$tvid];
226 226
 					}
227 227
 				};
@@ -238,20 +238,20 @@  discard block
 block discarded – undo
238 238
 
239 239
 			<div class="container container-body">
240 240
 				<?php
241
-				if($total > 0) {
242
-					echo '<p>' . $_lang['template_tv_msg'] . '</p>';
241
+				if ($total > 0) {
242
+					echo '<p>'.$_lang['template_tv_msg'].'</p>';
243 243
 				}
244
-				if($modx->hasPermission('save_template') && $total > 1 && $id) {
244
+				if ($modx->hasPermission('save_template') && $total > 1 && $id) {
245 245
 					echo sprintf('<div class="form-group"><a class="btn btn-primary" href="index.php?a=117&amp;id=%s">%s</a></div>', $id, $_lang['template_tv_edit']);
246 246
 				}
247 247
 
248 248
 				// Selected TVs
249 249
 				$tvList = '';
250
-				if($total > 0) {
250
+				if ($total > 0) {
251 251
 					$tvList .= '<ul>';
252
-					foreach($selectedTvs as $row) {
253
-						$desc = !empty($row['tvdescription']) ? '&nbsp;&nbsp;<small>(' . $row['tvdescription'] . ')</small>' : '';
254
-						$locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : "";
252
+					foreach ($selectedTvs as $row) {
253
+						$desc = !empty($row['tvdescription']) ? '&nbsp;&nbsp;<small>('.$row['tvdescription'].')</small>' : '';
254
+						$locked = $row['tvlocked'] ? ' <em>('.$_lang['locked'].')</em>' : "";
255 255
 						$tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" checked="checked" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']);
256 256
 					}
257 257
 					$tvList .= '</ul>';
@@ -262,22 +262,22 @@  discard block
 block discarded – undo
262 262
 				echo $tvList;
263 263
 
264 264
 				// Unselected TVs
265
-				$tvList = '<hr/><p>' . $_lang['template_notassigned_tv'] . '</p><ul>';
265
+				$tvList = '<hr/><p>'.$_lang['template_notassigned_tv'].'</p><ul>';
266 266
 				$preCat = '';
267 267
 				$insideUl = 0;
268
-				while($row = array_shift($unselectedTvs)) {
269
-					if(isset($selectedTvs[$row['tvid']])) {
268
+				while ($row = array_shift($unselectedTvs)) {
269
+					if (isset($selectedTvs[$row['tvid']])) {
270 270
 						continue;
271 271
 					} // Skip selected
272 272
 					$row['category'] = stripslashes($row['category']); //pixelchutes
273
-					if($preCat !== $row['category']) {
273
+					if ($preCat !== $row['category']) {
274 274
 						$tvList .= $insideUl ? '</ul>' : '';
275
-						$tvList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>';
275
+						$tvList .= '<li><strong>'.$row['category'].($row['catid'] != '' ? ' <small>('.$row['catid'].')</small>' : '').'</strong><ul>';
276 276
 						$insideUl = 1;
277 277
 					}
278 278
 
279
-					$desc = !empty($row['tvdescription']) ? '&nbsp;&nbsp;<small>(' . $row['tvdescription'] . ')</small>' : '';
280
-					$locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : "";
279
+					$desc = !empty($row['tvdescription']) ? '&nbsp;&nbsp;<small>('.$row['tvdescription'].')</small>' : '';
280
+					$locked = $row['tvlocked'] ? ' <em>('.$_lang['locked'].')</em>' : "";
281 281
 					$tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']);
282 282
 					$tvList .= '</li>';
283 283
 
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 		<?php
295 295
 		// invoke OnTempFormRender event
296 296
 		$evtOut = $modx->invokeEvent("OnTempFormRender", array("id" => $id));
297
-		if(is_array($evtOut)) {
297
+		if (is_array($evtOut)) {
298 298
 			echo implode("", $evtOut);
299 299
 		}
300 300
 		?>
Please login to merge, or discard this patch.
manager/actions/mutate_settings/tab5_security_settings.inc.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
     $MODX_SITE_HOSTNAMES = MODX_SITE_HOSTNAMES; // Fix for PHP 5.4
3
-    if(empty($valid_hostnames) && empty($MODX_SITE_HOSTNAMES)) $valid_hostnames = $_SERVER['HTTP_HOST'];
3
+    if (empty($valid_hostnames) && empty($MODX_SITE_HOSTNAMES)) $valid_hostnames = $_SERVER['HTTP_HOST'];
4 4
 ?>
5 5
 <!-- Interface & editor settings -->
6 6
 <div class="tab-page" id="tabPageSecurity">
@@ -11,10 +11,10 @@  discard block
 block discarded – undo
11 11
 <tr>
12 12
 <th><?php echo $_lang['allow_eval_title']; ?><br><small>[(allow_eval)]</small></th>
13 13
 <td>
14
-<?php echo wrap_label($_lang['allow_eval_with_scan']         , form_radio('allow_eval','with_scan'));?><br />
15
-<?php echo wrap_label($_lang['allow_eval_with_scan_at_post'] , form_radio('allow_eval','with_scan_at_post'));?><br />
16
-<?php echo wrap_label($_lang['allow_eval_everytime_eval']    , form_radio('allow_eval','everytime_eval'));?><br />
17
-<?php echo wrap_label($_lang['allow_eval_dont_eval']         , form_radio('allow_eval','dont_eval'));?>
14
+<?php echo wrap_label($_lang['allow_eval_with_scan'], form_radio('allow_eval', 'with_scan')); ?><br />
15
+<?php echo wrap_label($_lang['allow_eval_with_scan_at_post'], form_radio('allow_eval', 'with_scan_at_post')); ?><br />
16
+<?php echo wrap_label($_lang['allow_eval_everytime_eval'], form_radio('allow_eval', 'everytime_eval')); ?><br />
17
+<?php echo wrap_label($_lang['allow_eval_dont_eval'], form_radio('allow_eval', 'dont_eval')); ?>
18 18
     <div class="comment">
19 19
         <?php echo $_lang['allow_eval_msg'] ?>
20 20
     </div>
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 <tr>
40 40
     <th><?php echo $_lang['check_files_onlogin_title'] ?><br><small>[(check_files_onlogin)]</small></th>
41 41
     <td>
42
-      <textarea name="check_files_onlogin"><?php echo $check_files_onlogin;?></textarea><br />
42
+      <textarea name="check_files_onlogin"><?php echo $check_files_onlogin; ?></textarea><br />
43 43
         
44 44
 </td>
45 45
 </tr>
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
     <tr>
50 50
       <td nowrap class="warning"><?php echo $_lang['validate_referer_title'] ?><br><small>[(validate_referer)]</small></td>
51 51
       <td>
52
-        <?php echo wrap_label($_lang['yes'],form_radio('validate_referer', 1));?><br />
53
-        <?php echo wrap_label($_lang['no'], form_radio('validate_referer', 0));?>
52
+        <?php echo wrap_label($_lang['yes'], form_radio('validate_referer', 1)); ?><br />
53
+        <?php echo wrap_label($_lang['no'], form_radio('validate_referer', 0)); ?>
54 54
       </td>
55 55
     </tr>
56 56
     <tr>
@@ -85,25 +85,25 @@  discard block
 block discarded – undo
85 85
   <tr>
86 86
 <th><?php echo $_lang['a17_error_reporting_title']; ?><br><small>[(error_reporting)]</small></th>
87 87
 <td>
88
-<?php echo wrap_label($_lang['a17_error_reporting_opt0'], form_radio('error_reporting','0'));?><br />
89
-<?php echo wrap_label($_lang['a17_error_reporting_opt1'], form_radio('error_reporting','1'));?><br />
90
-<?php echo wrap_label($_lang['a17_error_reporting_opt2'], form_radio('error_reporting','2'));?><br />
91
-<?php echo wrap_label($_lang['a17_error_reporting_opt99'],form_radio('error_reporting','99'));?>
88
+<?php echo wrap_label($_lang['a17_error_reporting_opt0'], form_radio('error_reporting', '0')); ?><br />
89
+<?php echo wrap_label($_lang['a17_error_reporting_opt1'], form_radio('error_reporting', '1')); ?><br />
90
+<?php echo wrap_label($_lang['a17_error_reporting_opt2'], form_radio('error_reporting', '2')); ?><br />
91
+<?php echo wrap_label($_lang['a17_error_reporting_opt99'], form_radio('error_reporting', '99')); ?>
92 92
 </td>
93 93
 </tr>
94 94
 <tr>
95 95
     <td width="200">&nbsp;</td>
96
-    <td class="comment"> <?php echo $_lang['a17_error_reporting_msg'];?></td>
96
+    <td class="comment"> <?php echo $_lang['a17_error_reporting_msg']; ?></td>
97 97
 </tr>
98 98
 <tr><td colspan="2"><div class="split"></div></td></tr>
99 99
 <tr>
100 100
 <th><?php echo $_lang['mutate_settings.dynamic.php6']; ?><br><small>[(send_errormail)]</small></th>
101 101
 <td>
102
-<?php echo wrap_label($_lang['mutate_settings.dynamic.php7'],form_radio('send_errormail','0'));?><br />
103
-<?php echo wrap_label('error',form_radio('send_errormail','3'));?><br />
104
-<?php echo wrap_label('error + warning',form_radio('send_errormail','2'));?><br />
105
-<?php echo wrap_label('error + warning + information',form_radio('send_errormail','1'));?><br />
106
-<?php echo parseText($_lang['mutate_settings.dynamic.php8'],array('emailsender'=>$modx->config['emailsender']));?></td>
102
+<?php echo wrap_label($_lang['mutate_settings.dynamic.php7'], form_radio('send_errormail', '0')); ?><br />
103
+<?php echo wrap_label('error', form_radio('send_errormail', '3')); ?><br />
104
+<?php echo wrap_label('error + warning', form_radio('send_errormail', '2')); ?><br />
105
+<?php echo wrap_label('error + warning + information', form_radio('send_errormail', '1')); ?><br />
106
+<?php echo parseText($_lang['mutate_settings.dynamic.php8'], array('emailsender'=>$modx->config['emailsender'])); ?></td>
107 107
 </tr>
108 108
    <tr>
109 109
     <td colspan="2"><div class="split"></div></td>
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
 <tr>
112 112
 <th><?php echo $_lang['enable_bindings_title'] ?><br><small>[(enable_bindings)]</small></th>
113 113
 <td>
114
-<?php echo wrap_label($_lang['yes'],form_radio('enable_bindings','1'));?><br />
115
-<?php echo wrap_label($_lang['no'], form_radio('enable_bindings','0'));?>
114
+<?php echo wrap_label($_lang['yes'], form_radio('enable_bindings', '1')); ?><br />
115
+<?php echo wrap_label($_lang['no'], form_radio('enable_bindings', '0')); ?>
116 116
 
117 117
 </td>
118 118
 </tr>
@@ -153,20 +153,20 @@  discard block
 block discarded – undo
153 153
 <th><?php echo $_lang['pwd_hash_algo_title'] ?><br><small>[(pwd_hash_algo)]</small></th>
154 154
 <td>
155 155
 <?php
156
-if(empty($pwd_hash_algo)) $phm['sel']['UNCRYPT'] = 1;
157
-$phm['e']['BLOWFISH_Y'] = $modx->manager->checkHashAlgorithm('BLOWFISH_Y') ? 0:1;
158
-$phm['e']['BLOWFISH_A'] = $modx->manager->checkHashAlgorithm('BLOWFISH_A') ? 0:1;
159
-$phm['e']['SHA512']     = $modx->manager->checkHashAlgorithm('SHA512') ? 0:1;
160
-$phm['e']['SHA256']     = $modx->manager->checkHashAlgorithm('SHA256') ? 0:1;
161
-$phm['e']['MD5']        = $modx->manager->checkHashAlgorithm('MD5') ? 0:1;
162
-$phm['e']['UNCRYPT']    = $modx->manager->checkHashAlgorithm('UNCRYPT') ? 0:1;
156
+if (empty($pwd_hash_algo)) $phm['sel']['UNCRYPT'] = 1;
157
+$phm['e']['BLOWFISH_Y'] = $modx->manager->checkHashAlgorithm('BLOWFISH_Y') ? 0 : 1;
158
+$phm['e']['BLOWFISH_A'] = $modx->manager->checkHashAlgorithm('BLOWFISH_A') ? 0 : 1;
159
+$phm['e']['SHA512']     = $modx->manager->checkHashAlgorithm('SHA512') ? 0 : 1;
160
+$phm['e']['SHA256']     = $modx->manager->checkHashAlgorithm('SHA256') ? 0 : 1;
161
+$phm['e']['MD5']        = $modx->manager->checkHashAlgorithm('MD5') ? 0 : 1;
162
+$phm['e']['UNCRYPT']    = $modx->manager->checkHashAlgorithm('UNCRYPT') ? 0 : 1;
163 163
 ?>
164
-<?php echo wrap_label('CRYPT_BLOWFISH_Y (salt &amp; stretch)',form_radio('pwd_hash_algo','BLOWFISH_Y', '', $phm['e']['BLOWFISH_Y']));?><br />
165
-<?php echo wrap_label('CRYPT_BLOWFISH_A (salt &amp; stretch)',form_radio('pwd_hash_algo','BLOWFISH_A', '', $phm['e']['BLOWFISH_A']));?><br />
166
-<?php echo wrap_label('CRYPT_SHA512 (salt &amp; stretch)'    ,form_radio('pwd_hash_algo','SHA512'    , '', $phm['e']['SHA512']));?><br />
167
-<?php echo wrap_label('CRYPT_SHA256 (salt &amp; stretch)'    ,form_radio('pwd_hash_algo','SHA256'    , '', $phm['e']['SHA256']));?><br />
168
-<?php echo wrap_label('CRYPT_MD5 (salt &amp; stretch)'       ,form_radio('pwd_hash_algo','MD5'       , '', $phm['e']['MD5']));?><br />
169
-<?php echo wrap_label('UNCRYPT(32 chars salt + SHA-1 hash)'  ,form_radio('pwd_hash_algo','UNCRYPT'  , '', $phm['e']['UNCRYPT']));?>
164
+<?php echo wrap_label('CRYPT_BLOWFISH_Y (salt &amp; stretch)', form_radio('pwd_hash_algo', 'BLOWFISH_Y', '', $phm['e']['BLOWFISH_Y'])); ?><br />
165
+<?php echo wrap_label('CRYPT_BLOWFISH_A (salt &amp; stretch)', form_radio('pwd_hash_algo', 'BLOWFISH_A', '', $phm['e']['BLOWFISH_A'])); ?><br />
166
+<?php echo wrap_label('CRYPT_SHA512 (salt &amp; stretch)', form_radio('pwd_hash_algo', 'SHA512', '', $phm['e']['SHA512'])); ?><br />
167
+<?php echo wrap_label('CRYPT_SHA256 (salt &amp; stretch)', form_radio('pwd_hash_algo', 'SHA256', '', $phm['e']['SHA256'])); ?><br />
168
+<?php echo wrap_label('CRYPT_MD5 (salt &amp; stretch)', form_radio('pwd_hash_algo', 'MD5', '', $phm['e']['MD5'])); ?><br />
169
+<?php echo wrap_label('UNCRYPT(32 chars salt + SHA-1 hash)', form_radio('pwd_hash_algo', 'UNCRYPT', '', $phm['e']['UNCRYPT'])); ?>
170 170
 </td>
171 171
 </tr>
172 172
 <tr>
@@ -182,13 +182,13 @@  discard block
 block discarded – undo
182 182
   ?>
183 183
 <?php
184 184
 $gdAvailable = extension_loaded('gd');
185
-if(!$gdAvailable) $use_captcha = 0;
185
+if (!$gdAvailable) $use_captcha = 0;
186 186
 ?>
187 187
   <tr>
188 188
     <td nowrap class="warning"><?php echo $_lang['captcha_title'] ?><br><small>[(use_captcha)]</small></td>
189
-    <td> <label><input type="radio" id="captchaOn" name="use_captcha" value="1" <?php echo ($use_captcha==1) ? 'checked="checked"' : "" ; echo (!$gdAvailable)? ' readonly="readonly"' : ''; ?> />
189
+    <td> <label><input type="radio" id="captchaOn" name="use_captcha" value="1" <?php echo ($use_captcha == 1) ? 'checked="checked"' : ""; echo (!$gdAvailable) ? ' readonly="readonly"' : ''; ?> />
190 190
       <?php echo $_lang['yes']?></label><br />
191
-      <label><input type="radio" id="captchaOff" name="use_captcha" value="0" <?php echo ($use_captcha==0) ? 'checked="checked"' : "" ; echo (!$gdAvailable)? ' readonly="readonly"' : '';?> />
191
+      <label><input type="radio" id="captchaOff" name="use_captcha" value="0" <?php echo ($use_captcha == 0) ? 'checked="checked"' : ""; echo (!$gdAvailable) ? ' readonly="readonly"' : ''; ?> />
192 192
       <?php echo $_lang['no']?></label> </td>
193 193
   </tr>
194 194
   <tr>
@@ -198,23 +198,23 @@  discard block
 block discarded – undo
198 198
   <tr>
199 199
     <td colspan="2"><div class="split"></div></td>
200 200
   </tr>
201
-  <tr class="captchaRow" <?php echo showHide($use_captcha==1);?>>
201
+  <tr class="captchaRow" <?php echo showHide($use_captcha == 1); ?>>
202 202
     <td nowrap class="warning"><?php echo $_lang['captcha_words_title'] ?><br><small>[(captcha_words)]</small>
203 203
       <br />
204 204
       <p><?php echo $_lang['update_settings_from_language']; ?></p>
205 205
       <select name="reload_captcha_words" id="reload_captcha_words_select" onchange="confirmLangChange(this, 'captcha_words_default', 'captcha_words_input');">
206
-<?php echo get_lang_options('captcha_words_default');?>
206
+<?php echo get_lang_options('captcha_words_default'); ?>
207 207
       </select>
208 208
     </td>
209 209
     <td><input type="text" id="captcha_words_input" name="captcha_words" style="width:250px" value="<?php echo $captcha_words; ?>" />
210
-        <input type="hidden" name="captcha_words_default" id="captcha_words_default_hidden" value="<?php echo addslashes($_lang['captcha_words_default']);?>" />
210
+        <input type="hidden" name="captcha_words_default" id="captcha_words_default_hidden" value="<?php echo addslashes($_lang['captcha_words_default']); ?>" />
211 211
     </td>
212 212
   </tr>
213
-  <tr class="captchaRow" <?php echo showHide($use_captcha==1);?>>
213
+  <tr class="captchaRow" <?php echo showHide($use_captcha == 1); ?>>
214 214
     <td width="200">&nbsp;</td>
215 215
     <td class="comment"><?php echo $_lang['captcha_words_message'] ?></td>
216 216
   </tr>
217
-  <tr class="captchaRow" <?php echo showHide($use_captcha==1);?>>
217
+  <tr class="captchaRow" <?php echo showHide($use_captcha == 1); ?>>
218 218
     <td colspan="2"><div class="split"></div></td>
219 219
   </tr>
220 220
 </table>
Please login to merge, or discard this patch.
manager/actions/mutate_settings/tab3_user_settings.inc.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
   <tr>
7 7
     <td nowrap class="warning"><?php echo $_lang['udperms_title'] ?><br><small>[(use_udperms)]</small></td>
8 8
     <td>
9
-        <?php echo wrap_label($_lang['yes'],form_radio('use_udperms', 1, 'id="udPermsOn"'));?><br />
10
-        <?php echo wrap_label($_lang['no'], form_radio('use_udperms', 0, 'id="udPermsOff"'));?>
9
+        <?php echo wrap_label($_lang['yes'], form_radio('use_udperms', 1, 'id="udPermsOn"')); ?><br />
10
+        <?php echo wrap_label($_lang['no'], form_radio('use_udperms', 0, 'id="udPermsOff"')); ?>
11 11
     </td>
12 12
   </tr>
13 13
   <tr>
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
   <tr>
18 18
     <td colspan="2"><div class="split"></div></td>
19 19
   </tr>
20
-  <tr class="udPerms" <?php echo showHide($use_udperms==1);?>>
20
+  <tr class="udPerms" <?php echo showHide($use_udperms == 1); ?>>
21 21
     <td nowrap class="warning"><?php echo $_lang['udperms_allowroot_title'] ?><br><small>[(udperms_allowroot)]</small></td>
22 22
     <td>
23
-      <label><input type="radio" name="udperms_allowroot" value="1" <?php echo $udperms_allowroot=='1' ? 'checked="checked"' : "" ; ?> />
23
+      <label><input type="radio" name="udperms_allowroot" value="1" <?php echo $udperms_allowroot == '1' ? 'checked="checked"' : ""; ?> />
24 24
       <?php echo $_lang['yes']?></label><br />
25
-      <label><input type="radio" name="udperms_allowroot" value="0" <?php echo $udperms_allowroot=='0' ? 'checked="checked"' : "" ; ?> />
25
+      <label><input type="radio" name="udperms_allowroot" value="0" <?php echo $udperms_allowroot == '0' ? 'checked="checked"' : ""; ?> />
26 26
       <?php echo $_lang['no']?></label>
27 27
     </td>
28 28
   </tr>
29
-  <tr class="udPerms" <?php echo showHide($use_udperms==1);?>>
29
+  <tr class="udPerms" <?php echo showHide($use_udperms == 1); ?>>
30 30
     <td width="200">&nbsp;</td>
31 31
     <td class="comment"><?php echo $_lang['udperms_allowroot_message'] ?></td>
32 32
   </tr>
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
   <tr>
40 40
     <td nowrap class="warning"><?php echo $_lang['email_method_title'] ?><br><small>[(email_method)]</small></td>
41 41
     <td>
42
-        <?php echo wrap_label($_lang['email_method_mail'],form_radio('email_method','mail','id="useMail"'));?><br />
43
-        <?php echo wrap_label($_lang['email_method_smtp'],form_radio('email_method','smtp','id="useSmtp"'));?>
44
-        <div class="smtpRow" <?php echo showHide($email_method=='smtp');?>>
45
-            <?php include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/snippet_smtp.inc.php'); ?>
42
+        <?php echo wrap_label($_lang['email_method_mail'], form_radio('email_method', 'mail', 'id="useMail"')); ?><br />
43
+        <?php echo wrap_label($_lang['email_method_smtp'], form_radio('email_method', 'smtp', 'id="useSmtp"')); ?>
44
+        <div class="smtpRow" <?php echo showHide($email_method == 'smtp'); ?>>
45
+            <?php include_once(MODX_MANAGER_PATH.'actions/mutate_settings/snippet_smtp.inc.php'); ?>
46 46
         </div>
47 47
     </td>
48 48
   </tr>
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
       <br />
55 55
       <p><?php echo $_lang['update_settings_from_language']; ?></p>
56 56
       <select name="reload_emailsubject" id="reload_emailsubject_select" onchange="confirmLangChange(this, 'emailsubject_default', 'emailsubject_field');">
57
-<?php echo get_lang_options('emailsubject_default');?>
57
+<?php echo get_lang_options('emailsubject_default'); ?>
58 58
       </select>
59 59
     </td>
60 60
     <td ><input id="emailsubject_field" name="emailsubject" onchange="documentDirty=true;" type="text" maxlength="255" style="width: 250px;" value="<?php echo $emailsubject; ?>" />
61
-        <input type="hidden" name="emailsubject_default" id="emailsubject_default_hidden" value="<?php echo addslashes($_lang['emailsubject_default']);?>" />
61
+        <input type="hidden" name="emailsubject_default" id="emailsubject_default_hidden" value="<?php echo addslashes($_lang['emailsubject_default']); ?>" />
62 62
     </td>
63 63
   </tr>
64 64
   <tr>
@@ -73,11 +73,11 @@  discard block
 block discarded – undo
73 73
       <br />
74 74
       <p><?php echo $_lang['update_settings_from_language']; ?></p>
75 75
       <select name="reload_signupemail_message" id="reload_signupemail_message_select" onchange="confirmLangChange(this, 'system_email_signup', 'signupemail_message_textarea');">
76
-<?php echo get_lang_options('system_email_signup');?>
76
+<?php echo get_lang_options('system_email_signup'); ?>
77 77
       </select>
78 78
     </td>
79 79
     <td> <textarea id="signupemail_message_textarea" name="signupemail_message" style="width:100%; height: 120px;"><?php echo $signupemail_message; ?></textarea>
80
-        <input type="hidden" name="system_email_signup_default" id="system_email_signup_hidden" value="<?php echo addslashes($_lang['system_email_signup']);?>" />
80
+        <input type="hidden" name="system_email_signup_default" id="system_email_signup_hidden" value="<?php echo addslashes($_lang['system_email_signup']); ?>" />
81 81
     </td>
82 82
   </tr>
83 83
   <tr>
@@ -92,11 +92,11 @@  discard block
 block discarded – undo
92 92
       <br />
93 93
       <p><?php echo $_lang['update_settings_from_language']; ?></p>
94 94
       <select name="reload_websignupemail_message" id="reload_websignupemail_message_select" onchange="confirmLangChange(this, 'system_email_websignup', 'websignupemail_message_textarea');">
95
-<?php echo get_lang_options('system_email_websignup');?>
95
+<?php echo get_lang_options('system_email_websignup'); ?>
96 96
       </select>
97 97
     </td>
98 98
     <td> <textarea id="websignupemail_message_textarea" name="websignupemail_message" style="width:100%; height: 120px;"><?php echo $websignupemail_message; ?></textarea>
99
-        <input type="hidden" name="system_email_websignup_default" id="system_email_websignup_hidden" value="<?php echo addslashes($_lang['system_email_websignup']);?>" />
99
+        <input type="hidden" name="system_email_websignup_default" id="system_email_websignup_hidden" value="<?php echo addslashes($_lang['system_email_websignup']); ?>" />
100 100
     </td>
101 101
   </tr>
102 102
   <tr>
@@ -111,11 +111,11 @@  discard block
 block discarded – undo
111 111
       <br />
112 112
       <p><?php echo $_lang['update_settings_from_language']; ?></p>
113 113
       <select name="reload_system_email_webreminder_message" id="reload_system_email_webreminder_select" onchange="confirmLangChange(this, 'system_email_webreminder', 'system_email_webreminder_textarea');">
114
-<?php echo get_lang_options('system_email_webreminder');?>
114
+<?php echo get_lang_options('system_email_webreminder'); ?>
115 115
       </select>
116 116
     </td>
117 117
     <td> <textarea id="system_email_webreminder_textarea" name="webpwdreminder_message" style="width:100%; height: 120px;"><?php echo $webpwdreminder_message; ?></textarea>
118
-        <input type="hidden" name="system_email_webreminder_default" id="system_email_webreminder_hidden" value="<?php echo addslashes($_lang['system_email_webreminder']);?>" />
118
+        <input type="hidden" name="system_email_webreminder_default" id="system_email_webreminder_hidden" value="<?php echo addslashes($_lang['system_email_webreminder']); ?>" />
119 119
     </td>
120 120
   </tr>
121 121
   <tr>
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         <?php
128 128
             // invoke OnUserSettingsRender event
129 129
             $evtOut = $modx->invokeEvent('OnUserSettingsRender');
130
-            if(is_array($evtOut)) echo implode("",$evtOut);
130
+            if (is_array($evtOut)) echo implode("", $evtOut);
131 131
         ?>
132 132
     </td>
133 133
   </tr>
Please login to merge, or discard this patch.
manager/actions/mutate_settings/tab7_filebrowser_settings.inc.php 1 patch
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
   <tr>
7 7
     <td nowrap class="warning"><?php echo $_lang['rb_title']?><br><small>[(use_browser)]</small></td>
8 8
     <td>
9
-        <?php echo wrap_label($_lang['yes'],form_radio('use_browser', 1, 'id="rbRowOn"'));?><br />
10
-        <?php echo wrap_label($_lang['no'], form_radio('use_browser', 0, 'id="rbRowOff"'));?>
9
+        <?php echo wrap_label($_lang['yes'], form_radio('use_browser', 1, 'id="rbRowOn"')); ?><br />
10
+        <?php echo wrap_label($_lang['no'], form_radio('use_browser', 0, 'id="rbRowOff"')); ?>
11 11
     </td>
12 12
   </tr>
13 13
   <tr>
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     <td colspan="2"><div class="split"></div></td>
19 19
   </tr>
20 20
   
21
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
21
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
22 22
     <td nowrap class="warning"><?php echo $_lang['which_browser_default_title']?><br><small>[(which_browser)]</small></td>
23 23
     <td>
24 24
         <select name="which_browser" size="1" class="inputBox" onchange="documentDirty=true;">
@@ -27,206 +27,206 @@  discard block
 block discarded – undo
27 27
                 $dir = str_replace('\\', '/', $dir);
28 28
                 $browser_name = substr($dir, strrpos($dir, '/') + 1);
29 29
                 $selected = $browser_name == $which_browser ? ' selected="selected"' : '';
30
-                echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n";
30
+                echo '<option value="'.$browser_name.'"'.$selected.'>'."{$browser_name}</option>\n";
31 31
             }
32 32
             ?>
33 33
         </select>
34 34
     </td>
35 35
   </tr>
36
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
36
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
37 37
     <td width="200">&nbsp;</td>
38 38
     <td class="comment"><?php echo $_lang['which_browser_default_msg']?></td>
39 39
   </tr>
40 40
   <tr>
41 41
     <td colspan="2"><div class="split"></div></td>
42 42
   </tr>
43
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
43
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
44 44
     <td nowrap class="warning"><?php echo $_lang['rb_webuser_title']?><br><small>[(rb_webuser)]</small></td>
45 45
     <td>
46
-      <label><input type="radio" name="rb_webuser" value="1" <?php echo $rb_webuser=='1' ? 'checked="checked"' : "" ; ?> />
46
+      <label><input type="radio" name="rb_webuser" value="1" <?php echo $rb_webuser == '1' ? 'checked="checked"' : ""; ?> />
47 47
       <?php echo $_lang['yes']?></label><br />
48
-      <label><input type="radio" name="rb_webuser" value="0" <?php echo $rb_webuser=='0' ? 'checked="checked"' : "" ; ?> />
48
+      <label><input type="radio" name="rb_webuser" value="0" <?php echo $rb_webuser == '0' ? 'checked="checked"' : ""; ?> />
49 49
       <?php echo $_lang['no']?></label>
50 50
     </td>
51 51
   </tr>
52
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
52
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
53 53
     <td width="200">&nbsp;</td>
54 54
     <td class="comment"><?php echo $_lang['rb_webuser_message']?></td>
55 55
   </tr>
56
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
56
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
57 57
     <td colspan="2"><div class="split"></div></td>
58 58
   </tr>
59
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
59
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
60 60
     <td nowrap class="warning"><?php echo $_lang['rb_base_dir_title']?><br><small>[(rb_base_dir)]</small></td>
61 61
     <td>
62 62
         <?php echo $_lang['default']; ?> <span id="default_rb_base_dir">[(base_path)]assets/</span><br />
63 63
         <input onchange="documentDirty=true;" type="text" maxlength="255" style="width: 250px;" name="rb_base_dir" id="rb_base_dir" value="<?php echo $rb_base_dir; ?>" /> <input type="button" onclick="reset_path('rb_base_dir');" value="<?php echo $_lang['reset']; ?>" name="reset_rb_base_dir">
64 64
     </td>
65 65
   </tr>
66
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
66
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
67 67
     <td width="200">&nbsp;</td>
68 68
     <td class="comment"><?php echo $_lang['rb_base_dir_message']?></td>
69 69
   </tr>
70
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
70
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
71 71
     <td colspan="2"><div class="split"></div></td>
72 72
   </tr>
73
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
73
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
74 74
     <td nowrap class="warning"><?php echo $_lang['rb_base_url_title']?><br><small>[(rb_base_url)]</small></td>
75 75
     <td>
76 76
       <input onchange="documentDirty=true;" type="text" maxlength="255" style="width: 250px;" name="rb_base_url" value="<?php echo $rb_base_url; ?>" />
77 77
       </td>
78 78
   </tr>
79
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
79
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
80 80
     <td width="200">&nbsp;</td>
81 81
     <td class="comment"><?php echo $_lang['rb_base_url_message']?></td>
82 82
   </tr>
83
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
83
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
84 84
     <td colspan="2"><div class="split"></div></td>
85 85
   </tr>
86
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
86
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
87 87
       <td nowrap class="warning"><?php echo $_lang['clean_uploaded_filename']?><br><small>[(clean_uploaded_filename)]</small></td>
88 88
       <td>
89
-        <label><input type="radio" name="clean_uploaded_filename" value="1" <?php echo $clean_uploaded_filename=='1' ? 'checked="checked"' : "" ; ?> />
89
+        <label><input type="radio" name="clean_uploaded_filename" value="1" <?php echo $clean_uploaded_filename == '1' ? 'checked="checked"' : ""; ?> />
90 90
         <?php echo $_lang['yes']?></label><br />
91
-        <label><input type="radio" name="clean_uploaded_filename" value="0" <?php echo $clean_uploaded_filename=='0' ? 'checked="checked"' : "" ; ?> />
91
+        <label><input type="radio" name="clean_uploaded_filename" value="0" <?php echo $clean_uploaded_filename == '0' ? 'checked="checked"' : ""; ?> />
92 92
         <?php echo $_lang['no']?></label>
93 93
       </td>
94 94
   </tr>
95
-    <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
95
+    <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
96 96
       <td width="200">&nbsp;</td>
97
-      <td class="comment"><?php echo $_lang['clean_uploaded_filename_message'];?></td>
97
+      <td class="comment"><?php echo $_lang['clean_uploaded_filename_message']; ?></td>
98 98
     </tr>
99
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
99
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
100 100
   <td colspan="2"><div class="split"></div></td>
101 101
   </tr>
102
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
102
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
103 103
     <td nowrap class="warning"><?php echo $_lang['settings_strip_image_paths_title']?><br><small>[(strip_image_paths)]</small></td>
104 104
     <td>
105
-      <label><input type="radio" name="strip_image_paths" value="1" <?php echo $strip_image_paths=='1' ? 'checked="checked"' : "" ; ?> />
105
+      <label><input type="radio" name="strip_image_paths" value="1" <?php echo $strip_image_paths == '1' ? 'checked="checked"' : ""; ?> />
106 106
       <?php echo $_lang['yes']?></label><br />
107
-      <label><input type="radio" name="strip_image_paths" value="0" <?php echo $strip_image_paths=='0' ? 'checked="checked"' : "" ; ?> />
107
+      <label><input type="radio" name="strip_image_paths" value="0" <?php echo $strip_image_paths == '0' ? 'checked="checked"' : ""; ?> />
108 108
       <?php echo $_lang['no']?></label>
109 109
     </td>
110 110
   </tr>
111
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
111
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
112 112
     <td width="200">&nbsp;</td>
113 113
     <td class="comment"><?php echo $_lang['settings_strip_image_paths_message']?></td>
114 114
   </tr>
115
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
115
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
116 116
     <td colspan="2"><div class="split"></div></td>
117 117
   </tr>
118
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
118
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
119 119
     <td nowrap class="warning"><?php echo $_lang['maxImageWidth']?><br><small>[(maxImageWidth)]</small></td>
120 120
     <td>
121 121
       <input onchange="documentDirty=true;" type="text" maxlength="4" style="width: 50px;" name="maxImageWidth" value="<?php echo $maxImageWidth; ?>" />
122 122
     </td>
123 123
   </tr>
124
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
124
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
125 125
     <td width="200">&nbsp;</td>
126 126
     <td class="comment"><?php echo $_lang['maxImageWidth_message']?></td>
127 127
   </tr>
128
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
128
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
129 129
     <td colspan="2"><div class="split"></div></td>
130 130
   </tr>
131
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
131
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
132 132
     <td nowrap class="warning"><?php echo $_lang['maxImageHeight']?><br><small>[(maxImageHeight)]</small></td>
133 133
     <td>
134 134
       <input onchange="documentDirty=true;" type="text" maxlength="4" style="width: 50px;" name="maxImageHeight" value="<?php echo $maxImageHeight; ?>" />
135 135
     </td>
136 136
   </tr>
137
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
137
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
138 138
     <td width="200">&nbsp;</td>
139 139
     <td class="comment"><?php echo $_lang['maxImageHeight_message']?></td>
140 140
   </tr>
141
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
141
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
142 142
     <td colspan="2"><div class="split"></div></td>
143 143
   </tr>
144
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
144
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
145 145
     <td nowrap class="warning"><?php echo $_lang['thumbWidth']?><br><small>[(thumbWidth)]</small></td>
146 146
     <td>
147 147
       <input onchange="documentDirty=true;" type="text" maxlength="4" style="width: 50px;" name="thumbWidth" value="<?php echo $thumbWidth; ?>" />
148 148
     </td>
149 149
   </tr>
150
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
150
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
151 151
     <td width="200">&nbsp;</td>
152 152
     <td class="comment"><?php echo $_lang['thumbWidth_message']?></td>
153 153
   </tr>
154
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
154
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
155 155
     <td colspan="2"><div class="split"></div></td>
156 156
   </tr>
157
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
157
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
158 158
     <td nowrap class="warning"><?php echo $_lang['thumbHeight']?><br><small>[(thumbHeight)]</small></td>
159 159
     <td>
160 160
       <input onchange="documentDirty=true;" type="text" maxlength="4" style="width: 50px;" name="thumbHeight" value="<?php echo $thumbHeight; ?>" />
161 161
     </td>
162 162
   </tr>
163
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
163
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
164 164
     <td width="200">&nbsp;</td>
165 165
     <td class="comment"><?php echo $_lang['thumbHeight_message']?></td>
166 166
   </tr>
167
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
167
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
168 168
     <td colspan="2"><div class="split"></div></td>
169 169
   </tr>
170
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
170
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
171 171
     <td nowrap class="warning"><?php echo $_lang['thumbsDir']?><br><small>[(thumbsDir)]</small></td>
172 172
     <td>
173 173
       <input onchange="documentDirty=true;" type="text" maxlength="255" style="width: 250px;" name="thumbsDir" value="<?php echo $thumbsDir; ?>" />
174 174
     </td>
175 175
   </tr>
176
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
176
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
177 177
     <td width="200">&nbsp;</td>
178 178
     <td class="comment"><?php echo $_lang['thumbsDir_message']?></td>
179 179
   </tr>
180
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
180
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
181 181
     <td colspan="2"><div class="split"></div></td>
182 182
   </tr>
183
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
183
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
184 184
     <td nowrap class="warning"><?php echo $_lang['jpegQuality']?><br><small>[(jpegQuality)]</small></td>
185 185
     <td>
186 186
       <input onchange="documentDirty=true;" type="text" maxlength="4" style="width: 50px;" name="jpegQuality" value="<?php echo $jpegQuality; ?>" />
187 187
     </td>
188 188
   </tr>
189
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
189
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
190 190
     <td width="200">&nbsp;</td>
191 191
     <td class="comment"><?php echo $_lang['jpegQuality_message']?></td>
192 192
   </tr>
193
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
193
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
194 194
     <td colspan="2"><div class="split"></div></td>
195 195
   </tr>
196
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
196
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
197 197
        <td nowrap class="warning"><?php echo $_lang['denyZipDownload'] ?><br><small>[(denyZipDownload)]</small></td>
198 198
         <td>
199
-          <label><input type="radio" name="denyZipDownload" value="0" <?php echo $denyZipDownload=='0' ? 'checked="checked"' : ""; ?> />
199
+          <label><input type="radio" name="denyZipDownload" value="0" <?php echo $denyZipDownload == '0' ? 'checked="checked"' : ""; ?> />
200 200
           <?php echo $_lang['no']?></label><br />
201
-          <label><input type="radio" name="denyZipDownload" value="1" <?php echo $denyZipDownload=='1' ? 'checked="checked"' : ""; ?> />
201
+          <label><input type="radio" name="denyZipDownload" value="1" <?php echo $denyZipDownload == '1' ? 'checked="checked"' : ""; ?> />
202 202
           <?php echo $_lang['yes']?></label>
203 203
         </td>
204 204
   </tr>
205
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
205
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
206 206
     <td colspan="2"><div class="split"></div></td>
207 207
   </tr>
208
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
208
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
209 209
         <td nowrap class="warning"><?php echo $_lang['denyExtensionRename'] ?><br><small>[(denyExtensionRename)]</small></td>
210 210
         <td>
211
-           <label><input type="radio" name="denyExtensionRename" value="0" <?php echo $denyExtensionRename=='0' ? 'checked="checked"' : ""; ?> />
211
+           <label><input type="radio" name="denyExtensionRename" value="0" <?php echo $denyExtensionRename == '0' ? 'checked="checked"' : ""; ?> />
212 212
            <?php echo $_lang['no']?></label><br />
213
-           <label><input type="radio" name="denyExtensionRename" value="1" <?php echo $denyExtensionRename=='1' ? 'checked="checked"' : ""; ?> />
213
+           <label><input type="radio" name="denyExtensionRename" value="1" <?php echo $denyExtensionRename == '1' ? 'checked="checked"' : ""; ?> />
214 214
            <?php echo $_lang['yes']?></label>
215 215
         </td>
216 216
   </tr>
217
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
217
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
218 218
     <td colspan="2"><div class="split"></div></td>
219 219
   </tr>
220
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
220
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
221 221
        <td nowrap class="warning"><?php echo $_lang['showHiddenFiles'] ?><br><small>[(showHiddenFiles)]</small></td>
222 222
        <td>
223
-         <label><input type="radio" name="showHiddenFiles" value="0" <?php echo $showHiddenFiles=='0' ? 'checked="checked"' : ""; ?> />
223
+         <label><input type="radio" name="showHiddenFiles" value="0" <?php echo $showHiddenFiles == '0' ? 'checked="checked"' : ""; ?> />
224 224
          <?php echo $_lang['no']?></label><br />
225
-         <label><input type="radio" name="showHiddenFiles" value="1" <?php echo $showHiddenFiles=='1' ? 'checked="checked"' : ""; ?> />
225
+         <label><input type="radio" name="showHiddenFiles" value="1" <?php echo $showHiddenFiles == '1' ? 'checked="checked"' : ""; ?> />
226 226
          <?php echo $_lang['yes']?></label>
227 227
         </td>
228 228
   </tr>
229
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
229
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
230 230
     <td colspan="2"><div class="split"></div></td>
231 231
   </tr>
232 232
   
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
         <?php
236 236
             // invoke OnMiscSettingsRender event
237 237
             $evtOut = $modx->invokeEvent('OnMiscSettingsRender');
238
-            if(is_array($evtOut)) echo implode("",$evtOut);
238
+            if (is_array($evtOut)) echo implode("", $evtOut);
239 239
         ?>
240 240
     </td>
241 241
   </tr>
Please login to merge, or discard this patch.