@@ -492,7 +492,7 @@ |
||
492 | 492 | }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { |
493 | 493 | $publishedon = $pub_date; |
494 | 494 | $publishedby = $modx->getLoginUserID(); |
495 | - }elseif ($was_published && !$published) { |
|
495 | + }elseif ($was_published && !$published) { |
|
496 | 496 | $publishedon = 0; |
497 | 497 | $publishedby = 0; |
498 | 498 | } else { |
@@ -4,237 +4,237 @@ discard block |
||
4 | 4 | */ |
5 | 5 | |
6 | 6 | $sitemenu['bars'] = array( |
7 | - 'bars', |
|
8 | - 'main', |
|
9 | - '<i class="fa fa-bars"></i>', |
|
10 | - 'javascript:;', |
|
11 | - $_lang['home'], |
|
12 | - 'modx.resizer.toggle(); return false;', |
|
13 | - ' return false;', |
|
14 | - '', |
|
15 | - 0, |
|
16 | - 10, |
|
17 | - '' |
|
7 | + 'bars', |
|
8 | + 'main', |
|
9 | + '<i class="fa fa-bars"></i>', |
|
10 | + 'javascript:;', |
|
11 | + $_lang['home'], |
|
12 | + 'modx.resizer.toggle(); return false;', |
|
13 | + ' return false;', |
|
14 | + '', |
|
15 | + 0, |
|
16 | + 10, |
|
17 | + '' |
|
18 | 18 | ); |
19 | 19 | |
20 | 20 | //mainMenu |
21 | 21 | $sitemenu['site'] = array( |
22 | - 'site', |
|
23 | - 'main', |
|
24 | - '<i class="fa fa-tachometer"></i>' . $_lang['home'], |
|
25 | - 'index.php?a=2', |
|
26 | - $_lang['home'], |
|
27 | - '', |
|
28 | - '', |
|
29 | - 'main', |
|
30 | - 0, |
|
31 | - 10, |
|
32 | - 'active' |
|
22 | + 'site', |
|
23 | + 'main', |
|
24 | + '<i class="fa fa-tachometer"></i>' . $_lang['home'], |
|
25 | + 'index.php?a=2', |
|
26 | + $_lang['home'], |
|
27 | + '', |
|
28 | + '', |
|
29 | + 'main', |
|
30 | + 0, |
|
31 | + 10, |
|
32 | + 'active' |
|
33 | 33 | ); |
34 | 34 | |
35 | 35 | if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) { |
36 | - $sitemenu['elements'] = array( |
|
37 | - 'elements', |
|
38 | - 'main', |
|
39 | - '<i class="fa fa-th"></i>' . $_lang['elements'], |
|
40 | - 'javascript:;', |
|
41 | - $_lang['elements'], |
|
42 | - ' return false;', |
|
43 | - '', |
|
44 | - '', |
|
45 | - 0, |
|
46 | - 20, |
|
47 | - '' |
|
48 | - ); |
|
36 | + $sitemenu['elements'] = array( |
|
37 | + 'elements', |
|
38 | + 'main', |
|
39 | + '<i class="fa fa-th"></i>' . $_lang['elements'], |
|
40 | + 'javascript:;', |
|
41 | + $_lang['elements'], |
|
42 | + ' return false;', |
|
43 | + '', |
|
44 | + '', |
|
45 | + 0, |
|
46 | + 20, |
|
47 | + '' |
|
48 | + ); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | if($modx->hasPermission('exec_module')) { |
52 | - $sitemenu['modules'] = array( |
|
53 | - 'modules', |
|
54 | - 'main', |
|
55 | - '<i class="'.$_style['icons_modules'] .'"></i>' . $_lang['modules'], |
|
56 | - 'javascript:;', |
|
57 | - $_lang['modules'], |
|
58 | - ' return false;', |
|
59 | - '', |
|
60 | - '', |
|
61 | - 0, |
|
62 | - 30, |
|
63 | - '' |
|
64 | - ); |
|
52 | + $sitemenu['modules'] = array( |
|
53 | + 'modules', |
|
54 | + 'main', |
|
55 | + '<i class="'.$_style['icons_modules'] .'"></i>' . $_lang['modules'], |
|
56 | + 'javascript:;', |
|
57 | + $_lang['modules'], |
|
58 | + ' return false;', |
|
59 | + '', |
|
60 | + '', |
|
61 | + 0, |
|
62 | + 30, |
|
63 | + '' |
|
64 | + ); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | if($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) { |
68 | - $sitemenu['users'] = array( |
|
69 | - 'users', |
|
70 | - 'main', |
|
71 | - '<i class="fa fa-users"></i>' . $_lang['users'], |
|
72 | - 'javascript:;', |
|
73 | - $_lang['users'], |
|
74 | - ' return false;', |
|
75 | - 'edit_user', |
|
76 | - '', |
|
77 | - 0, |
|
78 | - 40, |
|
79 | - '' |
|
80 | - ); |
|
68 | + $sitemenu['users'] = array( |
|
69 | + 'users', |
|
70 | + 'main', |
|
71 | + '<i class="fa fa-users"></i>' . $_lang['users'], |
|
72 | + 'javascript:;', |
|
73 | + $_lang['users'], |
|
74 | + ' return false;', |
|
75 | + 'edit_user', |
|
76 | + '', |
|
77 | + 0, |
|
78 | + 40, |
|
79 | + '' |
|
80 | + ); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | if($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) { |
84 | - $sitemenu['tools'] = array( |
|
85 | - 'tools', |
|
86 | - 'main', |
|
87 | - '<i class="fa fa-wrench"></i>' . $_lang['tools'], |
|
88 | - 'javascript:;', |
|
89 | - $_lang['tools'], |
|
90 | - ' return false;', |
|
91 | - '', |
|
92 | - '', |
|
93 | - 0, |
|
94 | - 50, |
|
95 | - '' |
|
96 | - ); |
|
84 | + $sitemenu['tools'] = array( |
|
85 | + 'tools', |
|
86 | + 'main', |
|
87 | + '<i class="fa fa-wrench"></i>' . $_lang['tools'], |
|
88 | + 'javascript:;', |
|
89 | + $_lang['tools'], |
|
90 | + ' return false;', |
|
91 | + '', |
|
92 | + '', |
|
93 | + 0, |
|
94 | + 50, |
|
95 | + '' |
|
96 | + ); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | $tab = 0; |
100 | 100 | if($modx->hasPermission('edit_template')) { |
101 | - $sitemenu['element_templates'] = array( |
|
102 | - 'element_templates', |
|
103 | - 'elements', |
|
104 | - '<i class="fa fa-newspaper-o"></i>' . $_lang['manage_templates'] . '<i class="fa fa-angle-right toggle"></i>', |
|
105 | - 'index.php?a=76&tab=' . $tab++, |
|
106 | - $_lang['manage_templates'], |
|
107 | - '', |
|
108 | - 'new_template,edit_template', |
|
109 | - 'main', |
|
110 | - 0, |
|
111 | - 10, |
|
112 | - 'dropdown-toggle' |
|
113 | - ); |
|
101 | + $sitemenu['element_templates'] = array( |
|
102 | + 'element_templates', |
|
103 | + 'elements', |
|
104 | + '<i class="fa fa-newspaper-o"></i>' . $_lang['manage_templates'] . '<i class="fa fa-angle-right toggle"></i>', |
|
105 | + 'index.php?a=76&tab=' . $tab++, |
|
106 | + $_lang['manage_templates'], |
|
107 | + '', |
|
108 | + 'new_template,edit_template', |
|
109 | + 'main', |
|
110 | + 0, |
|
111 | + 10, |
|
112 | + 'dropdown-toggle' |
|
113 | + ); |
|
114 | 114 | } |
115 | 115 | if($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
116 | - $sitemenu['element_tplvars'] = array( |
|
117 | - 'element_tplvars', |
|
118 | - 'elements', |
|
119 | - '<i class="fa fa-list-alt"></i>' . $_lang['tmplvars'] . '<i class="fa fa-angle-right toggle"></i>', |
|
120 | - 'index.php?a=76&tab=' . $tab++, |
|
121 | - $_lang['tmplvars'], |
|
122 | - '', |
|
123 | - 'new_template,edit_template', |
|
124 | - 'main', |
|
125 | - 0, |
|
126 | - 20, |
|
127 | - 'dropdown-toggle' |
|
128 | - ); |
|
116 | + $sitemenu['element_tplvars'] = array( |
|
117 | + 'element_tplvars', |
|
118 | + 'elements', |
|
119 | + '<i class="fa fa-list-alt"></i>' . $_lang['tmplvars'] . '<i class="fa fa-angle-right toggle"></i>', |
|
120 | + 'index.php?a=76&tab=' . $tab++, |
|
121 | + $_lang['tmplvars'], |
|
122 | + '', |
|
123 | + 'new_template,edit_template', |
|
124 | + 'main', |
|
125 | + 0, |
|
126 | + 20, |
|
127 | + 'dropdown-toggle' |
|
128 | + ); |
|
129 | 129 | } |
130 | 130 | if($modx->hasPermission('edit_chunk')) { |
131 | - $sitemenu['element_htmlsnippets'] = array( |
|
132 | - 'element_htmlsnippets', |
|
133 | - 'elements', |
|
134 | - '<i class="fa fa-th-large"></i>' . $_lang['manage_htmlsnippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
135 | - 'index.php?a=76&tab=' . $tab++, |
|
136 | - $_lang['manage_htmlsnippets'], |
|
137 | - '', |
|
138 | - 'new_chunk,edit_chunk', |
|
139 | - 'main', |
|
140 | - 0, |
|
141 | - 30, |
|
142 | - 'dropdown-toggle' |
|
143 | - ); |
|
131 | + $sitemenu['element_htmlsnippets'] = array( |
|
132 | + 'element_htmlsnippets', |
|
133 | + 'elements', |
|
134 | + '<i class="fa fa-th-large"></i>' . $_lang['manage_htmlsnippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
135 | + 'index.php?a=76&tab=' . $tab++, |
|
136 | + $_lang['manage_htmlsnippets'], |
|
137 | + '', |
|
138 | + 'new_chunk,edit_chunk', |
|
139 | + 'main', |
|
140 | + 0, |
|
141 | + 30, |
|
142 | + 'dropdown-toggle' |
|
143 | + ); |
|
144 | 144 | } |
145 | 145 | if($modx->hasPermission('edit_snippet')) { |
146 | - $sitemenu['element_snippets'] = array( |
|
147 | - 'element_snippets', |
|
148 | - 'elements', |
|
149 | - '<i class="fa fa-code"></i>' . $_lang['manage_snippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
150 | - 'index.php?a=76&tab=' . $tab++, |
|
151 | - $_lang['manage_snippets'], |
|
152 | - '', |
|
153 | - 'new_snippet,edit_snippet', |
|
154 | - 'main', |
|
155 | - 0, |
|
156 | - 40, |
|
157 | - 'dropdown-toggle' |
|
158 | - ); |
|
146 | + $sitemenu['element_snippets'] = array( |
|
147 | + 'element_snippets', |
|
148 | + 'elements', |
|
149 | + '<i class="fa fa-code"></i>' . $_lang['manage_snippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
150 | + 'index.php?a=76&tab=' . $tab++, |
|
151 | + $_lang['manage_snippets'], |
|
152 | + '', |
|
153 | + 'new_snippet,edit_snippet', |
|
154 | + 'main', |
|
155 | + 0, |
|
156 | + 40, |
|
157 | + 'dropdown-toggle' |
|
158 | + ); |
|
159 | 159 | } |
160 | 160 | if($modx->hasPermission('edit_plugin')) { |
161 | - $sitemenu['element_plugins'] = array( |
|
162 | - 'element_plugins', |
|
163 | - 'elements', |
|
164 | - '<i class="fa fa-plug"></i>' . $_lang['manage_plugins'] . '<i class="fa fa-angle-right toggle"></i>', |
|
165 | - 'index.php?a=76&tab=' . $tab++, |
|
166 | - $_lang['manage_plugins'], |
|
167 | - '', |
|
168 | - 'new_plugin,edit_plugin', |
|
169 | - 'main', |
|
170 | - 0, |
|
171 | - 50, |
|
172 | - 'dropdown-toggle' |
|
173 | - ); |
|
161 | + $sitemenu['element_plugins'] = array( |
|
162 | + 'element_plugins', |
|
163 | + 'elements', |
|
164 | + '<i class="fa fa-plug"></i>' . $_lang['manage_plugins'] . '<i class="fa fa-angle-right toggle"></i>', |
|
165 | + 'index.php?a=76&tab=' . $tab++, |
|
166 | + $_lang['manage_plugins'], |
|
167 | + '', |
|
168 | + 'new_plugin,edit_plugin', |
|
169 | + 'main', |
|
170 | + 0, |
|
171 | + 50, |
|
172 | + 'dropdown-toggle' |
|
173 | + ); |
|
174 | 174 | } |
175 | 175 | //$sitemenu['element_categories'] = array('element_categories','elements',$_lang['element_categories'],'index.php?a=76&tab=5',$_lang['element_categories'],'','new_template,edit_template,new_snippet,edit_snippet,new_chunk,edit_chunk,new_plugin,edit_plugin','main',1,60,''); |
176 | 176 | |
177 | 177 | if($modx->hasPermission('file_manager')) { |
178 | - $sitemenu['manage_files'] = array( |
|
179 | - 'manage_files', |
|
180 | - 'elements', |
|
181 | - '<i class="fa fa-folder-open-o"></i>' . $_lang['manage_files'], |
|
182 | - 'index.php?a=31', |
|
183 | - $_lang['manage_files'], |
|
184 | - '', |
|
185 | - 'file_manager', |
|
186 | - 'main', |
|
187 | - 0, |
|
188 | - 80, |
|
189 | - '' |
|
190 | - ); |
|
178 | + $sitemenu['manage_files'] = array( |
|
179 | + 'manage_files', |
|
180 | + 'elements', |
|
181 | + '<i class="fa fa-folder-open-o"></i>' . $_lang['manage_files'], |
|
182 | + 'index.php?a=31', |
|
183 | + $_lang['manage_files'], |
|
184 | + '', |
|
185 | + 'file_manager', |
|
186 | + 'main', |
|
187 | + 0, |
|
188 | + 80, |
|
189 | + '' |
|
190 | + ); |
|
191 | 191 | } |
192 | 192 | if($modx->hasPermission('category_manager')) { |
193 | - $sitemenu['manage_categories'] = array( |
|
194 | - 'manage_categories', |
|
195 | - 'elements', |
|
196 | - '<i class="fa fa-object-group"></i>' . $_lang['manage_categories'], |
|
197 | - 'index.php?a=120', |
|
198 | - $_lang['manage_categories'], |
|
199 | - '', |
|
200 | - 'category_manager', |
|
201 | - 'main', |
|
202 | - 0, |
|
203 | - 70, |
|
204 | - '' |
|
205 | - ); |
|
193 | + $sitemenu['manage_categories'] = array( |
|
194 | + 'manage_categories', |
|
195 | + 'elements', |
|
196 | + '<i class="fa fa-object-group"></i>' . $_lang['manage_categories'], |
|
197 | + 'index.php?a=120', |
|
198 | + $_lang['manage_categories'], |
|
199 | + '', |
|
200 | + 'category_manager', |
|
201 | + 'main', |
|
202 | + 0, |
|
203 | + 70, |
|
204 | + '' |
|
205 | + ); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | // Modules Menu Items |
209 | 209 | if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) { |
210 | - $sitemenu['new_module'] = array( |
|
211 | - 'new_module', |
|
212 | - 'modules', |
|
213 | - '<i class="'.$_style['icons_modules'] .'"></i>' . $_lang['module_management'], |
|
214 | - 'index.php?a=106', |
|
215 | - $_lang['module_management'], |
|
216 | - '', |
|
217 | - 'new_module,edit_module', |
|
218 | - 'main', |
|
219 | - 1, |
|
220 | - 0, |
|
221 | - '' |
|
222 | - ); |
|
210 | + $sitemenu['new_module'] = array( |
|
211 | + 'new_module', |
|
212 | + 'modules', |
|
213 | + '<i class="'.$_style['icons_modules'] .'"></i>' . $_lang['module_management'], |
|
214 | + 'index.php?a=106', |
|
215 | + $_lang['module_management'], |
|
216 | + '', |
|
217 | + 'new_module,edit_module', |
|
218 | + 'main', |
|
219 | + 1, |
|
220 | + 0, |
|
221 | + '' |
|
222 | + ); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | if($modx->hasPermission('exec_module')) { |
226 | - if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
227 | - $rs = $modx->db->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member |
|
226 | + if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
227 | + $rs = $modx->db->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member |
|
228 | 228 | FROM ' . $modx->getFullTableName('site_modules') . ' AS sm |
229 | 229 | LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id |
230 | 230 | LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group |
231 | 231 | WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
232 | 232 | ORDER BY sm.name'); |
233 | - } else { |
|
234 | - $rs = $modx->db->select('*', $modx->getFullTableName('site_modules'), 'disabled != 1', 'name'); |
|
235 | - } |
|
236 | - if($modx->db->getRecordCount($rs)) { |
|
237 | - while ($row = $modx->db->getRow($rs)) { |
|
233 | + } else { |
|
234 | + $rs = $modx->db->select('*', $modx->getFullTableName('site_modules'), 'disabled != 1', 'name'); |
|
235 | + } |
|
236 | + if($modx->db->getRecordCount($rs)) { |
|
237 | + while ($row = $modx->db->getRow($rs)) { |
|
238 | 238 | $sitemenu['module' . $row['id']] = array( |
239 | 239 | 'module' . $row['id'], |
240 | 240 | 'modules', |
@@ -255,83 +255,83 @@ discard block |
||
255 | 255 | // security menu items (users) |
256 | 256 | |
257 | 257 | if($modx->hasPermission('edit_user')) { |
258 | - $sitemenu['user_management_title'] = array( |
|
259 | - 'user_management_title', |
|
260 | - 'users', |
|
261 | - '<i class="fa fa fa-user"></i>' . $_lang['user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
262 | - 'index.php?a=75', |
|
263 | - $_lang['user_management_title'], |
|
264 | - '', |
|
265 | - 'edit_user', |
|
266 | - 'main', |
|
267 | - 0, |
|
268 | - 10, |
|
269 | - 'dropdown-toggle' |
|
270 | - ); |
|
258 | + $sitemenu['user_management_title'] = array( |
|
259 | + 'user_management_title', |
|
260 | + 'users', |
|
261 | + '<i class="fa fa fa-user"></i>' . $_lang['user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
262 | + 'index.php?a=75', |
|
263 | + $_lang['user_management_title'], |
|
264 | + '', |
|
265 | + 'edit_user', |
|
266 | + 'main', |
|
267 | + 0, |
|
268 | + 10, |
|
269 | + 'dropdown-toggle' |
|
270 | + ); |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | if($modx->hasPermission('edit_web_user')) { |
274 | - $sitemenu['web_user_management_title'] = array( |
|
275 | - 'web_user_management_title', |
|
276 | - 'users', |
|
277 | - '<i class="fa fa-users"></i>' . $_lang['web_user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
278 | - 'index.php?a=99', |
|
279 | - $_lang['web_user_management_title'], |
|
280 | - '', |
|
281 | - 'edit_web_user', |
|
282 | - 'main', |
|
283 | - 0, |
|
284 | - 20, |
|
285 | - 'dropdown-toggle' |
|
286 | - ); |
|
274 | + $sitemenu['web_user_management_title'] = array( |
|
275 | + 'web_user_management_title', |
|
276 | + 'users', |
|
277 | + '<i class="fa fa-users"></i>' . $_lang['web_user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
278 | + 'index.php?a=99', |
|
279 | + $_lang['web_user_management_title'], |
|
280 | + '', |
|
281 | + 'edit_web_user', |
|
282 | + 'main', |
|
283 | + 0, |
|
284 | + 20, |
|
285 | + 'dropdown-toggle' |
|
286 | + ); |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | if($modx->hasPermission('edit_role')) { |
290 | - $sitemenu['role_management_title'] = array( |
|
291 | - 'role_management_title', |
|
292 | - 'users', |
|
293 | - '<i class="fa fa-legal"></i>' . $_lang['role_management_title'], |
|
294 | - 'index.php?a=86', |
|
295 | - $_lang['role_management_title'], |
|
296 | - '', |
|
297 | - 'new_role,edit_role,delete_role', |
|
298 | - 'main', |
|
299 | - 0, |
|
300 | - 30, |
|
301 | - '' |
|
302 | - ); |
|
290 | + $sitemenu['role_management_title'] = array( |
|
291 | + 'role_management_title', |
|
292 | + 'users', |
|
293 | + '<i class="fa fa-legal"></i>' . $_lang['role_management_title'], |
|
294 | + 'index.php?a=86', |
|
295 | + $_lang['role_management_title'], |
|
296 | + '', |
|
297 | + 'new_role,edit_role,delete_role', |
|
298 | + 'main', |
|
299 | + 0, |
|
300 | + 30, |
|
301 | + '' |
|
302 | + ); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | if($modx->hasPermission('access_permissions')) { |
306 | - $sitemenu['manager_permissions'] = array( |
|
307 | - 'manager_permissions', |
|
308 | - 'users', |
|
309 | - '<i class="fa fa-male"></i>' . $_lang['manager_permissions'], |
|
310 | - 'index.php?a=40', |
|
311 | - $_lang['manager_permissions'], |
|
312 | - '', |
|
313 | - 'access_permissions', |
|
314 | - 'main', |
|
315 | - 0, |
|
316 | - 40, |
|
317 | - '' |
|
318 | - ); |
|
306 | + $sitemenu['manager_permissions'] = array( |
|
307 | + 'manager_permissions', |
|
308 | + 'users', |
|
309 | + '<i class="fa fa-male"></i>' . $_lang['manager_permissions'], |
|
310 | + 'index.php?a=40', |
|
311 | + $_lang['manager_permissions'], |
|
312 | + '', |
|
313 | + 'access_permissions', |
|
314 | + 'main', |
|
315 | + 0, |
|
316 | + 40, |
|
317 | + '' |
|
318 | + ); |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | if($modx->hasPermission('web_access_permissions')) { |
322 | - $sitemenu['web_permissions'] = array( |
|
323 | - 'web_permissions', |
|
324 | - 'users', |
|
325 | - '<i class="fa fa-universal-access"></i>' . $_lang['web_permissions'], |
|
326 | - 'index.php?a=91', |
|
327 | - $_lang['web_permissions'], |
|
328 | - '', |
|
329 | - 'web_access_permissions', |
|
330 | - 'main', |
|
331 | - 0, |
|
332 | - 50, |
|
333 | - '' |
|
334 | - ); |
|
322 | + $sitemenu['web_permissions'] = array( |
|
323 | + 'web_permissions', |
|
324 | + 'users', |
|
325 | + '<i class="fa fa-universal-access"></i>' . $_lang['web_permissions'], |
|
326 | + 'index.php?a=91', |
|
327 | + $_lang['web_permissions'], |
|
328 | + '', |
|
329 | + 'web_access_permissions', |
|
330 | + 'main', |
|
331 | + 0, |
|
332 | + 50, |
|
333 | + '' |
|
334 | + ); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | // Tools Menu |
@@ -361,104 +361,104 @@ discard block |
||
361 | 361 | ); |
362 | 362 | |
363 | 363 | $sitemenu['search'] = array( |
364 | - 'search', |
|
365 | - 'tools', |
|
366 | - '<i class="fa fa-search"></i>' . $_lang['search'], |
|
367 | - 'index.php?a=71', |
|
368 | - $_lang['search'], |
|
369 | - '', |
|
370 | - '', |
|
371 | - 'main', |
|
372 | - 1, |
|
373 | - 9, |
|
374 | - '' |
|
364 | + 'search', |
|
365 | + 'tools', |
|
366 | + '<i class="fa fa-search"></i>' . $_lang['search'], |
|
367 | + 'index.php?a=71', |
|
368 | + $_lang['search'], |
|
369 | + '', |
|
370 | + '', |
|
371 | + 'main', |
|
372 | + 1, |
|
373 | + 9, |
|
374 | + '' |
|
375 | 375 | ); |
376 | 376 | |
377 | 377 | if($modx->hasPermission('bk_manager')) { |
378 | - $sitemenu['bk_manager'] = array( |
|
379 | - 'bk_manager', |
|
380 | - 'tools', |
|
381 | - '<i class="fa fa-database"></i>' . $_lang['bk_manager'], |
|
382 | - 'index.php?a=93', |
|
383 | - $_lang['bk_manager'], |
|
384 | - '', |
|
385 | - 'bk_manager', |
|
386 | - 'main', |
|
387 | - 0, |
|
388 | - 10, |
|
389 | - '' |
|
390 | - ); |
|
378 | + $sitemenu['bk_manager'] = array( |
|
379 | + 'bk_manager', |
|
380 | + 'tools', |
|
381 | + '<i class="fa fa-database"></i>' . $_lang['bk_manager'], |
|
382 | + 'index.php?a=93', |
|
383 | + $_lang['bk_manager'], |
|
384 | + '', |
|
385 | + 'bk_manager', |
|
386 | + 'main', |
|
387 | + 0, |
|
388 | + 10, |
|
389 | + '' |
|
390 | + ); |
|
391 | 391 | } |
392 | 392 | |
393 | 393 | if($modx->hasPermission('remove_locks')) { |
394 | - $sitemenu['remove_locks'] = array( |
|
395 | - 'remove_locks', |
|
396 | - 'tools', |
|
397 | - '<i class="fa fa-hourglass"></i>' . $_lang['remove_locks'], |
|
398 | - 'javascript:modx.removeLocks();', |
|
399 | - $_lang['remove_locks'], |
|
400 | - '', |
|
401 | - 'remove_locks', |
|
402 | - '', |
|
403 | - 0, |
|
404 | - 20, |
|
405 | - '' |
|
406 | - ); |
|
394 | + $sitemenu['remove_locks'] = array( |
|
395 | + 'remove_locks', |
|
396 | + 'tools', |
|
397 | + '<i class="fa fa-hourglass"></i>' . $_lang['remove_locks'], |
|
398 | + 'javascript:modx.removeLocks();', |
|
399 | + $_lang['remove_locks'], |
|
400 | + '', |
|
401 | + 'remove_locks', |
|
402 | + '', |
|
403 | + 0, |
|
404 | + 20, |
|
405 | + '' |
|
406 | + ); |
|
407 | 407 | } |
408 | 408 | |
409 | 409 | if($modx->hasPermission('import_static')) { |
410 | - $sitemenu['import_site'] = array( |
|
411 | - 'import_site', |
|
412 | - 'tools', |
|
413 | - '<i class="fa fa-upload"></i>' . $_lang['import_site'], |
|
414 | - 'index.php?a=95', |
|
415 | - $_lang['import_site'], |
|
416 | - '', |
|
417 | - 'import_static', |
|
418 | - 'main', |
|
419 | - 0, |
|
420 | - 30, |
|
421 | - '' |
|
422 | - ); |
|
410 | + $sitemenu['import_site'] = array( |
|
411 | + 'import_site', |
|
412 | + 'tools', |
|
413 | + '<i class="fa fa-upload"></i>' . $_lang['import_site'], |
|
414 | + 'index.php?a=95', |
|
415 | + $_lang['import_site'], |
|
416 | + '', |
|
417 | + 'import_static', |
|
418 | + 'main', |
|
419 | + 0, |
|
420 | + 30, |
|
421 | + '' |
|
422 | + ); |
|
423 | 423 | } |
424 | 424 | |
425 | 425 | if($modx->hasPermission('export_static')) { |
426 | - $sitemenu['export_site'] = array( |
|
427 | - 'export_site', |
|
428 | - 'tools', |
|
429 | - '<i class="fa fa-download"></i>' . $_lang['export_site'], |
|
430 | - 'index.php?a=83', |
|
431 | - $_lang['export_site'], |
|
432 | - '', |
|
433 | - 'export_static', |
|
434 | - 'main', |
|
435 | - 1, |
|
436 | - 40, |
|
437 | - '' |
|
438 | - ); |
|
426 | + $sitemenu['export_site'] = array( |
|
427 | + 'export_site', |
|
428 | + 'tools', |
|
429 | + '<i class="fa fa-download"></i>' . $_lang['export_site'], |
|
430 | + 'index.php?a=83', |
|
431 | + $_lang['export_site'], |
|
432 | + '', |
|
433 | + 'export_static', |
|
434 | + 'main', |
|
435 | + 1, |
|
436 | + 40, |
|
437 | + '' |
|
438 | + ); |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | $menu = $modx->invokeEvent("OnManagerMenuPrerender", array('menu' => $sitemenu)); |
442 | 442 | if(is_array($menu)) { |
443 | - $newmenu = array(); |
|
444 | - foreach($menu as $item){ |
|
445 | - if(is_array(unserialize($item))){ |
|
446 | - $newmenu = array_merge($newmenu, unserialize($item)); |
|
447 | - } |
|
448 | - } |
|
449 | - if(count($newmenu)> 0) $sitemenu = $newmenu; |
|
443 | + $newmenu = array(); |
|
444 | + foreach($menu as $item){ |
|
445 | + if(is_array(unserialize($item))){ |
|
446 | + $newmenu = array_merge($newmenu, unserialize($item)); |
|
447 | + } |
|
448 | + } |
|
449 | + if(count($newmenu)> 0) $sitemenu = $newmenu; |
|
450 | 450 | } |
451 | 451 | |
452 | 452 | if(file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) { |
453 | - include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php'); |
|
453 | + include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php'); |
|
454 | 454 | } else { |
455 | - include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php'); |
|
455 | + include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php'); |
|
456 | 456 | } |
457 | 457 | $menu = new EVOmenu(); |
458 | 458 | $menu->Build($sitemenu, array( |
459 | - 'outerClass' => 'nav', |
|
460 | - 'innerClass' => 'dropdown-menu', |
|
461 | - 'parentClass' => 'dropdown', |
|
459 | + 'outerClass' => 'nav', |
|
460 | + 'innerClass' => 'dropdown-menu', |
|
461 | + 'parentClass' => 'dropdown', |
|
462 | 462 | 'parentLinkClass' => 'dropdown-toggle', |
463 | 463 | 'parentLinkAttr' => '', |
464 | 464 | 'parentLinkIn' => '' |
@@ -13,159 +13,159 @@ discard block |
||
13 | 13 | * @return string |
14 | 14 | */ |
15 | 15 | function renderFormElement($field_type, $field_id, $default_text = '', $field_elements = '', $field_value = '', $field_style = '', $row = array(), $tvsArray = array()) { |
16 | - global $modx; |
|
17 | - global $_style; |
|
18 | - global $_lang; |
|
19 | - global $content; |
|
20 | - global $which_browser; |
|
16 | + global $modx; |
|
17 | + global $_style; |
|
18 | + global $_lang; |
|
19 | + global $content; |
|
20 | + global $which_browser; |
|
21 | 21 | |
22 | - if(substr($default_text, 0, 6) === '@@EVAL' && $field_value === $default_text) { |
|
23 | - $eval_str = trim(substr($default_text, 7)); |
|
24 | - $default_text = eval($eval_str); |
|
25 | - $field_value = $default_text; |
|
26 | - } |
|
22 | + if(substr($default_text, 0, 6) === '@@EVAL' && $field_value === $default_text) { |
|
23 | + $eval_str = trim(substr($default_text, 7)); |
|
24 | + $default_text = eval($eval_str); |
|
25 | + $field_value = $default_text; |
|
26 | + } |
|
27 | 27 | |
28 | - $field_html = ''; |
|
29 | - $cimode = strpos($field_type, ':'); |
|
30 | - if($cimode === false) { |
|
31 | - switch($field_type) { |
|
28 | + $field_html = ''; |
|
29 | + $cimode = strpos($field_type, ':'); |
|
30 | + if($cimode === false) { |
|
31 | + switch($field_type) { |
|
32 | 32 | |
33 | - case "text": // handler for regular text boxes |
|
34 | - case "rawtext"; // non-htmlentity converted text boxes |
|
35 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%" />'; |
|
36 | - break; |
|
37 | - case "email": // handles email input fields |
|
38 | - $field_html .= '<input type="email" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%"/>'; |
|
39 | - break; |
|
40 | - case "number": // handles the input of numbers |
|
41 | - $field_html .= '<input type="number" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%" onkeyup="this.value=this.value.replace(/[^\d-,.+]/,\'\')"/>'; |
|
42 | - break; |
|
43 | - case "textareamini": // handler for textarea mini boxes |
|
44 | - $field_html .= '<textarea id="tv' . $field_id . '" name="tv' . $field_id . '" cols="40" rows="5" onchange="documentDirty=true;" style="width:100%">' . $modx->htmlspecialchars($field_value) . '</textarea>'; |
|
45 | - break; |
|
46 | - case "textarea": // handler for textarea boxes |
|
47 | - case "rawtextarea": // non-htmlentity convertex textarea boxes |
|
48 | - case "htmlarea": // handler for textarea boxes (deprecated) |
|
49 | - case "richtext": // handler for textarea boxes |
|
50 | - $field_html .= '<textarea id="tv' . $field_id . '" name="tv' . $field_id . '" cols="40" rows="15" onchange="documentDirty=true;" style="width:100%">' . $modx->htmlspecialchars($field_value) . '</textarea>'; |
|
51 | - break; |
|
52 | - case "date": |
|
53 | - $field_id = str_replace(array( |
|
54 | - '-', |
|
55 | - '.' |
|
56 | - ), '_', urldecode($field_id)); |
|
57 | - if($field_value == '') { |
|
58 | - $field_value = 0; |
|
59 | - } |
|
60 | - $field_html .= '<input id="tv' . $field_id . '" name="tv' . $field_id . '" class="DatePicker" type="text" value="' . ($field_value == 0 || !isset($field_value) ? "" : $field_value) . '" onblur="documentDirty=true;" />'; |
|
61 | - $field_html .= ' <a onclick="document.forms[\'mutate\'].elements[\'tv' . $field_id . '\'].value=\'\';document.forms[\'mutate\'].elements[\'tv' . $field_id . '\'].onblur(); return true;" onmouseover="window.status=\'clear the date\'; return true;" onmouseout="window.status=\'\'; return true;" style="cursor:pointer; cursor:hand"><i class="' . $_style["actions_calendar_delete"] . '"></i></a>'; |
|
33 | + case "text": // handler for regular text boxes |
|
34 | + case "rawtext"; // non-htmlentity converted text boxes |
|
35 | + $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%" />'; |
|
36 | + break; |
|
37 | + case "email": // handles email input fields |
|
38 | + $field_html .= '<input type="email" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%"/>'; |
|
39 | + break; |
|
40 | + case "number": // handles the input of numbers |
|
41 | + $field_html .= '<input type="number" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%" onkeyup="this.value=this.value.replace(/[^\d-,.+]/,\'\')"/>'; |
|
42 | + break; |
|
43 | + case "textareamini": // handler for textarea mini boxes |
|
44 | + $field_html .= '<textarea id="tv' . $field_id . '" name="tv' . $field_id . '" cols="40" rows="5" onchange="documentDirty=true;" style="width:100%">' . $modx->htmlspecialchars($field_value) . '</textarea>'; |
|
45 | + break; |
|
46 | + case "textarea": // handler for textarea boxes |
|
47 | + case "rawtextarea": // non-htmlentity convertex textarea boxes |
|
48 | + case "htmlarea": // handler for textarea boxes (deprecated) |
|
49 | + case "richtext": // handler for textarea boxes |
|
50 | + $field_html .= '<textarea id="tv' . $field_id . '" name="tv' . $field_id . '" cols="40" rows="15" onchange="documentDirty=true;" style="width:100%">' . $modx->htmlspecialchars($field_value) . '</textarea>'; |
|
51 | + break; |
|
52 | + case "date": |
|
53 | + $field_id = str_replace(array( |
|
54 | + '-', |
|
55 | + '.' |
|
56 | + ), '_', urldecode($field_id)); |
|
57 | + if($field_value == '') { |
|
58 | + $field_value = 0; |
|
59 | + } |
|
60 | + $field_html .= '<input id="tv' . $field_id . '" name="tv' . $field_id . '" class="DatePicker" type="text" value="' . ($field_value == 0 || !isset($field_value) ? "" : $field_value) . '" onblur="documentDirty=true;" />'; |
|
61 | + $field_html .= ' <a onclick="document.forms[\'mutate\'].elements[\'tv' . $field_id . '\'].value=\'\';document.forms[\'mutate\'].elements[\'tv' . $field_id . '\'].onblur(); return true;" onmouseover="window.status=\'clear the date\'; return true;" onmouseout="window.status=\'\'; return true;" style="cursor:pointer; cursor:hand"><i class="' . $_style["actions_calendar_delete"] . '"></i></a>'; |
|
62 | 62 | |
63 | - break; |
|
64 | - case "dropdown": // handler for select boxes |
|
65 | - $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '" size="1" onchange="documentDirty=true;">'; |
|
66 | - $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); |
|
67 | - while(list($item, $itemvalue) = each($index_list)) { |
|
68 | - list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue); |
|
69 | - if(strlen($itemvalue) == 0) { |
|
70 | - $itemvalue = $item; |
|
71 | - } |
|
72 | - $field_html .= '<option value="' . $modx->htmlspecialchars($itemvalue) . '"' . ($itemvalue == $field_value ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($item) . '</option>'; |
|
73 | - } |
|
74 | - $field_html .= "</select>"; |
|
75 | - break; |
|
76 | - case "listbox": // handler for select boxes |
|
77 | - $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '" onchange="documentDirty=true;" size="8">'; |
|
78 | - $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); |
|
79 | - while(list($item, $itemvalue) = each($index_list)) { |
|
80 | - list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue); |
|
81 | - if(strlen($itemvalue) == 0) { |
|
82 | - $itemvalue = $item; |
|
83 | - } |
|
84 | - $field_html .= '<option value="' . $modx->htmlspecialchars($itemvalue) . '"' . ($itemvalue == $field_value ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($item) . '</option>'; |
|
85 | - } |
|
86 | - $field_html .= "</select>"; |
|
87 | - break; |
|
88 | - case "listbox-multiple": // handler for select boxes where you can choose multiple items |
|
89 | - $field_value = explode("||", $field_value); |
|
90 | - $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '[]" multiple="multiple" onchange="documentDirty=true;" size="8">'; |
|
91 | - $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); |
|
92 | - while(list($item, $itemvalue) = each($index_list)) { |
|
93 | - list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue); |
|
94 | - if(strlen($itemvalue) == 0) { |
|
95 | - $itemvalue = $item; |
|
96 | - } |
|
97 | - $field_html .= '<option value="' . $modx->htmlspecialchars($itemvalue) . '"' . (in_array($itemvalue, $field_value) ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($item) . '</option>'; |
|
98 | - } |
|
99 | - $field_html .= "</select>"; |
|
100 | - break; |
|
101 | - case "url": // handles url input fields |
|
102 | - $urls = array( |
|
103 | - '' => '--', |
|
104 | - 'http://' => 'http://', |
|
105 | - 'https://' => 'https://', |
|
106 | - 'ftp://' => 'ftp://', |
|
107 | - 'mailto:' => 'mailto:' |
|
108 | - ); |
|
109 | - $field_html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td><select id="tv' . $field_id . '_prefix" name="tv' . $field_id . '_prefix" onchange="documentDirty=true;">'; |
|
110 | - foreach($urls as $k => $v) { |
|
111 | - if(strpos($field_value, $v) === false) { |
|
112 | - $field_html .= '<option value="' . $v . '">' . $k . '</option>'; |
|
113 | - } else { |
|
114 | - $field_value = str_replace($v, '', $field_value); |
|
115 | - $field_html .= '<option value="' . $v . '" selected="selected">' . $k . '</option>'; |
|
116 | - } |
|
117 | - } |
|
118 | - $field_html .= '</select></td><td>'; |
|
119 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" width="100" ' . $field_style . ' onchange="documentDirty=true;" /></td></tr></table>'; |
|
120 | - break; |
|
121 | - case 'checkbox': // handles check boxes |
|
122 | - $values = !is_array($field_value) ? explode('||', $field_value) : $field_value; |
|
123 | - $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); |
|
124 | - $tpl = '<label class="checkbox"><input type="checkbox" value="%s" id="tv_%s" name="tv%s[]" %s onchange="documentDirty=true;" />%s</label><br />'; |
|
125 | - static $i = 0; |
|
126 | - $_ = array(); |
|
127 | - foreach($index_list as $c => $item) { |
|
128 | - if(is_array($item)) { |
|
129 | - $name = trim($item[0]); |
|
130 | - $value = isset($item[1]) ? $item[1] : $name; |
|
131 | - } else { |
|
132 | - $item = trim($item); |
|
133 | - list($name, $value) = (strpos($item, '==') !== false) ? explode('==', $item, 2) : array( |
|
134 | - $item, |
|
135 | - $item |
|
136 | - ); |
|
137 | - } |
|
138 | - $checked = in_array($value, $values) ? ' checked="checked"' : ''; |
|
139 | - $param = array( |
|
140 | - $modx->htmlspecialchars($value), |
|
141 | - $i, |
|
142 | - $field_id, |
|
143 | - $checked, |
|
144 | - $name |
|
145 | - ); |
|
146 | - $_[] = vsprintf($tpl, $param); |
|
147 | - $i++; |
|
148 | - } |
|
149 | - $field_html = implode("\n", $_); |
|
150 | - break; |
|
151 | - case "option": // handles radio buttons |
|
152 | - $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); |
|
153 | - static $i = 0; |
|
154 | - while(list($item, $itemvalue) = each($index_list)) { |
|
155 | - list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue); |
|
156 | - if(strlen($itemvalue) == 0) { |
|
157 | - $itemvalue = $item; |
|
158 | - } |
|
159 | - $field_html .= '<input type="radio" value="' . $modx->htmlspecialchars($itemvalue) . '" id="tv_' . $i . '" name="tv' . $field_id . '" ' . ($itemvalue == $field_value ? 'checked="checked"' : '') . ' onchange="documentDirty=true;" /><label for="tv_' . $i . '" class="radio">' . $item . '</label><br />'; |
|
160 | - $i++; |
|
161 | - } |
|
162 | - break; |
|
163 | - case "image": // handles image fields using htmlarea image manager |
|
164 | - global $_lang; |
|
165 | - global $ResourceManagerLoaded; |
|
166 | - global $content, $use_editor, $which_editor; |
|
167 | - if(!$ResourceManagerLoaded && !(($content['richtext'] == 1 || $modx->manager->action == 4) && $use_editor == 1 && $which_editor == 3)) { |
|
168 | - $field_html .= " |
|
63 | + break; |
|
64 | + case "dropdown": // handler for select boxes |
|
65 | + $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '" size="1" onchange="documentDirty=true;">'; |
|
66 | + $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); |
|
67 | + while(list($item, $itemvalue) = each($index_list)) { |
|
68 | + list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue); |
|
69 | + if(strlen($itemvalue) == 0) { |
|
70 | + $itemvalue = $item; |
|
71 | + } |
|
72 | + $field_html .= '<option value="' . $modx->htmlspecialchars($itemvalue) . '"' . ($itemvalue == $field_value ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($item) . '</option>'; |
|
73 | + } |
|
74 | + $field_html .= "</select>"; |
|
75 | + break; |
|
76 | + case "listbox": // handler for select boxes |
|
77 | + $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '" onchange="documentDirty=true;" size="8">'; |
|
78 | + $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); |
|
79 | + while(list($item, $itemvalue) = each($index_list)) { |
|
80 | + list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue); |
|
81 | + if(strlen($itemvalue) == 0) { |
|
82 | + $itemvalue = $item; |
|
83 | + } |
|
84 | + $field_html .= '<option value="' . $modx->htmlspecialchars($itemvalue) . '"' . ($itemvalue == $field_value ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($item) . '</option>'; |
|
85 | + } |
|
86 | + $field_html .= "</select>"; |
|
87 | + break; |
|
88 | + case "listbox-multiple": // handler for select boxes where you can choose multiple items |
|
89 | + $field_value = explode("||", $field_value); |
|
90 | + $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '[]" multiple="multiple" onchange="documentDirty=true;" size="8">'; |
|
91 | + $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); |
|
92 | + while(list($item, $itemvalue) = each($index_list)) { |
|
93 | + list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue); |
|
94 | + if(strlen($itemvalue) == 0) { |
|
95 | + $itemvalue = $item; |
|
96 | + } |
|
97 | + $field_html .= '<option value="' . $modx->htmlspecialchars($itemvalue) . '"' . (in_array($itemvalue, $field_value) ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($item) . '</option>'; |
|
98 | + } |
|
99 | + $field_html .= "</select>"; |
|
100 | + break; |
|
101 | + case "url": // handles url input fields |
|
102 | + $urls = array( |
|
103 | + '' => '--', |
|
104 | + 'http://' => 'http://', |
|
105 | + 'https://' => 'https://', |
|
106 | + 'ftp://' => 'ftp://', |
|
107 | + 'mailto:' => 'mailto:' |
|
108 | + ); |
|
109 | + $field_html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td><select id="tv' . $field_id . '_prefix" name="tv' . $field_id . '_prefix" onchange="documentDirty=true;">'; |
|
110 | + foreach($urls as $k => $v) { |
|
111 | + if(strpos($field_value, $v) === false) { |
|
112 | + $field_html .= '<option value="' . $v . '">' . $k . '</option>'; |
|
113 | + } else { |
|
114 | + $field_value = str_replace($v, '', $field_value); |
|
115 | + $field_html .= '<option value="' . $v . '" selected="selected">' . $k . '</option>'; |
|
116 | + } |
|
117 | + } |
|
118 | + $field_html .= '</select></td><td>'; |
|
119 | + $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" width="100" ' . $field_style . ' onchange="documentDirty=true;" /></td></tr></table>'; |
|
120 | + break; |
|
121 | + case 'checkbox': // handles check boxes |
|
122 | + $values = !is_array($field_value) ? explode('||', $field_value) : $field_value; |
|
123 | + $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); |
|
124 | + $tpl = '<label class="checkbox"><input type="checkbox" value="%s" id="tv_%s" name="tv%s[]" %s onchange="documentDirty=true;" />%s</label><br />'; |
|
125 | + static $i = 0; |
|
126 | + $_ = array(); |
|
127 | + foreach($index_list as $c => $item) { |
|
128 | + if(is_array($item)) { |
|
129 | + $name = trim($item[0]); |
|
130 | + $value = isset($item[1]) ? $item[1] : $name; |
|
131 | + } else { |
|
132 | + $item = trim($item); |
|
133 | + list($name, $value) = (strpos($item, '==') !== false) ? explode('==', $item, 2) : array( |
|
134 | + $item, |
|
135 | + $item |
|
136 | + ); |
|
137 | + } |
|
138 | + $checked = in_array($value, $values) ? ' checked="checked"' : ''; |
|
139 | + $param = array( |
|
140 | + $modx->htmlspecialchars($value), |
|
141 | + $i, |
|
142 | + $field_id, |
|
143 | + $checked, |
|
144 | + $name |
|
145 | + ); |
|
146 | + $_[] = vsprintf($tpl, $param); |
|
147 | + $i++; |
|
148 | + } |
|
149 | + $field_html = implode("\n", $_); |
|
150 | + break; |
|
151 | + case "option": // handles radio buttons |
|
152 | + $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); |
|
153 | + static $i = 0; |
|
154 | + while(list($item, $itemvalue) = each($index_list)) { |
|
155 | + list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue); |
|
156 | + if(strlen($itemvalue) == 0) { |
|
157 | + $itemvalue = $item; |
|
158 | + } |
|
159 | + $field_html .= '<input type="radio" value="' . $modx->htmlspecialchars($itemvalue) . '" id="tv_' . $i . '" name="tv' . $field_id . '" ' . ($itemvalue == $field_value ? 'checked="checked"' : '') . ' onchange="documentDirty=true;" /><label for="tv_' . $i . '" class="radio">' . $item . '</label><br />'; |
|
160 | + $i++; |
|
161 | + } |
|
162 | + break; |
|
163 | + case "image": // handles image fields using htmlarea image manager |
|
164 | + global $_lang; |
|
165 | + global $ResourceManagerLoaded; |
|
166 | + global $content, $use_editor, $which_editor; |
|
167 | + if(!$ResourceManagerLoaded && !(($content['richtext'] == 1 || $modx->manager->action == 4) && $use_editor == 1 && $which_editor == 3)) { |
|
168 | + $field_html .= " |
|
169 | 169 | <script type=\"text/javascript\"> |
170 | 170 | /* <![CDATA[ */ |
171 | 171 | var lastImageCtrl; |
@@ -224,18 +224,18 @@ discard block |
||
224 | 224 | } |
225 | 225 | /* ]]> */ |
226 | 226 | </script>"; |
227 | - $ResourceManagerLoaded = true; |
|
228 | - } |
|
229 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $field_value . '" ' . $field_style . ' onchange="documentDirty=true;" /><input type="button" value="' . $_lang['insert'] . '" onclick="BrowseServer(\'tv' . $field_id . '\')" />'; |
|
230 | - break; |
|
231 | - case "file": // handles the input of file uploads |
|
232 | - /* Modified by Timon for use with resource browser */ |
|
233 | - global $_lang; |
|
234 | - global $ResourceManagerLoaded; |
|
235 | - global $content, $use_editor, $which_editor; |
|
236 | - if(!$ResourceManagerLoaded && !(($content['richtext'] == 1 || $modx->manager->action == 4) && $use_editor == 1 && $which_editor == 3)) { |
|
237 | - /* I didn't understand the meaning of the condition above, so I left it untouched ;-) */ |
|
238 | - $field_html .= " |
|
227 | + $ResourceManagerLoaded = true; |
|
228 | + } |
|
229 | + $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $field_value . '" ' . $field_style . ' onchange="documentDirty=true;" /><input type="button" value="' . $_lang['insert'] . '" onclick="BrowseServer(\'tv' . $field_id . '\')" />'; |
|
230 | + break; |
|
231 | + case "file": // handles the input of file uploads |
|
232 | + /* Modified by Timon for use with resource browser */ |
|
233 | + global $_lang; |
|
234 | + global $ResourceManagerLoaded; |
|
235 | + global $content, $use_editor, $which_editor; |
|
236 | + if(!$ResourceManagerLoaded && !(($content['richtext'] == 1 || $modx->manager->action == 4) && $use_editor == 1 && $which_editor == 3)) { |
|
237 | + /* I didn't understand the meaning of the condition above, so I left it untouched ;-) */ |
|
238 | + $field_html .= " |
|
239 | 239 | <script type=\"text/javascript\"> |
240 | 240 | /* <![CDATA[ */ |
241 | 241 | var lastImageCtrl; |
@@ -294,90 +294,90 @@ discard block |
||
294 | 294 | } |
295 | 295 | /* ]]> */ |
296 | 296 | </script>"; |
297 | - $ResourceManagerLoaded = true; |
|
298 | - } |
|
299 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $field_value . '" ' . $field_style . ' onchange="documentDirty=true;" /><input type="button" value="' . $_lang['insert'] . '" onclick="BrowseFileServer(\'tv' . $field_id . '\')" />'; |
|
297 | + $ResourceManagerLoaded = true; |
|
298 | + } |
|
299 | + $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $field_value . '" ' . $field_style . ' onchange="documentDirty=true;" /><input type="button" value="' . $_lang['insert'] . '" onclick="BrowseFileServer(\'tv' . $field_id . '\')" />'; |
|
300 | 300 | |
301 | - break; |
|
301 | + break; |
|
302 | 302 | |
303 | - case 'custom_tv': |
|
304 | - $custom_output = ''; |
|
305 | - /* If we are loading a file */ |
|
306 | - if(substr($field_elements, 0, 5) == "@FILE") { |
|
307 | - $file_name = MODX_BASE_PATH . trim(substr($field_elements, 6)); |
|
308 | - if(!file_exists($file_name)) { |
|
309 | - $custom_output = $file_name . ' does not exist'; |
|
310 | - } else { |
|
311 | - $custom_output = file_get_contents($file_name); |
|
312 | - } |
|
313 | - } elseif(substr($field_elements, 0, 8) == '@INCLUDE') { |
|
314 | - $file_name = MODX_BASE_PATH . trim(substr($field_elements, 9)); |
|
315 | - if(!file_exists($file_name)) { |
|
316 | - $custom_output = $file_name . ' does not exist'; |
|
317 | - } else { |
|
318 | - ob_start(); |
|
319 | - include $file_name; |
|
320 | - $custom_output = ob_get_contents(); |
|
321 | - ob_end_clean(); |
|
322 | - } |
|
323 | - } elseif(substr($field_elements, 0, 6) == "@CHUNK") { |
|
324 | - $chunk_name = trim(substr($field_elements, 7)); |
|
325 | - $chunk_body = $modx->getChunk($chunk_name); |
|
326 | - if($chunk_body == false) { |
|
327 | - $custom_output = $_lang['chunk_no_exist'] . '(' . $_lang['htmlsnippet_name'] . ':' . $chunk_name . ')'; |
|
328 | - } else { |
|
329 | - $custom_output = $chunk_body; |
|
330 | - } |
|
331 | - } elseif(substr($field_elements, 0, 5) == "@EVAL") { |
|
332 | - $eval_str = trim(substr($field_elements, 6)); |
|
333 | - $custom_output = eval($eval_str); |
|
334 | - } else { |
|
335 | - $custom_output = $field_elements; |
|
336 | - } |
|
337 | - $replacements = array( |
|
338 | - '[+field_type+]' => $field_type, |
|
339 | - '[+field_id+]' => $field_id, |
|
340 | - '[+default_text+]' => $default_text, |
|
341 | - '[+field_value+]' => $modx->htmlspecialchars($field_value), |
|
342 | - '[+field_style+]' => $field_style, |
|
343 | - ); |
|
344 | - $custom_output = str_replace(array_keys($replacements), $replacements, $custom_output); |
|
345 | - $modx->documentObject = $content; |
|
346 | - $modx->documentIdentifier = $content['id']; |
|
347 | - $custom_output = $modx->parseDocumentSource($custom_output); |
|
348 | - $field_html .= $custom_output; |
|
349 | - break; |
|
303 | + case 'custom_tv': |
|
304 | + $custom_output = ''; |
|
305 | + /* If we are loading a file */ |
|
306 | + if(substr($field_elements, 0, 5) == "@FILE") { |
|
307 | + $file_name = MODX_BASE_PATH . trim(substr($field_elements, 6)); |
|
308 | + if(!file_exists($file_name)) { |
|
309 | + $custom_output = $file_name . ' does not exist'; |
|
310 | + } else { |
|
311 | + $custom_output = file_get_contents($file_name); |
|
312 | + } |
|
313 | + } elseif(substr($field_elements, 0, 8) == '@INCLUDE') { |
|
314 | + $file_name = MODX_BASE_PATH . trim(substr($field_elements, 9)); |
|
315 | + if(!file_exists($file_name)) { |
|
316 | + $custom_output = $file_name . ' does not exist'; |
|
317 | + } else { |
|
318 | + ob_start(); |
|
319 | + include $file_name; |
|
320 | + $custom_output = ob_get_contents(); |
|
321 | + ob_end_clean(); |
|
322 | + } |
|
323 | + } elseif(substr($field_elements, 0, 6) == "@CHUNK") { |
|
324 | + $chunk_name = trim(substr($field_elements, 7)); |
|
325 | + $chunk_body = $modx->getChunk($chunk_name); |
|
326 | + if($chunk_body == false) { |
|
327 | + $custom_output = $_lang['chunk_no_exist'] . '(' . $_lang['htmlsnippet_name'] . ':' . $chunk_name . ')'; |
|
328 | + } else { |
|
329 | + $custom_output = $chunk_body; |
|
330 | + } |
|
331 | + } elseif(substr($field_elements, 0, 5) == "@EVAL") { |
|
332 | + $eval_str = trim(substr($field_elements, 6)); |
|
333 | + $custom_output = eval($eval_str); |
|
334 | + } else { |
|
335 | + $custom_output = $field_elements; |
|
336 | + } |
|
337 | + $replacements = array( |
|
338 | + '[+field_type+]' => $field_type, |
|
339 | + '[+field_id+]' => $field_id, |
|
340 | + '[+default_text+]' => $default_text, |
|
341 | + '[+field_value+]' => $modx->htmlspecialchars($field_value), |
|
342 | + '[+field_style+]' => $field_style, |
|
343 | + ); |
|
344 | + $custom_output = str_replace(array_keys($replacements), $replacements, $custom_output); |
|
345 | + $modx->documentObject = $content; |
|
346 | + $modx->documentIdentifier = $content['id']; |
|
347 | + $custom_output = $modx->parseDocumentSource($custom_output); |
|
348 | + $field_html .= $custom_output; |
|
349 | + break; |
|
350 | 350 | |
351 | - default: // the default handler -- for errors, mostly |
|
352 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" ' . $field_style . ' onchange="documentDirty=true;" />'; |
|
351 | + default: // the default handler -- for errors, mostly |
|
352 | + $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" ' . $field_style . ' onchange="documentDirty=true;" />'; |
|
353 | 353 | |
354 | - } // end switch statement |
|
355 | - } else { |
|
356 | - $custom = explode(":", $field_type); |
|
357 | - $custom_output = ''; |
|
358 | - $file_name = MODX_BASE_PATH . 'assets/tvs/' . $custom['1'] . '/' . $custom['1'] . '.customtv.php'; |
|
359 | - if(!file_exists($file_name)) { |
|
360 | - $custom_output = $file_name . ' does not exist'; |
|
361 | - } else { |
|
362 | - ob_start(); |
|
363 | - include $file_name; |
|
364 | - $custom_output = ob_get_contents(); |
|
365 | - ob_end_clean(); |
|
366 | - } |
|
367 | - $replacements = array( |
|
368 | - '[+field_type+]' => $field_type, |
|
369 | - '[+field_id+]' => $field_id, |
|
370 | - '[+default_text+]' => $default_text, |
|
371 | - '[+field_value+]' => $modx->htmlspecialchars($field_value), |
|
372 | - '[+field_style+]' => $field_style, |
|
373 | - ); |
|
374 | - $custom_output = str_replace(array_keys($replacements), $replacements, $custom_output); |
|
375 | - $modx->documentObject = $content; |
|
376 | - $custom_output = $modx->parseDocumentSource($custom_output); |
|
377 | - $field_html .= $custom_output; |
|
378 | - } |
|
354 | + } // end switch statement |
|
355 | + } else { |
|
356 | + $custom = explode(":", $field_type); |
|
357 | + $custom_output = ''; |
|
358 | + $file_name = MODX_BASE_PATH . 'assets/tvs/' . $custom['1'] . '/' . $custom['1'] . '.customtv.php'; |
|
359 | + if(!file_exists($file_name)) { |
|
360 | + $custom_output = $file_name . ' does not exist'; |
|
361 | + } else { |
|
362 | + ob_start(); |
|
363 | + include $file_name; |
|
364 | + $custom_output = ob_get_contents(); |
|
365 | + ob_end_clean(); |
|
366 | + } |
|
367 | + $replacements = array( |
|
368 | + '[+field_type+]' => $field_type, |
|
369 | + '[+field_id+]' => $field_id, |
|
370 | + '[+default_text+]' => $default_text, |
|
371 | + '[+field_value+]' => $modx->htmlspecialchars($field_value), |
|
372 | + '[+field_style+]' => $field_style, |
|
373 | + ); |
|
374 | + $custom_output = str_replace(array_keys($replacements), $replacements, $custom_output); |
|
375 | + $modx->documentObject = $content; |
|
376 | + $custom_output = $modx->parseDocumentSource($custom_output); |
|
377 | + $field_html .= $custom_output; |
|
378 | + } |
|
379 | 379 | |
380 | - return $field_html; |
|
380 | + return $field_html; |
|
381 | 381 | } // end renderFormElement function |
382 | 382 | |
383 | 383 | /** |
@@ -385,14 +385,14 @@ discard block |
||
385 | 385 | * @return array |
386 | 386 | */ |
387 | 387 | function ParseIntputOptions($v) { |
388 | - global $modx; |
|
389 | - $a = array(); |
|
390 | - if(is_array($v)) { |
|
391 | - return $v; |
|
392 | - } else if($modx->db->isResult($v)) { |
|
393 | - while($cols = $modx->db->getRow($v, 'num')) $a[] = $cols; |
|
394 | - } else { |
|
395 | - $a = explode("||", $v); |
|
396 | - } |
|
397 | - return $a; |
|
388 | + global $modx; |
|
389 | + $a = array(); |
|
390 | + if(is_array($v)) { |
|
391 | + return $v; |
|
392 | + } else if($modx->db->isResult($v)) { |
|
393 | + while($cols = $modx->db->getRow($v, 'num')) $a[] = $cols; |
|
394 | + } else { |
|
395 | + $a = explode("||", $v); |
|
396 | + } |
|
397 | + return $a; |
|
398 | 398 | } |
@@ -339,9 +339,9 @@ discard block |
||
339 | 339 | echo $_lang['failed'] . ' ' . $_lang['table_prefix_not_exist'] . PHP_EOL; |
340 | 340 | $errors++; |
341 | 341 | |
342 | - } else { |
|
342 | + } else { |
|
343 | 343 | echo $_lang['ok'] . PHP_EOL; |
344 | - } |
|
344 | + } |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | // check mysql version |
@@ -1162,7 +1162,7 @@ discard block |
||
1162 | 1162 | $tRow = mysqli_fetch_assoc($ts); |
1163 | 1163 | $templateId = $tRow['id']; |
1164 | 1164 | mysqli_query($sqlParser->conn, "INSERT INTO $dbase.`" . $table_prefix . "site_tmplvar_templates` (tmplvarid, templateid) VALUES($id, $templateId)"); |
1165 | - } |
|
1165 | + } |
|
1166 | 1166 | } |
1167 | 1167 | } |
1168 | 1168 | } |
@@ -1527,9 +1527,9 @@ discard block |
||
1527 | 1527 | echo PHP_EOL . $_lang['installation_successful'] . PHP_EOL . PHP_EOL; |
1528 | 1528 | //echo "<p>" . $_lang['to_log_into_content_manager'] . "</p>"; |
1529 | 1529 | if ($installMode == 0) { |
1530 | - echo strip_tags($_lang['installation_note']) . PHP_EOL; |
|
1530 | + echo strip_tags($_lang['installation_note']) . PHP_EOL; |
|
1531 | 1531 | } else { |
1532 | - echo strip_tags($_lang['upgrade_note']) . PHP_EOL; |
|
1532 | + echo strip_tags($_lang['upgrade_note']) . PHP_EOL; |
|
1533 | 1533 | } |
1534 | 1534 | |
1535 | 1535 |
@@ -46,16 +46,16 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | switch ($modx->config['manager_theme_mode']) { |
49 | - case '1': |
|
49 | + case '1': |
|
50 | 50 | $body_class .= ' lightness'; |
51 | 51 | break; |
52 | - case '2': |
|
52 | + case '2': |
|
53 | 53 | $body_class .= ' light'; |
54 | 54 | break; |
55 | - case '3': |
|
55 | + case '3': |
|
56 | 56 | $body_class .= ' dark'; |
57 | 57 | break; |
58 | - case '4': |
|
58 | + case '4': |
|
59 | 59 | $body_class .= ' darkness'; |
60 | 60 | break; |
61 | 61 | } |
@@ -247,9 +247,9 @@ discard block |
||
247 | 247 | lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE) . "\n" ?> |
248 | 248 | }; |
249 | 249 | <?php |
250 | - $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray']))); |
|
251 | - echo (empty($opened) ? '' : 'modx.openedArray[' . implode("] = 1;\n modx.openedArray[", $opened) . '] = 1;') . "\n"; |
|
252 | - ?> |
|
250 | + $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray']))); |
|
251 | + echo (empty($opened) ? '' : 'modx.openedArray[' . implode("] = 1;\n modx.openedArray[", $opened) . '] = 1;') . "\n"; |
|
252 | + ?> |
|
253 | 253 | </script> |
254 | 254 | <script src="media/style/<?= $modx->config['manager_theme'] ?>/js/modx.min.js?v=<?= $lastInstallTime ?>"></script> |
255 | 255 | <?php if ($modx->config['show_picker'] != "0") { ?> |
@@ -17,16 +17,16 @@ discard block |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | switch ($modx->config['manager_theme_mode']) { |
20 | - case '1': |
|
20 | + case '1': |
|
21 | 21 | $body_class .= ' lightness'; |
22 | 22 | break; |
23 | - case '2': |
|
23 | + case '2': |
|
24 | 24 | $body_class .= ' light'; |
25 | 25 | break; |
26 | - case '3': |
|
26 | + case '3': |
|
27 | 27 | $body_class .= ' dark'; |
28 | 28 | break; |
29 | - case '4': |
|
29 | + case '4': |
|
30 | 30 | $body_class .= ' darkness'; |
31 | 31 | break; |
32 | 32 | } |
@@ -374,10 +374,10 @@ discard block |
||
374 | 374 | stopWorker(); |
375 | 375 | |
376 | 376 | <?php |
377 | - if (isset($_REQUEST['r']) && preg_match('@^[0-9]+$@', $_REQUEST['r'])) { |
|
378 | - echo 'doRefresh(' . $_REQUEST['r'] . ");\n"; |
|
379 | - } |
|
380 | - ?> |
|
377 | + if (isset($_REQUEST['r']) && preg_match('@^[0-9]+$@', $_REQUEST['r'])) { |
|
378 | + echo 'doRefresh(' . $_REQUEST['r'] . ");\n"; |
|
379 | + } |
|
380 | + ?> |
|
381 | 381 | |
382 | 382 | var actionButtons = document.getElementById('actions'), actionSelect = document.getElementById('stay'); |
383 | 383 | if (actionButtons !== null && actionSelect !== null) { |
@@ -86,16 +86,16 @@ |
||
86 | 86 | $modx->setPlaceholder('year', date('Y')); |
87 | 87 | |
88 | 88 | switch ($modx->config['manager_theme_mode']) { |
89 | - case '1': |
|
89 | + case '1': |
|
90 | 90 | $modx->setPlaceholder('manager_theme_style', 'lightness'); |
91 | 91 | break; |
92 | - case '2': |
|
92 | + case '2': |
|
93 | 93 | $modx->setPlaceholder('manager_theme_style', 'light'); |
94 | 94 | break; |
95 | - case '3': |
|
95 | + case '3': |
|
96 | 96 | $modx->setPlaceholder('manager_theme_style', 'dark'); |
97 | 97 | break; |
98 | - case '4': |
|
98 | + case '4': |
|
99 | 99 | $modx->setPlaceholder('manager_theme_style', 'darkness'); |
100 | 100 | break; } |
101 | 101 |
@@ -113,31 +113,31 @@ |
||
113 | 113 | // Handle Input "Search in main fields" |
114 | 114 | if ($searchfields != '') { |
115 | 115 | |
116 | - /*start search by TV. Added Rising13*/ |
|
117 | - $tbl_site_tmplvar_contentvalues = $modx->getFullTableName('site_tmplvar_contentvalues'); |
|
118 | - $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'"; |
|
119 | - $articul_result = $modx->db->query($articul_query); |
|
120 | - $articul_id_array = $modx->db->makeArray($articul_result); |
|
121 | - if(count($articul_id_array)>0){ |
|
122 | - $articul_id = ''; |
|
123 | - $i = 1; |
|
124 | - foreach( $articul_id_array as $articul ) { |
|
125 | - $articul_id.=$articul['contentid']; |
|
126 | - if($i !== count($articul_id_array)){ |
|
127 | - $articul_id.=','; |
|
128 | - } |
|
129 | - $i++; |
|
130 | - } |
|
131 | - $articul_id_query = " OR sc.id IN ({$articul_id})"; |
|
132 | - }else{ |
|
133 | - $articul_id_query = ''; |
|
134 | - } |
|
135 | - /*end search by TV*/ |
|
116 | + /*start search by TV. Added Rising13*/ |
|
117 | + $tbl_site_tmplvar_contentvalues = $modx->getFullTableName('site_tmplvar_contentvalues'); |
|
118 | + $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'"; |
|
119 | + $articul_result = $modx->db->query($articul_query); |
|
120 | + $articul_id_array = $modx->db->makeArray($articul_result); |
|
121 | + if(count($articul_id_array)>0){ |
|
122 | + $articul_id = ''; |
|
123 | + $i = 1; |
|
124 | + foreach( $articul_id_array as $articul ) { |
|
125 | + $articul_id.=$articul['contentid']; |
|
126 | + if($i !== count($articul_id_array)){ |
|
127 | + $articul_id.=','; |
|
128 | + } |
|
129 | + $i++; |
|
130 | + } |
|
131 | + $articul_id_query = " OR sc.id IN ({$articul_id})"; |
|
132 | + }else{ |
|
133 | + $articul_id_query = ''; |
|
134 | + } |
|
135 | + /*end search by TV*/ |
|
136 | 136 | |
137 | 137 | if (ctype_digit($searchfields)) { |
138 | 138 | $sqladd .= "sc.id='{$searchfields}'"; |
139 | 139 | if (strlen($searchfields) > 3) { |
140 | - $sqladd .= $articul_id_query;//search by TV |
|
140 | + $sqladd .= $articul_id_query;//search by TV |
|
141 | 141 | $sqladd .= " OR sc.pagetitle LIKE '%{$searchfields}%'"; |
142 | 142 | } |
143 | 143 | } |