@@ -5,8 +5,9 @@ discard block |
||
5 | 5 | |
6 | 6 | // get the settings from the database. |
7 | 7 | $settings = array(); |
8 | -if ($modx && count($modx->config)>0) $settings = $modx->config; |
|
9 | -else{ |
|
8 | +if ($modx && count($modx->config)>0) { |
|
9 | + $settings = $modx->config; |
|
10 | +} else { |
|
10 | 11 | $rs = $modx->db->select('setting_name, setting_value', $modx->getFullTableName('system_settings')); |
11 | 12 | while ($row = $modx->db->getRow($rs)) { |
12 | 13 | $settings[$row['setting_name']] = $row['setting_value']; |
@@ -16,4 +17,6 @@ discard block |
||
16 | 17 | extract($settings, EXTR_OVERWRITE); |
17 | 18 | |
18 | 19 | // setup default site id - new installation should generate a unique id for the site. |
19 | -if(!isset($site_id)) $site_id = "MzGeQ2faT4Dw06+U49x3"; |
|
20 | +if(!isset($site_id)) { |
|
21 | + $site_id = "MzGeQ2faT4Dw06+U49x3"; |
|
22 | +} |
@@ -12,7 +12,8 @@ |
||
12 | 12 | * |
13 | 13 | */ |
14 | 14 | |
15 | -function secureMgrDocument($docid='') { |
|
15 | +function secureMgrDocument($docid='') |
|
16 | +{ |
|
16 | 17 | global $modx; |
17 | 18 | |
18 | 19 | $modx->db->update('privatemgr = 0', $modx->getFullTableName("site_content"), ($docid>0 ? "id='$docid'":"privatemgr = 1")); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | $mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en'; |
@@ -9,21 +9,21 @@ discard block |
||
9 | 9 | $modx_textdir = isset($modx_textdir) ? $modx_textdir : null; |
10 | 10 | $onManagerMainFrameHeaderHTMLBlock = is_array($evtOut) ? implode("\n", $evtOut) : ''; |
11 | 11 | $textdir = $modx_textdir === 'rtl' ? 'rtl' : 'ltr'; |
12 | -if (!isset($modx->config['mgr_jquery_path'])) { |
|
12 | +if (!isset($modx->config['mgr_jquery_path'])) { |
|
13 | 13 | $modx->config['mgr_jquery_path'] = 'media/script/jquery/jquery.min.js'; |
14 | 14 | } |
15 | -if (!isset($modx->config['mgr_date_picker_path'])) { |
|
15 | +if (!isset($modx->config['mgr_date_picker_path'])) { |
|
16 | 16 | $modx->config['mgr_date_picker_path'] = 'media/script/air-datepicker/datepicker.inc.php'; |
17 | 17 | } |
18 | 18 | |
19 | -if (!empty($_COOKIE['MODX_themeColor'])) { |
|
19 | +if (!empty($_COOKIE['MODX_themeColor'])) { |
|
20 | 20 | $body_class .= ' ' . $_COOKIE['MODX_themeColor']; |
21 | 21 | } |
22 | 22 | |
23 | 23 | $css = 'media/style/' . $modx->config['manager_theme'] . '/style.css?v=' . $lastInstallTime; |
24 | 24 | |
25 | -if ($modx->config['manager_theme'] == 'default') { |
|
26 | - if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) { |
|
25 | +if ($modx->config['manager_theme'] == 'default') { |
|
26 | + if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) { |
|
27 | 27 | require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php'; |
28 | 28 | $minifier = new Formatter\CSSMinify(); |
29 | 29 | $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css'); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $css = $minifier->minify(); |
41 | 41 | file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css); |
42 | 42 | } |
43 | - if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
43 | + if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
44 | 44 | $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime; |
45 | 45 | } |
46 | 46 | } |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | stopWorker(); |
364 | 364 | |
365 | 365 | <?php |
366 | - if (isset($_REQUEST['r']) && preg_match('@^[0-9]+$@', $_REQUEST['r'])) { |
|
366 | + if (isset($_REQUEST['r']) && preg_match('@^[0-9]+$@', $_REQUEST['r'])) { |
|
367 | 367 | echo 'doRefresh(' . $_REQUEST['r'] . ");\n"; |
368 | 368 | } |
369 | 369 | ?> |
@@ -12,7 +12,8 @@ |
||
12 | 12 | * |
13 | 13 | */ |
14 | 14 | |
15 | -function secureWebDocument($docid='') { |
|
15 | +function secureWebDocument($docid='') |
|
16 | +{ |
|
16 | 17 | global $modx; |
17 | 18 | |
18 | 19 | $modx->db->update('privateweb = 0', $modx->getFullTableName("site_content"), ($docid>0 ? "id='$docid'":"privateweb = 1")); |
@@ -17,7 +17,9 @@ |
||
17 | 17 | |
18 | 18 | $which_browser_default = $which_browser; |
19 | 19 | while ($row = $modx->db->getRow($rs)) { |
20 | - if($row['setting_name'] == 'which_browser' && $row['setting_value'] == 'default') $row['setting_value'] = $which_browser_default; |
|
20 | + if($row['setting_name'] == 'which_browser' && $row['setting_value'] == 'default') { |
|
21 | + $row['setting_value'] = $which_browser_default; |
|
22 | + } |
|
21 | 23 | $settings[$row['setting_name']] = $row['setting_value']; |
22 | 24 | if (isset($modx->config)) { |
23 | 25 | $modx->config[$row['setting_name']] = $row['setting_value']; |
@@ -12,16 +12,20 @@ |
||
12 | 12 | $modx->loadExtension('EXPORT_SITE'); |
13 | 13 | |
14 | 14 | |
15 | -if(is_dir(MODX_BASE_PATH . 'temp')) $export_dir = MODX_BASE_PATH . 'temp/export'; |
|
16 | -elseif(is_dir(MODX_BASE_PATH . 'assets')) $export_dir = MODX_BASE_PATH . 'assets/export'; |
|
15 | +if(is_dir(MODX_BASE_PATH . 'temp')) { |
|
16 | + $export_dir = MODX_BASE_PATH . 'temp/export'; |
|
17 | +} elseif(is_dir(MODX_BASE_PATH . 'assets')) { |
|
18 | + $export_dir = MODX_BASE_PATH . 'assets/export'; |
|
19 | +} |
|
17 | 20 | $modx->export->targetDir = $export_dir; |
18 | 21 | |
19 | -if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path']))) |
|
22 | +if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path']))) { |
|
20 | 23 | return $_lang['export_site.static.php6']; |
21 | -elseif($modx->config['rb_base_dir'] === $export_dir . '/') |
|
24 | +} elseif($modx->config['rb_base_dir'] === $export_dir . '/') { |
|
22 | 25 | return $modx->parsePlaceholder($_lang['export_site.static.php7'],'rb_base_url=' . $modx->config['base_url'] . $modx->config['rb_base_url']); |
23 | -elseif(!is_writable($export_dir)) |
|
26 | +} elseif(!is_writable($export_dir)) { |
|
24 | 27 | return $_lang['export_site_target_unwritable']; |
28 | +} |
|
25 | 29 | |
26 | 30 | $modx->export->generate_mode = $_POST['generate_mode']; |
27 | 31 |
@@ -36,7 +36,8 @@ discard block |
||
36 | 36 | $header="Location: index.php?r=1&a=3&id=$id"; |
37 | 37 | header($header); |
38 | 38 | |
39 | -function duplicateDocument($docid, $parent=null, $_toplevel=0) { |
|
39 | +function duplicateDocument($docid, $parent=null, $_toplevel=0) |
|
40 | +{ |
|
40 | 41 | global $modx, $_lang; |
41 | 42 | |
42 | 43 | // invoke OnBeforeDocDuplicate event |
@@ -57,8 +58,7 @@ discard block |
||
57 | 58 | $content = $modx->db->getRow($rs); |
58 | 59 | |
59 | 60 | // Handle incremental ID |
60 | - switch($modx->config['docid_incrmnt_method']) |
|
61 | - { |
|
61 | + switch($modx->config['docid_incrmnt_method']) { |
|
62 | 62 | case '1': |
63 | 63 | $from = "{$tblsc} AS T0 LEFT JOIN {$tblsc} AS T1 ON T0.id + 1 = T1.id"; |
64 | 64 | $rs = $modx->db->select('MIN(T0.id)+1', $from, "T1.id IS NULL"); |
@@ -79,8 +79,11 @@ discard block |
||
79 | 79 | $pagetitle = $modx->db->getValue($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$docid}'")); |
80 | 80 | $pagetitle = $modx->db->escape($pagetitle); |
81 | 81 | $count = $modx->db->getRecordCount($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "pagetitle LIKE '{$pagetitle} Duplicate%'")); |
82 | - if($count>=1) $count = ' '.($count+1); |
|
83 | - else $count = ''; |
|
82 | + if($count>=1) { |
|
83 | + $count = ' '.($count+1); |
|
84 | + } else { |
|
85 | + $count = ''; |
|
86 | + } |
|
84 | 87 | |
85 | 88 | $content['pagetitle'] = $_lang['duplicated_el_suffix'].$count.' '.$content['pagetitle']; |
86 | 89 | $content['alias'] = null; |
@@ -89,7 +92,9 @@ discard block |
||
89 | 92 | } |
90 | 93 | |
91 | 94 | // change the parent accordingly |
92 | - if ($parent !== null) $content['parent'] = $parent; |
|
95 | + if ($parent !== null) { |
|
96 | + $content['parent'] = $parent; |
|
97 | + } |
|
93 | 98 | |
94 | 99 | // Change the author |
95 | 100 | $content['createdby'] = $userID; |
@@ -129,15 +134,17 @@ discard block |
||
129 | 134 | // Start duplicating all the child documents that aren't deleted. |
130 | 135 | $_toplevel++; |
131 | 136 | $rs = $modx->db->select('id', $tblsc, "parent='{$docid}' AND deleted=0", 'id ASC'); |
132 | - while ($row = $modx->db->getRow($rs)) |
|
133 | - duplicateDocument($row['id'], $newparent, $_toplevel); |
|
137 | + while ($row = $modx->db->getRow($rs)) { |
|
138 | + duplicateDocument($row['id'], $newparent, $_toplevel); |
|
139 | + } |
|
134 | 140 | |
135 | 141 | // return the new doc id |
136 | 142 | return $newparent; |
137 | 143 | } |
138 | 144 | |
139 | 145 | // Duplicate Document TVs |
140 | -function duplicateTVs($oldid,$newid){ |
|
146 | +function duplicateTVs($oldid,$newid) |
|
147 | +{ |
|
141 | 148 | global $modx; |
142 | 149 | |
143 | 150 | $tbltvc = $modx->getFullTableName('site_tmplvar_contentvalues'); |
@@ -149,7 +156,8 @@ discard block |
||
149 | 156 | } |
150 | 157 | |
151 | 158 | // Duplicate Document Access Permissions |
152 | -function duplicateAccess($oldid,$newid){ |
|
159 | +function duplicateAccess($oldid,$newid) |
|
160 | +{ |
|
153 | 161 | global $modx; |
154 | 162 | |
155 | 163 | $tbldg = $modx->getFullTableName('document_groups'); |
@@ -14,8 +14,11 @@ |
||
14 | 14 | // count duplicates |
15 | 15 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_plugins'), "id='{$id}'")); |
16 | 16 | $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_plugins'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'")); |
17 | -if($count>=1) $count = ' '.($count+1); |
|
18 | -else $count = ''; |
|
17 | +if($count>=1) { |
|
18 | + $count = ' '.($count+1); |
|
19 | +} else { |
|
20 | + $count = ''; |
|
21 | +} |
|
19 | 22 | |
20 | 23 | // duplicate Plugin |
21 | 24 | $newid = $modx->db->insert( |
@@ -14,8 +14,11 @@ |
||
14 | 14 | // count duplicates |
15 | 15 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_tmplvars'), "id='{$id}'")); |
16 | 16 | $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_tmplvars'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'")); |
17 | -if($count>=1) $count = ' '.($count+1); |
|
18 | -else $count = ''; |
|
17 | +if($count>=1) { |
|
18 | + $count = ' '.($count+1); |
|
19 | +} else { |
|
20 | + $count = ''; |
|
21 | +} |
|
19 | 22 | |
20 | 23 | // duplicate TV |
21 | 24 | $newid = $modx->db->insert( |