@@ -14,7 +14,7 @@ |
||
14 | 14 | if (!empty($user_id)) { |
15 | 15 | // Raymond: grab the user settings from the database. |
16 | 16 | $rs = $modx->getDatabase()->select('setting_name, setting_value', $modx->getDatabase()->getFullTableName('user_settings'), |
17 | - "user=" . $modx->getLoginUserID()); |
|
17 | + "user=".$modx->getLoginUserID()); |
|
18 | 18 | |
19 | 19 | $which_browser_default = $which_browser; |
20 | 20 | while ($row = $modx->getDatabase()->getRow($rs)) { |
@@ -20,14 +20,14 @@ |
||
20 | 20 | ($docid > 0 ? "id='$docid'" : "privatemgr = 1")); |
21 | 21 | $rs = $modx->getDatabase()->select( |
22 | 22 | 'DISTINCT sc.id', |
23 | - $modx->getDatabase()->getFullTableName("site_content") . " sc |
|
24 | - LEFT JOIN " . $modx->getDatabase()->getFullTableName("document_groups") . " dg ON dg.document = sc.id |
|
25 | - LEFT JOIN " . $modx->getDatabase()->getFullTableName("membergroup_access") . " mga ON mga.documentgroup = dg.document_group", |
|
26 | - ($docid > 0 ? " sc.id='{$docid}' AND " : "") . "mga.id>0" |
|
23 | + $modx->getDatabase()->getFullTableName("site_content")." sc |
|
24 | + LEFT JOIN " . $modx->getDatabase()->getFullTableName("document_groups")." dg ON dg.document = sc.id |
|
25 | + LEFT JOIN " . $modx->getDatabase()->getFullTableName("membergroup_access")." mga ON mga.documentgroup = dg.document_group", |
|
26 | + ($docid > 0 ? " sc.id='{$docid}' AND " : "")."mga.id>0" |
|
27 | 27 | ); |
28 | 28 | $ids = $modx->getDatabase()->getColumn("id", $rs); |
29 | 29 | if (count($ids) > 0) { |
30 | 30 | $modx->getDatabase()->update('privatemgr = 1', $modx->getDatabase()->getFullTableName("site_content"), |
31 | - "id IN (" . implode(", ", $ids) . ")"); |
|
31 | + "id IN (".implode(", ", $ids).")"); |
|
32 | 32 | } |
33 | 33 | } |
@@ -4,15 +4,15 @@ |
||
4 | 4 | } |
5 | 5 | |
6 | 6 | $rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_messages'), |
7 | - "recipient=" . $modx->getLoginUserID() . " AND messageread=0"); |
|
7 | + "recipient=".$modx->getLoginUserID()." AND messageread=0"); |
|
8 | 8 | $nrnewmessages = $modx->getDatabase()->getValue($rs); |
9 | -$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID()); |
|
9 | +$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()); |
|
10 | 10 | $nrtotalmessages = $modx->getDatabase()->getValue($rs); |
11 | 11 | $messagesallowed = $modx->hasPermission('messages'); |
12 | 12 | |
13 | 13 | // ajax response |
14 | 14 | if (isset($_POST['updateMsgCount'])) { |
15 | 15 | header("Content-Type: application/json; charset=utf-8"); |
16 | - print $nrnewmessages . ',' . $nrtotalmessages; |
|
16 | + print $nrnewmessages.','.$nrtotalmessages; |
|
17 | 17 | exit; |
18 | 18 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | if (isset($this->aliases[$id])) { |
101 | 101 | if ($this->aliasVisible[$id] == 1) { |
102 | 102 | if ($path != '') { |
103 | - $path = $this->aliases[$id] . '/' . $path; |
|
103 | + $path = $this->aliases[$id].'/'.$path; |
|
104 | 104 | } else { |
105 | 105 | $path = $this->aliases[$id]; |
106 | 106 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $modx->messageQuit("Cache path not set."); |
125 | 125 | } |
126 | 126 | |
127 | - $files = glob(realpath($this->cachePath) . '/*.pageCache.php'); |
|
127 | + $files = glob(realpath($this->cachePath).'/*.pageCache.php'); |
|
128 | 128 | $filesincache = count($files); |
129 | 129 | $deletedfiles = array(); |
130 | 130 | while ($file = array_shift($files)) { |
@@ -159,9 +159,9 @@ discard block |
||
159 | 159 | if (isset($opcache)) { |
160 | 160 | echo '<p>Opcache empty.</p>'; |
161 | 161 | } |
162 | - echo '<p>' . $_lang['cache_files_deleted'] . '</p><ul>'; |
|
162 | + echo '<p>'.$_lang['cache_files_deleted'].'</p><ul>'; |
|
163 | 163 | foreach ($deletedfiles as $deletedfile) { |
164 | - echo '<li>' . $deletedfile . '</li>'; |
|
164 | + echo '<li>'.$deletedfile.'</li>'; |
|
165 | 165 | } |
166 | 166 | echo '</ul>'; |
167 | 167 | } |
@@ -180,11 +180,11 @@ discard block |
||
180 | 180 | |
181 | 181 | |
182 | 182 | // write the file |
183 | - $content = '<?php' . "\n"; |
|
184 | - $content .= '$recent_update=\'' . $this->request_time . '\';' . "\n"; |
|
185 | - $content .= '$cacheRefreshTime=\'' . $cacheRefreshTime . '\';' . "\n"; |
|
183 | + $content = '<?php'."\n"; |
|
184 | + $content .= '$recent_update=\''.$this->request_time.'\';'."\n"; |
|
185 | + $content .= '$cacheRefreshTime=\''.$cacheRefreshTime.'\';'."\n"; |
|
186 | 186 | |
187 | - $filename = $this->cachePath . '/sitePublishing.idx.php'; |
|
187 | + $filename = $this->cachePath.'/sitePublishing.idx.php'; |
|
188 | 188 | if (!$handle = fopen($filename, 'w')) { |
189 | 189 | exit("Cannot open file ({$filename}"); |
190 | 190 | } |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | $result = $modx->getDatabase()->select( |
211 | 211 | 'MIN(pub_date) AS minpub', |
212 | 212 | $modx->getDatabase()->getFullTableName('site_content'), |
213 | - 'pub_date>' . $this->request_time |
|
213 | + 'pub_date>'.$this->request_time |
|
214 | 214 | ); |
215 | 215 | if (!$result) { |
216 | 216 | echo "Couldn't determine next publish event!"; |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | $result = $modx->getDatabase()->select( |
225 | 225 | 'MIN(unpub_date) AS minunpub', |
226 | 226 | $modx->getDatabase()->getFullTableName('site_content'), |
227 | - 'unpub_date>' . $this->request_time |
|
227 | + 'unpub_date>'.$this->request_time |
|
228 | 228 | ); |
229 | 229 | if (!$result) { |
230 | 230 | echo "Couldn't determine next unpublish event!"; |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | $config = array(); |
265 | 265 | $content .= '$c=&$this->config;'; |
266 | 266 | while (list($key, $value) = $modx->getDatabase()->getRow($rs, 'num')) { |
267 | - $content .= '$c[\'' . $key . '\']="' . $this->escapeDoubleQuotes($value) . '";'; |
|
267 | + $content .= '$c[\''.$key.'\']="'.$this->escapeDoubleQuotes($value).'";'; |
|
268 | 268 | $config[$key] = $value; |
269 | 269 | } |
270 | 270 | |
@@ -285,8 +285,8 @@ discard block |
||
285 | 285 | $f['isfolder'] = 'c.isfolder'; |
286 | 286 | $f['alias_visible'] = 'c.alias_visible'; |
287 | 287 | $from = array(); |
288 | - $from[] = $modx->getDatabase()->getFullTableName('site_content') . ' c'; |
|
289 | - $from[] = 'LEFT JOIN ' . $modx->getDatabase()->getFullTableName('site_content') . ' p ON p.id=c.parent'; |
|
288 | + $from[] = $modx->getDatabase()->getFullTableName('site_content').' c'; |
|
289 | + $from[] = 'LEFT JOIN '.$modx->getDatabase()->getFullTableName('site_content').' p ON p.id=c.parent'; |
|
290 | 290 | $where = 'c.deleted=0 AND (c.isfolder=1 OR p.alias_visible=0)'; |
291 | 291 | $rs = $modx->getDatabase()->select($f, $from, $where, 'c.parent, c.menuindex'); |
292 | 292 | } else { |
@@ -308,16 +308,16 @@ discard block |
||
308 | 308 | $docid = $doc['id']; |
309 | 309 | if ($use_alias_path) { |
310 | 310 | $tmpPath = $this->getParents($doc['parent']); |
311 | - $alias = (strlen($tmpPath) > 0 ? "$tmpPath/" : '') . $doc['alias']; |
|
311 | + $alias = (strlen($tmpPath) > 0 ? "$tmpPath/" : '').$doc['alias']; |
|
312 | 312 | $key = $alias; |
313 | 313 | } else { |
314 | 314 | $key = $doc['alias']; |
315 | 315 | } |
316 | 316 | |
317 | 317 | $doc['path'] = $tmpPath; |
318 | - $content .= '$a[' . $docid . ']=array(\'id\'=>' . $docid . ',\'alias\'=>\'' . $doc['alias'] . '\',\'path\'=>\'' . $doc['path'] . '\',\'parent\'=>' . $doc['parent'] . ',\'isfolder\'=>' . $doc['isfolder'] . ',\'alias_visible\'=>' . $doc['alias_visible'] . ');'; |
|
319 | - $content .= '$d[\'' . $key . '\']=' . $docid . ';'; |
|
320 | - $content .= '$m[]=array(' . $doc['parent'] . '=>' . $docid . ');'; |
|
318 | + $content .= '$a['.$docid.']=array(\'id\'=>'.$docid.',\'alias\'=>\''.$doc['alias'].'\',\'path\'=>\''.$doc['path'].'\',\'parent\'=>'.$doc['parent'].',\'isfolder\'=>'.$doc['isfolder'].',\'alias_visible\'=>'.$doc['alias_visible'].');'; |
|
319 | + $content .= '$d[\''.$key.'\']='.$docid.';'; |
|
320 | + $content .= '$m[]=array('.$doc['parent'].'=>'.$docid.');'; |
|
321 | 321 | } |
322 | 322 | |
323 | 323 | // get content types |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | ); |
329 | 329 | $content .= '$c=&$this->contentTypes;'; |
330 | 330 | while ($doc = $modx->getDatabase()->getRow($rs)) { |
331 | - $content .= '$c[\'' . $doc['id'] . '\']=\'' . $doc['contentType'] . '\';'; |
|
331 | + $content .= '$c[\''.$doc['id'].'\']=\''.$doc['contentType'].'\';'; |
|
332 | 332 | } |
333 | 333 | |
334 | 334 | // WRITE Chunks to cache file |
@@ -338,30 +338,30 @@ discard block |
||
338 | 338 | if ($modx->config['minifyphp_incache']) { |
339 | 339 | $doc['snippet'] = $this->php_strip_whitespace($doc['snippet']); |
340 | 340 | } |
341 | - $content .= '$c[\'' . $doc['name'] . '\']=\'' . ($doc['disabled'] ? '' : $this->escapeSingleQuotes($doc['snippet'])) . '\';'; |
|
341 | + $content .= '$c[\''.$doc['name'].'\']=\''.($doc['disabled'] ? '' : $this->escapeSingleQuotes($doc['snippet'])).'\';'; |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | // WRITE snippets to cache file |
345 | 345 | $f = 'ss.*, sm.properties as sharedproperties'; |
346 | - $from = $modx->getDatabase()->getFullTableName('site_snippets') . ' ss LEFT JOIN ' . |
|
347 | - $modx->getDatabase()->getFullTableName('site_modules') . ' sm on sm.guid=ss.moduleguid'; |
|
346 | + $from = $modx->getDatabase()->getFullTableName('site_snippets').' ss LEFT JOIN '. |
|
347 | + $modx->getDatabase()->getFullTableName('site_modules').' sm on sm.guid=ss.moduleguid'; |
|
348 | 348 | $rs = $modx->getDatabase()->select($f, $from); |
349 | 349 | $content .= '$s=&$this->snippetCache;'; |
350 | 350 | while ($row = $modx->getDatabase()->getRow($rs)) { |
351 | 351 | $key = $row['name']; |
352 | 352 | if ($row['disabled']) { |
353 | - $content .= '$s[\'' . $key . '\']=\'return false;\';'; |
|
353 | + $content .= '$s[\''.$key.'\']=\'return false;\';'; |
|
354 | 354 | } else { |
355 | 355 | $value = trim($row['snippet']); |
356 | 356 | if ($modx->config['minifyphp_incache']) { |
357 | 357 | $value = $this->php_strip_whitespace($value); |
358 | 358 | } |
359 | - $content .= '$s[\'' . $key . '\']=\'' . $this->escapeSingleQuotes($value) . '\';'; |
|
359 | + $content .= '$s[\''.$key.'\']=\''.$this->escapeSingleQuotes($value).'\';'; |
|
360 | 360 | $properties = $modx->parseProperties($row['properties']); |
361 | 361 | $sharedproperties = $modx->parseProperties($row['sharedproperties']); |
362 | 362 | $properties = array_merge($sharedproperties, $properties); |
363 | 363 | if (0 < count($properties)) { |
364 | - $content .= '$s[\'' . $key . 'Props\']=\'' . $this->escapeSingleQuotes(json_encode($properties)) . '\';'; |
|
364 | + $content .= '$s[\''.$key.'Props\']=\''.$this->escapeSingleQuotes(json_encode($properties)).'\';'; |
|
365 | 365 | } |
366 | 366 | } |
367 | 367 | } |
@@ -369,8 +369,8 @@ discard block |
||
369 | 369 | // WRITE plugins to cache file |
370 | 370 | $f = 'sp.*, sm.properties as sharedproperties'; |
371 | 371 | $from = array(); |
372 | - $from[] = $modx->getDatabase()->getFullTableName('site_plugins') . ' sp'; |
|
373 | - $from[] = 'LEFT JOIN ' . $modx->getDatabase()->getFullTableName('site_modules') . ' sm on sm.guid=sp.moduleguid'; |
|
372 | + $from[] = $modx->getDatabase()->getFullTableName('site_plugins').' sp'; |
|
373 | + $from[] = 'LEFT JOIN '.$modx->getDatabase()->getFullTableName('site_modules').' sm on sm.guid=sp.moduleguid'; |
|
374 | 374 | $rs = $modx->getDatabase()->select($f, $from, 'sp.disabled=0'); |
375 | 375 | $content .= '$p=&$this->pluginCache;'; |
376 | 376 | while ($row = $modx->getDatabase()->getRow($rs)) { |
@@ -379,13 +379,13 @@ discard block |
||
379 | 379 | if ($modx->config['minifyphp_incache']) { |
380 | 380 | $value = $this->php_strip_whitespace($value); |
381 | 381 | } |
382 | - $content .= '$p[\'' . $key . '\']=\'' . $this->escapeSingleQuotes($value) . '\';'; |
|
382 | + $content .= '$p[\''.$key.'\']=\''.$this->escapeSingleQuotes($value).'\';'; |
|
383 | 383 | if ($row['properties'] != '' || $row['sharedproperties'] != '') { |
384 | 384 | $properties = $modx->parseProperties($row['properties']); |
385 | 385 | $sharedproperties = $modx->parseProperties($row['sharedproperties']); |
386 | 386 | $properties = array_merge($sharedproperties, $properties); |
387 | 387 | if (0 < count($properties)) { |
388 | - $content .= '$p[\'' . $key . 'Props\']=\'' . $this->escapeSingleQuotes(json_encode($properties)) . '\';'; |
|
388 | + $content .= '$p[\''.$key.'Props\']=\''.$this->escapeSingleQuotes(json_encode($properties)).'\';'; |
|
389 | 389 | } |
390 | 390 | } |
391 | 391 | } |
@@ -393,9 +393,9 @@ discard block |
||
393 | 393 | // WRITE system event triggers |
394 | 394 | $f = 'sysevt.name as evtname, event.pluginid, plugin.name as pname'; |
395 | 395 | $from = array(); |
396 | - $from[] = $modx->getDatabase()->getFullTableName('system_eventnames') . ' sysevt'; |
|
397 | - $from[] = 'INNER JOIN ' . $modx->getDatabase()->getFullTableName('site_plugin_events') . ' event ON event.evtid=sysevt.id'; |
|
398 | - $from[] = 'INNER JOIN ' . $modx->getDatabase()->getFullTableName('site_plugins') . ' plugin ON plugin.id=event.pluginid'; |
|
396 | + $from[] = $modx->getDatabase()->getFullTableName('system_eventnames').' sysevt'; |
|
397 | + $from[] = 'INNER JOIN '.$modx->getDatabase()->getFullTableName('site_plugin_events').' event ON event.evtid=sysevt.id'; |
|
398 | + $from[] = 'INNER JOIN '.$modx->getDatabase()->getFullTableName('site_plugins').' plugin ON plugin.id=event.pluginid'; |
|
399 | 399 | $rs = $modx->getDatabase()->select($f, $from, 'plugin.disabled=0', 'sysevt.name, event.priority'); |
400 | 400 | $content .= '$e=&$this->pluginEvent;'; |
401 | 401 | $events = array(); |
@@ -408,14 +408,14 @@ discard block |
||
408 | 408 | } |
409 | 409 | foreach ($events as $evtname => $pluginnames) { |
410 | 410 | $events[$evtname] = $pluginnames; |
411 | - $content .= '$e[\'' . $evtname . '\']=array(\'' . implode('\',\'', |
|
412 | - $this->escapeSingleQuotes($pluginnames)) . '\');'; |
|
411 | + $content .= '$e[\''.$evtname.'\']=array(\''.implode('\',\'', |
|
412 | + $this->escapeSingleQuotes($pluginnames)).'\');'; |
|
413 | 413 | } |
414 | 414 | |
415 | 415 | $content .= "\n"; |
416 | 416 | |
417 | 417 | // close and write the file |
418 | - $filename = $this->cachePath . 'siteCache.idx.php'; |
|
418 | + $filename = $this->cachePath.'siteCache.idx.php'; |
|
419 | 419 | |
420 | 420 | // invoke OnBeforeCacheUpdate event |
421 | 421 | if ($modx) { |
@@ -426,8 +426,8 @@ discard block |
||
426 | 426 | exit("Cannot write main MODX cache file! Make sure the assets/cache directory is writable!"); |
427 | 427 | } |
428 | 428 | |
429 | - if (!is_file($this->cachePath . '/.htaccess')) { |
|
430 | - file_put_contents($this->cachePath . '/.htaccess', "order deny,allow\ndeny from all\n"); |
|
429 | + if (!is_file($this->cachePath.'/.htaccess')) { |
|
430 | + file_put_contents($this->cachePath.'/.htaccess', "order deny,allow\ndeny from all\n"); |
|
431 | 431 | } |
432 | 432 | |
433 | 433 | // invoke OnCacheUpdate event |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | |
450 | 450 | $source = trim($source); |
451 | 451 | if (substr($source, 0, 5) !== '<?php') { |
452 | - $source = '<?php ' . $source; |
|
452 | + $source = '<?php '.$source; |
|
453 | 453 | } |
454 | 454 | |
455 | 455 | $tokens = token_get_all($source); |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | } |
508 | 508 | } |
509 | 509 | $source = preg_replace(array('@^<\?php@i', '|\s+|', '|<!--|', '|-->|', '|-->\s+<!--|'), |
510 | - array('', ' ', "\n" . '<!--', '-->' . "\n", '-->' . "\n" . '<!--'), $_); |
|
510 | + array('', ' ', "\n".'<!--', '-->'."\n", '-->'."\n".'<!--'), $_); |
|
511 | 511 | $source = trim($source); |
512 | 512 | |
513 | 513 | return $source; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php namespace EvolutionCMS\Legacy; |
2 | 2 | |
3 | -class mgrResources { |
|
3 | +class mgrResources{ |
|
4 | 4 | /** |
5 | 5 | * @var array |
6 | 6 | */ |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * mgrResources constructor. |
23 | 23 | */ |
24 | - public function __construct() { |
|
24 | + public function __construct(){ |
|
25 | 25 | $this->setTypes(); |
26 | 26 | $this->queryItemsFromDB(); |
27 | 27 | $this->prepareCategoryArrays(); |
@@ -30,47 +30,47 @@ discard block |
||
30 | 30 | /** |
31 | 31 | * @return void |
32 | 32 | */ |
33 | - public function setTypes() { |
|
33 | + public function setTypes(){ |
|
34 | 34 | global $_lang; |
35 | - $this->types['site_templates'] = array( |
|
35 | + $this->types['site_templates'] = array( |
|
36 | 36 | 'title'=>$_lang["manage_templates"], |
37 | - 'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ), |
|
38 | - 'permissions'=>array('new_template','edit_template'), |
|
37 | + 'actions'=>array('edit'=>array(16, 'edit_template'), 'duplicate'=>array(96, 'new_template'), 'remove'=>array(21, 'delete_template')), |
|
38 | + 'permissions'=>array('new_template', 'edit_template'), |
|
39 | 39 | 'name'=>'templatename' |
40 | 40 | ); |
41 | - $this->types['site_tmplvars'] = array( |
|
41 | + $this->types['site_tmplvars'] = array( |
|
42 | 42 | 'title'=>$_lang["tmplvars"], |
43 | - 'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')), |
|
44 | - 'permissions'=>array('new_template','edit_template'), |
|
43 | + 'actions'=>array('edit'=>array(301, 'edit_template'), 'duplicate'=>array(304, 'edit_template'), 'remove'=>array(303, 'edit_template')), |
|
44 | + 'permissions'=>array('new_template', 'edit_template'), |
|
45 | 45 | ); |
46 | 46 | $this->types['site_htmlsnippets'] = array( |
47 | 47 | 'title'=>$_lang["manage_htmlsnippets"], |
48 | - 'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')), |
|
49 | - 'permissions'=>array('new_chunk','edit_chunk'), |
|
48 | + 'actions'=>array('edit'=>array(78, 'edit_chunk'), 'duplicate'=>array(97, 'new_chunk'), 'remove'=>array(80, 'delete_chunk')), |
|
49 | + 'permissions'=>array('new_chunk', 'edit_chunk'), |
|
50 | 50 | ); |
51 | - $this->types['site_snippets'] = array( |
|
51 | + $this->types['site_snippets'] = array( |
|
52 | 52 | 'title'=>$_lang["manage_snippets"], |
53 | - 'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')), |
|
54 | - 'permissions'=>array('new_snippet','edit_snippet'), |
|
53 | + 'actions'=>array('edit'=>array(22, 'edit_snippet'), 'duplicate'=>array(98, 'new_snippet'), 'remove'=>array(25, 'delete_snippet')), |
|
54 | + 'permissions'=>array('new_snippet', 'edit_snippet'), |
|
55 | 55 | ); |
56 | - $this->types['site_plugins'] = array( |
|
56 | + $this->types['site_plugins'] = array( |
|
57 | 57 | 'title'=>$_lang["manage_plugins"], |
58 | - 'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')), |
|
59 | - 'permissions'=>array('new_plugin','edit_plugin'), |
|
58 | + 'actions'=>array('edit'=>array(102, 'edit_plugin'), 'duplicate'=>array(105, 'new_plugin'), 'remove'=>array(104, 'delete_plugin')), |
|
59 | + 'permissions'=>array('new_plugin', 'edit_plugin'), |
|
60 | 60 | ); |
61 | - $this->types['site_modules'] = array( |
|
61 | + $this->types['site_modules'] = array( |
|
62 | 62 | 'title'=>$_lang["manage_modules"], |
63 | - 'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')), |
|
64 | - 'permissions'=>array('new_module','edit_module'), |
|
63 | + 'actions'=>array('edit'=>array(108, 'edit_module'), 'duplicate'=>array(111, 'new_module'), 'remove'=>array(110, 'delete_module')), |
|
64 | + 'permissions'=>array('new_module', 'edit_module'), |
|
65 | 65 | ); |
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
69 | 69 | * @return void |
70 | 70 | */ |
71 | - public function queryItemsFromDB() { |
|
72 | - foreach($this->types as $resourceTable=>$type) { |
|
73 | - if($this->hasAnyPermissions($type['permissions'])) { |
|
71 | + public function queryItemsFromDB(){ |
|
72 | + foreach ($this->types as $resourceTable=>$type) { |
|
73 | + if ($this->hasAnyPermissions($type['permissions'])) { |
|
74 | 74 | $nameField = isset($type['name']) ? $type['name'] : 'name'; |
75 | 75 | $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField); |
76 | 76 | } |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | * @param array $permissions |
82 | 82 | * @return bool |
83 | 83 | */ |
84 | - public function hasAnyPermissions($permissions) { |
|
84 | + public function hasAnyPermissions($permissions){ |
|
85 | 85 | $modx = evolutionCMS(); |
86 | 86 | |
87 | - foreach($permissions as $p) |
|
88 | - if($modx->hasPermission($p)) return true; |
|
87 | + foreach ($permissions as $p) |
|
88 | + if ($modx->hasPermission($p)) return true; |
|
89 | 89 | |
90 | 90 | return false; |
91 | 91 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @param string $nameField |
96 | 96 | * @return array|bool |
97 | 97 | */ |
98 | - public function queryResources($resourceTable, $nameField = 'name') { |
|
98 | + public function queryResources($resourceTable, $nameField = 'name'){ |
|
99 | 99 | $modx = evolutionCMS(); global $_lang; |
100 | 100 | |
101 | 101 | $allowed = array( |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | 'site_plugins', |
105 | 105 | 'site_modules' |
106 | 106 | ); |
107 | - $pluginsql = !empty($resourceTable) && in_array($resourceTable, $allowed) ? $resourceTable . '.disabled, ' : ''; |
|
107 | + $pluginsql = !empty($resourceTable) && in_array($resourceTable, $allowed) ? $resourceTable.'.disabled, ' : ''; |
|
108 | 108 | |
109 | 109 | $tvsql = ''; |
110 | 110 | $tvjoin = ''; |
@@ -119,14 +119,14 @@ discard block |
||
119 | 119 | |
120 | 120 | $rs = $modx->getDatabase()->select( |
121 | 121 | "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid", |
122 | - $modx->getDatabase()->getFullTableName($resourceTable) . " AS {$resourceTable} |
|
123 | - LEFT JOIN " . $modx->getDatabase()->getFullTableName('categories') . " AS categories ON {$resourceTable}.category = categories.id {$tvjoin}", |
|
122 | + $modx->getDatabase()->getFullTableName($resourceTable)." AS {$resourceTable} |
|
123 | + LEFT JOIN ".$modx->getDatabase()->getFullTableName('categories')." AS categories ON {$resourceTable}.category = categories.id {$tvjoin}", |
|
124 | 124 | "", |
125 | 125 | "category,name" |
126 | 126 | ); |
127 | 127 | $limit = $modx->getDatabase()->getRecordCount($rs); |
128 | 128 | |
129 | - if($limit < 1) return false; |
|
129 | + if ($limit < 1) return false; |
|
130 | 130 | |
131 | 131 | $result = array(); |
132 | 132 | while ($row = $modx->getDatabase()->getRow($rs)) { |
@@ -138,9 +138,9 @@ discard block |
||
138 | 138 | /** |
139 | 139 | * @return void |
140 | 140 | */ |
141 | - public function prepareCategoryArrays() { |
|
142 | - foreach($this->items as $type=>$items) { |
|
143 | - foreach((array)$items as $item) { |
|
141 | + public function prepareCategoryArrays(){ |
|
142 | + foreach ($this->items as $type=>$items) { |
|
143 | + foreach ((array) $items as $item) { |
|
144 | 144 | $catid = $item['catid'] ? $item['catid'] : 0; |
145 | 145 | $this->categories[$catid] = $item['category']; |
146 | 146 | |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | natcasesort($this->categories); |
154 | 154 | |
155 | 155 | // Now sort by name |
156 | - foreach($this->itemsPerCategory as $catid=>$items) { |
|
157 | - usort($this->itemsPerCategory[$catid], function ($a, $b) { |
|
156 | + foreach ($this->itemsPerCategory as $catid=>$items) { |
|
157 | + usort($this->itemsPerCategory[$catid], function($a, $b){ |
|
158 | 158 | return strcasecmp($a['name'], $b['name']); |
159 | 159 | }); |
160 | 160 | } |
@@ -146,33 +146,33 @@ discard block |
||
146 | 146 | $algorithm = 'UNCRYPT'; |
147 | 147 | } |
148 | 148 | |
149 | - $salt = md5($password . $seed); |
|
149 | + $salt = md5($password.$seed); |
|
150 | 150 | |
151 | 151 | switch ($algorithm) { |
152 | 152 | case 'BLOWFISH_Y': |
153 | - $salt = '$2y$07$' . substr($salt, 0, 22); |
|
153 | + $salt = '$2y$07$'.substr($salt, 0, 22); |
|
154 | 154 | break; |
155 | 155 | case 'BLOWFISH_A': |
156 | - $salt = '$2a$07$' . substr($salt, 0, 22); |
|
156 | + $salt = '$2a$07$'.substr($salt, 0, 22); |
|
157 | 157 | break; |
158 | 158 | case 'SHA512': |
159 | - $salt = '$6$' . substr($salt, 0, 16); |
|
159 | + $salt = '$6$'.substr($salt, 0, 16); |
|
160 | 160 | break; |
161 | 161 | case 'SHA256': |
162 | - $salt = '$5$' . substr($salt, 0, 16); |
|
162 | + $salt = '$5$'.substr($salt, 0, 16); |
|
163 | 163 | break; |
164 | 164 | case 'MD5': |
165 | - $salt = '$1$' . substr($salt, 0, 8); |
|
165 | + $salt = '$1$'.substr($salt, 0, 8); |
|
166 | 166 | break; |
167 | 167 | } |
168 | 168 | |
169 | 169 | if ($algorithm !== 'UNCRYPT') { |
170 | - $password = sha1($password) . crypt($password, $salt); |
|
170 | + $password = sha1($password).crypt($password, $salt); |
|
171 | 171 | } else { |
172 | - $password = sha1($salt . $password); |
|
172 | + $password = sha1($salt.$password); |
|
173 | 173 | } |
174 | 174 | |
175 | - $result = strtolower($algorithm) . '>' . md5($salt . $password) . substr(md5($salt), 0, 8); |
|
175 | + $result = strtolower($algorithm).'>'.md5($salt.$password).substr(md5($salt), 0, 8); |
|
176 | 176 | |
177 | 177 | return $result; |
178 | 178 | } |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $check_files = explode("\n", $check_files); |
255 | 255 | foreach ($check_files as $file) { |
256 | 256 | $file = trim($file); |
257 | - $file = MODX_BASE_PATH . $file; |
|
257 | + $file = MODX_BASE_PATH.$file; |
|
258 | 258 | if (!is_file($file)) { |
259 | 259 | continue; |
260 | 260 | } |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | $checksum = unserialize($checksum); |
278 | 278 | foreach ($check_files as $file) { |
279 | 279 | $file = trim($file); |
280 | - $filePath = MODX_BASE_PATH . $file; |
|
280 | + $filePath = MODX_BASE_PATH.$file; |
|
281 | 281 | if (!is_file($filePath)) { |
282 | 282 | continue; |
283 | 283 | } |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | { |
297 | 297 | $modx = evolutionCMS(); |
298 | 298 | $tbl_system_settings = $modx->getDatabase()->getFullTableName('system_settings'); |
299 | - $sql = "REPLACE INTO {$tbl_system_settings} (setting_name, setting_value) VALUES ('sys_files_checksum','" . $modx->getDatabase()->escape($checksum) . "')"; |
|
299 | + $sql = "REPLACE INTO {$tbl_system_settings} (setting_name, setting_value) VALUES ('sys_files_checksum','".$modx->getDatabase()->escape($checksum)."')"; |
|
300 | 300 | $modx->getDatabase()->query($sql); |
301 | 301 | } |
302 | 302 | |
@@ -373,10 +373,10 @@ discard block |
||
373 | 373 | foreach ($settings as $key => $val) { |
374 | 374 | $f = array(); |
375 | 375 | $f['user'] = $_SESSION['mgrInternalKey']; |
376 | - $f['setting_name'] = '_LAST_' . $key; |
|
376 | + $f['setting_name'] = '_LAST_'.$key; |
|
377 | 377 | $f['setting_value'] = $val; |
378 | 378 | $f = $modx->getDatabase()->escape($f); |
379 | - $f = "(`" . implode("`, `", array_keys($f)) . "`) VALUES('" . implode("', '", array_values($f)) . "')"; |
|
379 | + $f = "(`".implode("`, `", array_keys($f))."`) VALUES('".implode("', '", array_values($f))."')"; |
|
380 | 380 | $f .= " ON DUPLICATE KEY UPDATE setting_value = VALUES(setting_value)"; |
381 | 381 | $modx->getDatabase()->insert($f, $modx->getDatabase()->getFullTableName('user_settings')); |
382 | 382 | } |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | $this->db_tbl['categories'] = $modx->getDatabase()->getFullTableName('categories'); |
18 | 18 | |
19 | 19 | foreach ($this->elements as $element) { |
20 | - $this->db_tbl[$element] = $modx->getDatabase()->getFullTableName('site_' . $element); |
|
20 | + $this->db_tbl[$element] = $modx->getDatabase()->getFullTableName('site_'.$element); |
|
21 | 21 | } |
22 | 22 | } |
23 | 23 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $this->db->select( |
52 | 52 | '*', |
53 | 53 | $this->db_tbl['categories'], |
54 | - "`" . $where . "` = '" . $this->db->escape($search) . "'" |
|
54 | + "`".$where."` = '".$this->db->escape($search)."'" |
|
55 | 55 | ) |
56 | 56 | ); |
57 | 57 | |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | { |
69 | 69 | $_value = $this->db->getValue( |
70 | 70 | $this->db->select( |
71 | - '`' . $value . '`', |
|
71 | + '`'.$value.'`', |
|
72 | 72 | $this->db_tbl['categories'], |
73 | - "`" . $where . "` = '" . $this->db->escape($search) . "'" |
|
73 | + "`".$where."` = '".$this->db->escape($search)."'" |
|
74 | 74 | ) |
75 | 75 | ); |
76 | 76 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $this->db->select( |
90 | 90 | '*', |
91 | 91 | $this->db_tbl[$element], |
92 | - "`category` = '" . (int)$category_id . "'" |
|
92 | + "`category` = '".(int) $category_id."'" |
|
93 | 93 | ) |
94 | 94 | ); |
95 | 95 | |
@@ -132,13 +132,13 @@ discard block |
||
132 | 132 | $this->db->update( |
133 | 133 | $_update, |
134 | 134 | $this->db_tbl[$element], |
135 | - "`category` = '" . (int)$category_id . "'" |
|
135 | + "`category` = '".(int) $category_id."'" |
|
136 | 136 | ); |
137 | 137 | } |
138 | 138 | |
139 | 139 | $this->db->delete( |
140 | 140 | $this->db_tbl['categories'], |
141 | - "`id` = '" . (int)$category_id . "'" |
|
141 | + "`id` = '".(int) $category_id."'" |
|
142 | 142 | ); |
143 | 143 | |
144 | 144 | return $this->db->getAffectedRows() === 1; |
@@ -157,13 +157,13 @@ discard block |
||
157 | 157 | |
158 | 158 | $_update = array( |
159 | 159 | 'category' => $this->db->escape($data['category']), |
160 | - 'rank' => (int)$data['rank'] |
|
160 | + 'rank' => (int) $data['rank'] |
|
161 | 161 | ); |
162 | 162 | |
163 | 163 | $this->db->update( |
164 | 164 | $_update, |
165 | 165 | $this->db_tbl['categories'], |
166 | - "`id` = '" . (int)$category_id . "'" |
|
166 | + "`id` = '".(int) $category_id."'" |
|
167 | 167 | ); |
168 | 168 | |
169 | 169 | if ($this->db->getAffectedRows() === 1) { |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | |
187 | 187 | $_insert = array( |
188 | 188 | 'category' => $this->db->escape($category_name), |
189 | - 'rank' => (int)$category_rank |
|
189 | + 'rank' => (int) $category_rank |
|
190 | 190 | ); |
191 | 191 | |
192 | 192 | $this->db->insert( |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | $this->db->select( |
214 | 214 | '`id`', |
215 | 215 | $this->db_tbl['categories'], |
216 | - "`category` = '" . $category . "'" |
|
216 | + "`category` = '".$category."'" |
|
217 | 217 | ) |
218 | 218 | ); |
219 | 219 |
@@ -8,46 +8,46 @@ discard block |
||
8 | 8 | * @param array $data |
9 | 9 | * @return string |
10 | 10 | */ |
11 | - public function output($config = array(), $data = array()) { |
|
11 | + public function output($config = array(), $data = array()){ |
|
12 | 12 | $modx = evolutionCMS(); |
13 | 13 | |
14 | 14 | $output = ''; |
15 | 15 | $action = !empty($config['action']) ? $config['action'] : (!empty($_REQUEST['a']) ? $_REQUEST['a'] : ''); |
16 | - $tab = isset($config['tab']) ? ' AND tab IN(' . $config['tab'] . ')' : ''; |
|
16 | + $tab = isset($config['tab']) ? ' AND tab IN('.$config['tab'].')' : ''; |
|
17 | 17 | |
18 | - if($action) { |
|
18 | + if ($action) { |
|
19 | 19 | $sql = $modx->getDatabase()->query('SELECT t1.*, IF(t1.alias=\'\',t1.name,t1.alias) AS alias, t2.category AS category_name |
20 | - FROM ' . $modx->getDatabase()->getFullTableName('system_templates') . ' AS t1 |
|
21 | - INNER JOIN ' . $modx->getDatabase()->getFullTableName('categories') . ' AS t2 ON t2.id=t1.category |
|
22 | - WHERE t1.action IN(' . $action . ') ' . $tab . ' |
|
20 | + FROM ' . $modx->getDatabase()->getFullTableName('system_templates').' AS t1 |
|
21 | + INNER JOIN ' . $modx->getDatabase()->getFullTableName('categories').' AS t2 ON t2.id=t1.category |
|
22 | + WHERE t1.action IN(' . $action.') '.$tab.' |
|
23 | 23 | ORDER BY t1.tab ASC, t1.rank ASC'); |
24 | 24 | |
25 | - if($modx->getDatabase()->getRecordCount($sql)) { |
|
25 | + if ($modx->getDatabase()->getRecordCount($sql)) { |
|
26 | 26 | $tabs = array(); |
27 | - while($row = $modx->getDatabase()->getRow($sql)) { |
|
28 | - if(!$row['value'] && !empty($data[$row['name']])) { |
|
27 | + while ($row = $modx->getDatabase()->getRow($sql)) { |
|
28 | + if (!$row['value'] && !empty($data[$row['name']])) { |
|
29 | 29 | $row['value'] = $data[$row['name']]; |
30 | 30 | } |
31 | 31 | $tabs[$row['tab']]['category_name'] = $row['category_name']; |
32 | 32 | $tabs[$row['tab']][$row['name']] = $this->render($row); |
33 | 33 | } |
34 | 34 | |
35 | - if(!empty($config['toArray'])) { |
|
35 | + if (!empty($config['toArray'])) { |
|
36 | 36 | $output = $tabs; |
37 | 37 | } else { |
38 | - $output .= '<div class="tab-pane" id="pane_' . $action . '">'; |
|
38 | + $output .= '<div class="tab-pane" id="pane_'.$action.'">'; |
|
39 | 39 | $output .= ' |
40 | 40 | <script type="text/javascript"> |
41 | - var pane_' . $action . ' = new WebFXTabPane(document.getElementById("pane_' . $action . '"), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false') . '); |
|
41 | + var pane_' . $action.' = new WebFXTabPane(document.getElementById("pane_'.$action.'"), '.($modx->config['remember_last_tab'] == 1 ? 'true' : 'false').'); |
|
42 | 42 | </script>'; |
43 | 43 | |
44 | - foreach($tabs as $idTab => $tab) { |
|
45 | - $output .= '<div class="tab-page" id="tab_' . $action . '_' . $idTab . '">'; |
|
44 | + foreach ($tabs as $idTab => $tab) { |
|
45 | + $output .= '<div class="tab-page" id="tab_'.$action.'_'.$idTab.'">'; |
|
46 | 46 | $output .= ' |
47 | - <h2 class="tab">' . (!empty($config['tabs'][$idTab]) ? $config['tabs'][$idTab] : $tab['category_name']) . '</h2> |
|
48 | - <script type="text/javascript">pane_' . $action . '.addTabPage(document.getElementById("tab_' . $action . '_' . $idTab . '"));</script>'; |
|
47 | + <h2 class="tab">' . (!empty($config['tabs'][$idTab]) ? $config['tabs'][$idTab] : $tab['category_name']).'</h2> |
|
48 | + <script type="text/javascript">pane_' . $action.'.addTabPage(document.getElementById("tab_'.$action.'_'.$idTab.'"));</script>'; |
|
49 | 49 | unset($tab['category_name']); |
50 | - foreach($tab as $item) { |
|
50 | + foreach ($tab as $item) { |
|
51 | 51 | $output .= $item; |
52 | 52 | } |
53 | 53 | $output .= '</div>'; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * @param array $data |
65 | 65 | * @return string |
66 | 66 | */ |
67 | - private function render($data) { |
|
67 | + private function render($data){ |
|
68 | 68 | $modx = evolutionCMS(); global $_lang, $_country_lang; |
69 | 69 | |
70 | 70 | $data['lang.name'] = (isset($_lang[$data['alias']]) ? $_lang[$data['alias']] : $data['alias']); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $output = ''; |
75 | 75 | $output .= '<div class="form-group row">'; |
76 | 76 | |
77 | - switch($data['type']) { |
|
77 | + switch ($data['type']) { |
|
78 | 78 | |
79 | 79 | case 'text': |
80 | 80 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label> |
@@ -108,18 +108,18 @@ discard block |
||
108 | 108 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
109 | 109 | $output .= '<div class="col-sm-7">'; |
110 | 110 | $output .= '<select name="[+name+]" class="form-control" id="[+name+]" onChange="documentDirty=true;">'; |
111 | - if($data['name'] == 'country' && isset($_country_lang)) { |
|
111 | + if ($data['name'] == 'country' && isset($_country_lang)) { |
|
112 | 112 | $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $data['country']; |
113 | - $output .= '<option value=""' . (!isset($chosenCountry) ? ' selected' : '') . '> </option>'; |
|
114 | - foreach($_country_lang as $key => $value) { |
|
115 | - $output .= '<option value="' . $key . '"' . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . '>' . $value . '</option>'; |
|
113 | + $output .= '<option value=""'.(!isset($chosenCountry) ? ' selected' : '').'> </option>'; |
|
114 | + foreach ($_country_lang as $key => $value) { |
|
115 | + $output .= '<option value="'.$key.'"'.(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').'>'.$value.'</option>'; |
|
116 | 116 | } |
117 | 117 | } else { |
118 | - if($data['elements']) { |
|
118 | + if ($data['elements']) { |
|
119 | 119 | $elements = explode('||', $data['elements']); |
120 | - foreach($elements as $key => $value) { |
|
120 | + foreach ($elements as $key => $value) { |
|
121 | 121 | $value = explode('==', $value); |
122 | - $output .= '<option value="' . $value[1] . '">' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]) . '</option>'; |
|
122 | + $output .= '<option value="'.$value[1].'">'.(isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]).'</option>'; |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | } |
@@ -133,11 +133,11 @@ discard block |
||
133 | 133 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
134 | 134 | $output .= '<div class="col-sm-7">'; |
135 | 135 | $output .= '<input type="checkbox" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />'; |
136 | - if($data['elements']) { |
|
136 | + if ($data['elements']) { |
|
137 | 137 | $elements = explode('||', $data['elements']); |
138 | - foreach($elements as $key => $value) { |
|
138 | + foreach ($elements as $key => $value) { |
|
139 | 139 | $value = explode('==', $value); |
140 | - $output .= '<br /><input type="checkbox" name="' . $value[0] . '" class="form-control" id="' . $value[0] . '" value="' . $value[1] . '" onChange="documentDirty=true;"[+readonly+] /> ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); |
|
140 | + $output .= '<br /><input type="checkbox" name="'.$value[0].'" class="form-control" id="'.$value[0].'" value="'.$value[1].'" onChange="documentDirty=true;"[+readonly+] /> '.(isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); |
|
141 | 141 | } |
142 | 142 | } |
143 | 143 | $output .= $data['content']; |
@@ -149,11 +149,11 @@ discard block |
||
149 | 149 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
150 | 150 | $output .= '<div class="col-sm-7">'; |
151 | 151 | $output .= '<input type="radio" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />'; |
152 | - if($data['elements']) { |
|
152 | + if ($data['elements']) { |
|
153 | 153 | $elements = explode('||', $data['elements']); |
154 | - foreach($elements as $key => $value) { |
|
154 | + foreach ($elements as $key => $value) { |
|
155 | 155 | $value = explode('==', $value); |
156 | - $output .= '<br /><input type="radio" name="[+name+]" class="form-control" id="[+name+]_' . $key . '" value="' . $value[1] . '" onChange="documentDirty=true;"[+readonly+] /> ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); |
|
156 | + $output .= '<br /><input type="radio" name="[+name+]" class="form-control" id="[+name+]_'.$key.'" value="'.$value[1].'" onChange="documentDirty=true;"[+readonly+] /> '.(isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]); |
|
157 | 157 | } |
158 | 158 | } |
159 | 159 | $output .= $data['content']; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $this->count = 0; |
60 | 60 | $this->setUrlMode(); |
61 | 61 | $this->generate_mode = 'crawl'; |
62 | - $this->targetDir = $modx->config['base_path'] . 'temp/export'; |
|
62 | + $this->targetDir = $modx->config['base_path'].'temp/export'; |
|
63 | 63 | if (!isset($this->total)) { |
64 | 64 | $this->getTotal(); |
65 | 65 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | $ignore_ids = array_filter(array_map('intval', explode(',', $ignore_ids))); |
116 | 116 | if (count($ignore_ids) > 0) { |
117 | - $ignore_ids = "AND NOT id IN ('" . implode("','", $ignore_ids) . "')"; |
|
117 | + $ignore_ids = "AND NOT id IN ('".implode("','", $ignore_ids)."')"; |
|
118 | 118 | } else { |
119 | 119 | $ignore_ids = ''; |
120 | 120 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $noncache = ($noncache == 1) ? '' : 'AND cacheable=1'; |
125 | 125 | $where = "deleted=0 AND ((published=1 AND type='document') OR (isfolder=1)) {$noncache} {$ignore_ids}"; |
126 | 126 | $rs = $modx->getDatabase()->select('count(id)', $tbl_site_content, $where); |
127 | - $this->total = (int)$modx->getDatabase()->getValue($rs); |
|
127 | + $this->total = (int) $modx->getDatabase()->getValue($rs); |
|
128 | 128 | |
129 | 129 | return $this->total; |
130 | 130 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | } elseif (!is_readable($directory)) { |
154 | 154 | return $rs; |
155 | 155 | } else { |
156 | - $files = glob($directory . '/*'); |
|
156 | + $files = glob($directory.'/*'); |
|
157 | 157 | if (!empty($files)) { |
158 | 158 | foreach ($files as $path) { |
159 | 159 | $rs = is_dir($path) ? $this->removeDirectoryAll($path) : unlink($path); |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | |
183 | 183 | $_lang = $back_lang; |
184 | 184 | } else { |
185 | - $src = $this->curl_get_contents(MODX_SITE_URL . "index.php?id={$docid}"); |
|
185 | + $src = $this->curl_get_contents(MODX_SITE_URL."index.php?id={$docid}"); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | |
@@ -217,12 +217,12 @@ discard block |
||
217 | 217 | $modx = evolutionCMS(); |
218 | 218 | |
219 | 219 | if ($alias === '') { |
220 | - $filename = $prefix . $docid . $suffix; |
|
220 | + $filename = $prefix.$docid.$suffix; |
|
221 | 221 | } else { |
222 | 222 | if ($modx->config['suffix_mode'] === '1' && strpos($alias, '.') !== false) { |
223 | 223 | $suffix = ''; |
224 | 224 | } |
225 | - $filename = $prefix . $alias . $suffix; |
|
225 | + $filename = $prefix.$alias.$suffix; |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | return $filename; |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | $tbl_site_content = $modx->getDatabase()->getFullTableName('site_content'); |
241 | 241 | |
242 | 242 | $ignore_ids = $this->ignore_ids; |
243 | - $dirpath = $this->targetDir . '/'; |
|
243 | + $dirpath = $this->targetDir.'/'; |
|
244 | 244 | |
245 | 245 | $prefix = $modx->config['friendly_url_prefix']; |
246 | 246 | $suffix = $modx->config['friendly_url_suffix']; |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | |
251 | 251 | $ph['status'] = 'fail'; |
252 | 252 | $ph['msg1'] = $_lang['export_site_failed']; |
253 | - $ph['msg2'] = $_lang["export_site_failed_no_write"] . ' - ' . $dirpath; |
|
253 | + $ph['msg2'] = $_lang["export_site_failed_no_write"].' - '.$dirpath; |
|
254 | 254 | $msg_failed_no_write = $this->parsePlaceholder($tpl, $ph); |
255 | 255 | |
256 | 256 | $ph['msg2'] = $_lang["export_site_failed_no_retrieve"]; |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | |
284 | 284 | if (!$row['wasNull']) { // needs writing a document |
285 | 285 | $docname = $this->getFileName($row['id'], $row['alias'], $prefix, $suffix); |
286 | - $filename = $dirpath . $docname; |
|
286 | + $filename = $dirpath.$docname; |
|
287 | 287 | if (!is_file($filename)) { |
288 | 288 | if ($row['published'] === '1') { |
289 | 289 | $status = $this->makeFile($row['id'], $filename); |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | if ($row['isfolder'] === '1' && ($modx->config['suffix_mode'] !== '1' || strpos($row['alias'], |
312 | 312 | '.') === false)) { // needs making a folder |
313 | 313 | $end_dir = ($row['alias'] !== '') ? $row['alias'] : $row['id']; |
314 | - $dir_path = $dirpath . $end_dir; |
|
314 | + $dir_path = $dirpath.$end_dir; |
|
315 | 315 | if (strpos($dir_path, MODX_BASE_PATH) === false) { |
316 | 316 | return false; |
317 | 317 | } |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | |
328 | 328 | if ($modx->config['make_folders'] === '1' && $row['published'] === '1') { |
329 | 329 | if (!empty($filename) && is_file($filename)) { |
330 | - rename($filename, $dir_path . '/index.html'); |
|
330 | + rename($filename, $dir_path.'/index.html'); |
|
331 | 331 | } |
332 | 332 | } |
333 | 333 | $this->targetDir = $dir_path; |
@@ -351,8 +351,8 @@ discard block |
||
351 | 351 | |
352 | 352 | $ch = curl_init(); |
353 | 353 | curl_setopt($ch, CURLOPT_URL, $url); |
354 | - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // 0 = DO NOT VERIFY AUTHENTICITY OF SSL-CERT |
|
355 | - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); // 2 = CERT MUST INDICATE BEING CONNECTED TO RIGHT SERVER |
|
354 | + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // 0 = DO NOT VERIFY AUTHENTICITY OF SSL-CERT |
|
355 | + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); // 2 = CERT MUST INDICATE BEING CONNECTED TO RIGHT SERVER |
|
356 | 356 | curl_setopt($ch, CURLOPT_HEADER, false); |
357 | 357 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
358 | 358 | curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); |