@@ -14,7 +14,7 @@ |
||
14 | 14 | if (!empty($user_id)) { |
15 | 15 | // Raymond: grab the user settings from the database. |
16 | 16 | $rs = $modx->db->select('setting_name, setting_value', $modx->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->db->getRow($rs)) { |
@@ -101,14 +101,14 @@ discard block |
||
101 | 101 | $array_paging['total'] = $this->int_nbr_row; |
102 | 102 | |
103 | 103 | if ($this->int_cur_position != 0) { |
104 | - $array_paging['first_link'] = "<a href=\"$PHP_SELF?int_cur_position=0" . $this->str_ext_argv . "\">"; |
|
105 | - $array_paging['previous_link'] = "<a href=\"$PHP_SELF?int_cur_position=" . ($this->int_cur_position - $this->int_num_result) . $this->str_ext_argv . "\">"; |
|
104 | + $array_paging['first_link'] = "<a href=\"$PHP_SELF?int_cur_position=0".$this->str_ext_argv."\">"; |
|
105 | + $array_paging['previous_link'] = "<a href=\"$PHP_SELF?int_cur_position=".($this->int_cur_position - $this->int_num_result).$this->str_ext_argv."\">"; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | if (($this->int_nbr_row - $this->int_cur_position) > $this->int_num_result) { |
109 | 109 | $int_new_position = $this->int_cur_position + $this->int_num_result; |
110 | - $array_paging['last_link'] = "<a href=\"$PHP_SELF?int_cur_position=" . $this->int_nbr_row . $this->str_ext_argv . "\">"; |
|
111 | - $array_paging['next_link'] = "<a href=\"$PHP_SELF?int_cur_position=$int_new_position" . $this->str_ext_argv . "\">"; |
|
110 | + $array_paging['last_link'] = "<a href=\"$PHP_SELF?int_cur_position=".$this->int_nbr_row.$this->str_ext_argv."\">"; |
|
111 | + $array_paging['next_link'] = "<a href=\"$PHP_SELF?int_cur_position=$int_new_position".$this->str_ext_argv."\">"; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | return $array_paging; |
@@ -126,10 +126,10 @@ discard block |
||
126 | 126 | for ($i = 0; $i < $this->getNumberOfPage(); $i++) { |
127 | 127 | // if current page, do not make a link |
128 | 128 | if ($i == $this->getCurrentPage()) { |
129 | - $array_all_page[$i] = "<b>" . ($i + 1) . "</b> "; |
|
129 | + $array_all_page[$i] = "<b>".($i + 1)."</b> "; |
|
130 | 130 | } else { |
131 | 131 | $int_new_position = ($i * $this->int_num_result); |
132 | - $array_all_page[$i] = "<a href=\"" . $PHP_SELF . "?int_cur_position=$int_new_position$this->str_ext_argv\">" . ($i + 1) . "</a> "; |
|
132 | + $array_all_page[$i] = "<a href=\"".$PHP_SELF."?int_cur_position=$int_new_position$this->str_ext_argv\">".($i + 1)."</a> "; |
|
133 | 133 | } |
134 | 134 | } |
135 | 135 |
@@ -20,14 +20,14 @@ |
||
20 | 20 | ($docid > 0 ? "id='$docid'" : "privateweb = 1")); |
21 | 21 | $rs = $modx->db->select( |
22 | 22 | 'DISTINCT sc.id', |
23 | - $modx->getFullTableName("site_content") . " sc |
|
24 | - LEFT JOIN " . $modx->getFullTableName("document_groups") . " dg ON dg.document = sc.id |
|
25 | - LEFT JOIN " . $modx->getFullTableName("webgroup_access") . " wga ON wga.documentgroup = dg.document_group", |
|
26 | - ($docid > 0 ? " sc.id='{$docid}' AND " : "") . "wga.id>0" |
|
23 | + $modx->getFullTableName("site_content")." sc |
|
24 | + LEFT JOIN " . $modx->getFullTableName("document_groups")." dg ON dg.document = sc.id |
|
25 | + LEFT JOIN " . $modx->getFullTableName("webgroup_access")." wga ON wga.documentgroup = dg.document_group", |
|
26 | + ($docid > 0 ? " sc.id='{$docid}' AND " : "")."wga.id>0" |
|
27 | 27 | ); |
28 | 28 | $ids = $modx->db->getColumn("id", $rs); |
29 | 29 | if (count($ids) > 0) { |
30 | 30 | $modx->db->update('privateweb = 1', $modx->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->db->select('COUNT(*)', $modx->getFullTableName('user_messages'), |
7 | - "recipient=" . $modx->getLoginUserID() . " AND messageread=0"); |
|
7 | + "recipient=".$modx->getLoginUserID()." AND messageread=0"); |
|
8 | 8 | $nrnewmessages = $modx->db->getValue($rs); |
9 | -$rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID()); |
|
9 | +$rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()); |
|
10 | 10 | $nrtotalmessages = $modx->db->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 | } |
@@ -7,53 +7,53 @@ discard block |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -Class TemplateParser { |
|
10 | +Class TemplateParser{ |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * @param array $config [action, tabs, toArray] |
14 | 14 | * @param array $data |
15 | 15 | * @return string |
16 | 16 | */ |
17 | - public function output($config = array(), $data = array()) { |
|
17 | + public function output($config = array(), $data = array()){ |
|
18 | 18 | global $modx; |
19 | 19 | |
20 | 20 | $output = ''; |
21 | 21 | $action = !empty($config['action']) ? $config['action'] : (!empty($_REQUEST['a']) ? $_REQUEST['a'] : ''); |
22 | - $tab = isset($config['tab']) ? ' AND tab IN(' . $config['tab'] . ')' : ''; |
|
22 | + $tab = isset($config['tab']) ? ' AND tab IN('.$config['tab'].')' : ''; |
|
23 | 23 | |
24 | - if($action) { |
|
24 | + if ($action) { |
|
25 | 25 | $sql = $modx->db->query('SELECT t1.*, IF(t1.alias=\'\',t1.name,t1.alias) AS alias, t2.category AS category_name |
26 | - FROM ' . $modx->getFullTableName('system_templates') . ' AS t1 |
|
27 | - INNER JOIN ' . $modx->getFullTableName('categories') . ' AS t2 ON t2.id=t1.category |
|
28 | - WHERE t1.action IN(' . $action . ') ' . $tab . ' |
|
26 | + FROM ' . $modx->getFullTableName('system_templates').' AS t1 |
|
27 | + INNER JOIN ' . $modx->getFullTableName('categories').' AS t2 ON t2.id=t1.category |
|
28 | + WHERE t1.action IN(' . $action.') '.$tab.' |
|
29 | 29 | ORDER BY t1.tab ASC, t1.rank ASC'); |
30 | 30 | |
31 | - if($modx->db->getRecordCount($sql)) { |
|
31 | + if ($modx->db->getRecordCount($sql)) { |
|
32 | 32 | $tabs = array(); |
33 | - while($row = $modx->db->getRow($sql)) { |
|
34 | - if(!$row['value'] && !empty($data[$row['name']])) { |
|
33 | + while ($row = $modx->db->getRow($sql)) { |
|
34 | + if (!$row['value'] && !empty($data[$row['name']])) { |
|
35 | 35 | $row['value'] = $data[$row['name']]; |
36 | 36 | } |
37 | 37 | $tabs[$row['tab']]['category_name'] = $row['category_name']; |
38 | 38 | $tabs[$row['tab']][$row['name']] = TemplateParser::render($row); |
39 | 39 | } |
40 | 40 | |
41 | - if(!empty($config['toArray'])) { |
|
41 | + if (!empty($config['toArray'])) { |
|
42 | 42 | $output = $tabs; |
43 | 43 | } else { |
44 | - $output .= '<div class="tab-pane" id="pane_' . $action . '">'; |
|
44 | + $output .= '<div class="tab-pane" id="pane_'.$action.'">'; |
|
45 | 45 | $output .= ' |
46 | 46 | <script type="text/javascript"> |
47 | - var pane_' . $action . ' = new WebFXTabPane(document.getElementById("pane_' . $action . '"), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false') . '); |
|
47 | + var pane_' . $action.' = new WebFXTabPane(document.getElementById("pane_'.$action.'"), '.($modx->config['remember_last_tab'] == 1 ? 'true' : 'false').'); |
|
48 | 48 | </script>'; |
49 | 49 | |
50 | - foreach($tabs as $idTab => $tab) { |
|
51 | - $output .= '<div class="tab-page" id="tab_' . $action . '_' . $idTab . '">'; |
|
50 | + foreach ($tabs as $idTab => $tab) { |
|
51 | + $output .= '<div class="tab-page" id="tab_'.$action.'_'.$idTab.'">'; |
|
52 | 52 | $output .= ' |
53 | - <h2 class="tab">' . (!empty($config['tabs'][$idTab]) ? $config['tabs'][$idTab] : $tab['category_name']) . '</h2> |
|
54 | - <script type="text/javascript">pane_' . $action . '.addTabPage(document.getElementById("tab_' . $action . '_' . $idTab . '"));</script>'; |
|
53 | + <h2 class="tab">' . (!empty($config['tabs'][$idTab]) ? $config['tabs'][$idTab] : $tab['category_name']).'</h2> |
|
54 | + <script type="text/javascript">pane_' . $action.'.addTabPage(document.getElementById("tab_'.$action.'_'.$idTab.'"));</script>'; |
|
55 | 55 | unset($tab['category_name']); |
56 | - foreach($tab as $item) { |
|
56 | + foreach ($tab as $item) { |
|
57 | 57 | $output .= $item; |
58 | 58 | } |
59 | 59 | $output .= '</div>'; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @param array $data |
71 | 71 | * @return string |
72 | 72 | */ |
73 | - private function render($data) { |
|
73 | + private function render($data){ |
|
74 | 74 | global $modx, $_lang, $_country_lang; |
75 | 75 | |
76 | 76 | $data['lang.name'] = (isset($_lang[$data['alias']]) ? $_lang[$data['alias']] : $data['alias']); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $output = ''; |
81 | 81 | $output .= '<div class="form-group row">'; |
82 | 82 | |
83 | - switch($data['type']) { |
|
83 | + switch ($data['type']) { |
|
84 | 84 | |
85 | 85 | case 'text': |
86 | 86 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label> |
@@ -114,18 +114,18 @@ discard block |
||
114 | 114 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
115 | 115 | $output .= '<div class="col-sm-7">'; |
116 | 116 | $output .= '<select name="[+name+]" class="form-control" id="[+name+]" onChange="documentDirty=true;">'; |
117 | - if($data['name'] == 'country' && isset($_country_lang)) { |
|
117 | + if ($data['name'] == 'country' && isset($_country_lang)) { |
|
118 | 118 | $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $data['country']; |
119 | - $output .= '<option value=""' . (!isset($chosenCountry) ? ' selected' : '') . '> </option>'; |
|
120 | - foreach($_country_lang as $key => $value) { |
|
121 | - $output .= '<option value="' . $key . '"' . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . '>' . $value . '</option>'; |
|
119 | + $output .= '<option value=""'.(!isset($chosenCountry) ? ' selected' : '').'> </option>'; |
|
120 | + foreach ($_country_lang as $key => $value) { |
|
121 | + $output .= '<option value="'.$key.'"'.(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').'>'.$value.'</option>'; |
|
122 | 122 | } |
123 | 123 | } else { |
124 | - if($data['elements']) { |
|
124 | + if ($data['elements']) { |
|
125 | 125 | $elements = explode('||', $data['elements']); |
126 | - foreach($elements as $key => $value) { |
|
126 | + foreach ($elements as $key => $value) { |
|
127 | 127 | $value = explode('==', $value); |
128 | - $output .= '<option value="' . $value[1] . '">' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]) . '</option>'; |
|
128 | + $output .= '<option value="'.$value[1].'">'.(isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]).'</option>'; |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 | } |
@@ -139,11 +139,11 @@ discard block |
||
139 | 139 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
140 | 140 | $output .= '<div class="col-sm-7">'; |
141 | 141 | $output .= '<input type="checkbox" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />'; |
142 | - if($data['elements']) { |
|
142 | + if ($data['elements']) { |
|
143 | 143 | $elements = explode('||', $data['elements']); |
144 | - foreach($elements as $key => $value) { |
|
144 | + foreach ($elements as $key => $value) { |
|
145 | 145 | $value = explode('==', $value); |
146 | - $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]); |
|
146 | + $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]); |
|
147 | 147 | } |
148 | 148 | } |
149 | 149 | $output .= $data['content']; |
@@ -155,11 +155,11 @@ discard block |
||
155 | 155 | $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>'; |
156 | 156 | $output .= '<div class="col-sm-7">'; |
157 | 157 | $output .= '<input type="radio" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />'; |
158 | - if($data['elements']) { |
|
158 | + if ($data['elements']) { |
|
159 | 159 | $elements = explode('||', $data['elements']); |
160 | - foreach($elements as $key => $value) { |
|
160 | + foreach ($elements as $key => $value) { |
|
161 | 161 | $value = explode('==', $value); |
162 | - $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]); |
|
162 | + $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]); |
|
163 | 163 | } |
164 | 164 | } |
165 | 165 | $output .= $data['content']; |
@@ -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 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | * @param string $itemid |
140 | 140 | * @return string |
141 | 141 | */ |
142 | -function getAction($actionId, $itemid='') { |
|
142 | +function getAction($actionId, $itemid = ''){ |
|
143 | 143 | global $action_list; |
144 | 144 | |
145 | 145 | $ret = sprintf($action_list[$actionId], $itemid); |
@@ -71,11 +71,11 @@ |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | if ($context === 'common') { |
74 | - $lang_path = MODX_MANAGER_PATH . 'includes/lang/'; |
|
74 | + $lang_path = MODX_MANAGER_PATH.'includes/lang/'; |
|
75 | 75 | } else { |
76 | - $lang_path = MODX_MANAGER_PATH . "includes/lang/{$context}/"; |
|
76 | + $lang_path = MODX_MANAGER_PATH."includes/lang/{$context}/"; |
|
77 | 77 | } |
78 | - include_once($lang_path . 'english.inc.php'); |
|
78 | + include_once($lang_path.'english.inc.php'); |
|
79 | 79 | $manager_language = $modx->config['manager_language']; |
80 | 80 | if (is_file("{$lang_path}{$manager_language}.inc.php")) { |
81 | 81 | include_once("{$lang_path}{$manager_language}.inc.php"); |
@@ -11,7 +11,7 @@ |
||
11 | 11 | } |
12 | 12 | |
13 | 13 | global $sanitize_seed; |
14 | -$sanitize_seed = 'sanitize_seed_' . base_convert(md5(__FILE__), 16, 36); |
|
14 | +$sanitize_seed = 'sanitize_seed_'.base_convert(md5(__FILE__), 16, 36); |
|
15 | 15 | |
16 | 16 | // sanitize array |
17 | 17 | if (!function_exists('modx_sanitize_gpc')) { |
@@ -36,16 +36,16 @@ discard block |
||
36 | 36 | $action = "", |
37 | 37 | $itemid = "", |
38 | 38 | $itemname = "" |
39 | - ) { |
|
39 | + ){ |
|
40 | 40 | global $modx; |
41 | 41 | $this->entry['msg'] = $msg; // writes testmessage to the object |
42 | - $this->entry['action'] = empty($action) ? $modx->manager->action : $action; // writes the action to the object |
|
42 | + $this->entry['action'] = empty($action) ? $modx->manager->action : $action; // writes the action to the object |
|
43 | 43 | |
44 | 44 | // User Credentials |
45 | 45 | $this->entry['internalKey'] = $internalKey == "" ? $modx->getLoginUserID() : $internalKey; |
46 | 46 | $this->entry['username'] = $username == "" ? $modx->getLoginUserName() : $username; |
47 | 47 | |
48 | - $this->entry['itemId'] = (empty($itemid) && isset($_REQUEST['id'])) ? (int)$_REQUEST['id'] : $itemid; // writes the id to the object |
|
48 | + $this->entry['itemId'] = (empty($itemid) && isset($_REQUEST['id'])) ? (int) $_REQUEST['id'] : $itemid; // writes the id to the object |
|
49 | 49 | if ($this->entry['itemId'] == 0) { |
50 | 50 | $this->entry['itemId'] = "-"; |
51 | 51 | } // to stop items having id 0 |
@@ -93,10 +93,10 @@ discard block |
||
93 | 93 | $fields['message'] = $modx->db->escape($this->entry['msg']); |
94 | 94 | $insert_id = $modx->db->insert($fields, $tbl_manager_log); |
95 | 95 | if (!$insert_id) { |
96 | - $modx->messageQuit("Logging error: couldn't save log to table! Error code: " . $modx->db->getLastError()); |
|
96 | + $modx->messageQuit("Logging error: couldn't save log to table! Error code: ".$modx->db->getLastError()); |
|
97 | 97 | } else { |
98 | - $limit = (isset($modx->config['manager_log_limit'])) ? (int)$modx->config['manager_log_limit'] : 3000; |
|
99 | - $trim = (isset($modx->config['manager_log_trim'])) ? (int)$modx->config['manager_log_trim'] : 100; |
|
98 | + $limit = (isset($modx->config['manager_log_limit'])) ? (int) $modx->config['manager_log_limit'] : 3000; |
|
99 | + $trim = (isset($modx->config['manager_log_trim'])) ? (int) $modx->config['manager_log_trim'] : 100; |
|
100 | 100 | if (($insert_id % $trim) === 0) { |
101 | 101 | $modx->rotate_log('manager_log', $limit, $trim); |
102 | 102 | } |