1
|
|
|
<?php |
2
|
|
|
/* Copyright (C) XEHub <https://www.xehub.io> */ |
3
|
|
|
|
4
|
|
|
class HTMLDisplayHandler |
5
|
|
|
{ |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Produce HTML compliant content given a module object.\n |
9
|
|
|
* @param ModuleObject $oModule the module object |
10
|
|
|
* @return string compiled template string |
11
|
|
|
*/ |
12
|
|
|
function toDoc(&$oModule) |
13
|
|
|
{ |
14
|
|
|
$oTemplate = TemplateHandler::getInstance(); |
15
|
|
|
|
16
|
|
|
// SECISSUE https://github.com/xpressengine/xe-core/issues/1583 |
17
|
|
|
$oSecurity = new Security(); |
18
|
|
|
$oSecurity->encodeHTML('is_keyword', 'search_keyword', 'search_target', 'order_target', 'order_type'); |
19
|
|
|
|
20
|
|
|
$template_path = $oModule->getTemplatePath(); |
21
|
|
|
|
22
|
|
|
if(!is_dir($template_path)) |
23
|
|
|
{ |
24
|
|
|
if($oModule->module_info->module == $oModule->module) |
25
|
|
|
{ |
26
|
|
|
$skin = $oModule->origin_module_info->skin; |
27
|
|
|
} |
28
|
|
|
else |
29
|
|
|
{ |
30
|
|
|
$skin = $oModule->module_config->skin; |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
if(Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') === false) |
34
|
|
|
{ |
35
|
|
|
if($skin && is_string($skin)) |
36
|
|
|
{ |
37
|
|
|
$theme_skin = explode('|@|', $skin); |
38
|
|
|
$template_path = $oModule->getTemplatePath(); |
39
|
|
|
if(count($theme_skin) == 2) |
40
|
|
|
{ |
41
|
|
|
$theme_path = sprintf('./themes/%s', $theme_skin[0]); |
42
|
|
|
// FIXME $theme_path $theme_path $theme_path ?? |
43
|
|
|
if(substr($theme_path, 0, strlen($theme_path)) != $theme_path) |
44
|
|
|
{ |
45
|
|
|
$template_path = sprintf('%s/modules/%s/', $theme_path, $theme_skin[1]); |
46
|
|
|
} |
47
|
|
|
} |
48
|
|
|
} |
49
|
|
|
else |
50
|
|
|
{ |
51
|
|
|
$template_path = $oModule->getTemplatePath(); |
52
|
|
|
} |
53
|
|
|
} |
54
|
|
|
else |
55
|
|
|
{ |
56
|
|
|
$template_path = $oModule->getTemplatePath(); |
57
|
|
|
} |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
$tpl_file = $oModule->getTemplateFile(); |
61
|
|
|
$output = $oTemplate->compile($template_path, $tpl_file); |
62
|
|
|
|
63
|
|
|
// add .x div for adminitration pages |
64
|
|
|
if(Context::getResponseMethod() == 'HTML') |
65
|
|
|
{ |
66
|
|
|
if(Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') > 0 && Context::get('act') != 'dispPageAdminContentModify' && Context::get('act') != 'dispPageAdminMobileContentModify') |
67
|
|
|
{ |
68
|
|
|
$output = '<div class="x">' . $output . '</div>'; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
if(Context::get('layout') != 'none') |
72
|
|
|
{ |
73
|
|
|
if(__DEBUG__ == 3) |
74
|
|
|
{ |
75
|
|
|
$start = getMicroTime(); |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
Context::set('content', $output, false); |
|
|
|
|
79
|
|
|
|
80
|
|
|
$layout_path = $oModule->getLayoutPath(); |
81
|
|
|
$layout_file = $oModule->getLayoutFile(); |
82
|
|
|
|
83
|
|
|
$edited_layout_file = $oModule->getEditedLayoutFile(); |
84
|
|
|
|
85
|
|
|
// get the layout information currently requested |
86
|
|
|
$oLayoutModel = getModel('layout'); |
87
|
|
|
$layout_info = Context::get('layout_info'); |
88
|
|
|
$layout_srl = $layout_info->layout_srl; |
89
|
|
|
|
90
|
|
|
// compile if connected to the layout |
91
|
|
|
if($layout_srl > 0) |
92
|
|
|
{ |
93
|
|
|
|
94
|
|
|
// handle separately if the layout is faceoff |
95
|
|
|
if($layout_info && $layout_info->type == 'faceoff') |
96
|
|
|
{ |
97
|
|
|
$oLayoutModel->doActivateFaceOff($layout_info); |
98
|
|
|
Context::set('layout_info', $layout_info); |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
// search if the changes CSS exists in the admin layout edit window |
102
|
|
|
$edited_layout_css = $oLayoutModel->getUserLayoutCss($layout_srl); |
103
|
|
|
|
104
|
|
|
if(FileHandler::exists($edited_layout_css)) |
|
|
|
|
105
|
|
|
{ |
106
|
|
|
Context::loadFile(array($edited_layout_css, 'all', '', 100)); |
107
|
|
|
} |
108
|
|
|
} |
109
|
|
|
if(!$layout_path) |
110
|
|
|
{ |
111
|
|
|
$layout_path = './common/tpl'; |
112
|
|
|
} |
113
|
|
|
if(!$layout_file) |
114
|
|
|
{ |
115
|
|
|
$layout_file = 'default_layout'; |
116
|
|
|
} |
117
|
|
|
$output = $oTemplate->compile($layout_path, $layout_file, $edited_layout_file); |
118
|
|
|
|
119
|
|
|
// if popup_layout, remove admin bar. |
120
|
|
|
$realLayoutPath = FileHandler::getRealPath($layout_path); |
121
|
|
|
if(substr_compare($realLayoutPath, '/', -1) !== 0) |
122
|
|
|
{ |
123
|
|
|
$realLayoutPath .= '/'; |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
$pathInfo = pathinfo($layout_file); |
127
|
|
|
$onlyLayoutFile = $pathInfo['filename']; |
|
|
|
|
128
|
|
|
|
129
|
|
|
if(__DEBUG__ == 3) |
130
|
|
|
{ |
131
|
|
|
$GLOBALS['__layout_compile_elapsed__'] = getMicroTime() - $start; |
|
|
|
|
132
|
|
|
} |
133
|
|
|
|
134
|
|
|
if(stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE && (Context::get('_use_ssl') == 'optional' || Context::get('_use_ssl') == 'always')) |
135
|
|
|
{ |
136
|
|
|
Context::addHtmlFooter('<iframe id="xeTmpIframe" name="xeTmpIframe" style="width:1px;height:1px;position:absolute;top:-2px;left:-2px;"></iframe>'); |
137
|
|
|
} |
138
|
|
|
} |
139
|
|
|
} |
140
|
|
|
return $output; |
141
|
|
|
} |
142
|
|
|
|
143
|
|
|
/** |
144
|
|
|
* when display mode is HTML, prepare code before print. |
145
|
|
|
* @param string $output compiled template string |
146
|
|
|
* @return void |
147
|
|
|
*/ |
148
|
|
|
function prepareToPrint(&$output) |
149
|
|
|
{ |
150
|
|
|
if(Context::getResponseMethod() != 'HTML') |
151
|
|
|
{ |
152
|
|
|
return; |
153
|
|
|
} |
154
|
|
|
|
155
|
|
|
if(__DEBUG__ == 3) |
156
|
|
|
{ |
157
|
|
|
$start = getMicroTime(); |
158
|
|
|
} |
159
|
|
|
|
160
|
|
|
// move <style ..></style> in body to the header |
161
|
|
|
$output = preg_replace_callback('!<style(.*?)>(.*?)<\/style>!is', array($this, '_moveStyleToHeader'), $output); |
162
|
|
|
|
163
|
|
|
// move <link ..></link> in body to the header |
164
|
|
|
$output = preg_replace_callback('!<link(.*?)/?>!is', array($this, '_moveLinkToHeader'), $output); |
165
|
|
|
|
166
|
|
|
// move <meta ../> in body to the header |
167
|
|
|
$output = preg_replace_callback('!<meta(.*?)(?:\/|)>!is', array($this, '_moveMetaToHeader'), $output); |
168
|
|
|
|
169
|
|
|
// change a meta fine(widget often put the tag like <!--Meta:path--> to the content because of caching) |
170
|
|
|
$output = preg_replace_callback('/<!--(#)?Meta:([a-z0-9\_\-\/\.\@\:]+)-->/is', array($this, '_transMeta'), $output); |
171
|
|
|
|
172
|
|
|
// handles a relative path generated by using the rewrite module |
173
|
|
|
if(Context::isAllowRewrite()) |
174
|
|
|
{ |
175
|
|
|
$url = parse_url(Context::getRequestUri()); |
176
|
|
|
$real_path = $url['path']; |
177
|
|
|
|
178
|
|
|
$pattern = '/src=("|\'){1}(?:\.\/)?((?:files\/(?:attach|cache|faceOff|member_extra_info|thumbnails)|addons|common|(?:m\.)?layouts|modules|widgets|widgetstyle)\/[^"\']+)("|\'){1}/s'; |
179
|
|
|
$output = preg_replace($pattern, 'src=$1' . $real_path . '$2$3', $output); |
180
|
|
|
|
181
|
|
|
$pattern = '/href=("|\'){1}(\?[^"\']+)/s'; |
182
|
|
|
$output = preg_replace($pattern, 'href=$1' . $real_path . '$2', $output); |
183
|
|
|
|
184
|
|
|
if(Context::get('vid')) |
185
|
|
|
{ |
186
|
|
|
$pattern = '/\/' . Context::get('vid') . '\?([^=]+)=/is'; |
187
|
|
|
$output = preg_replace($pattern, '/?$1=', $output); |
188
|
|
|
} |
189
|
|
|
} |
190
|
|
|
|
191
|
|
|
// prevent the 2nd request due to url(none) of the background-image |
192
|
|
|
$output = preg_replace('/url\((["\']?)none(["\']?)\)/is', 'none', $output); |
193
|
|
|
|
194
|
|
|
if(is_array(Context::get('INPUT_ERROR'))) |
195
|
|
|
{ |
196
|
|
|
$INPUT_ERROR = Context::get('INPUT_ERROR'); |
197
|
|
|
$keys = array_keys($INPUT_ERROR); |
198
|
|
|
$keys = '(' . implode('|', $keys) . ')'; |
199
|
|
|
|
200
|
|
|
$output = preg_replace_callback('@(<input)([^>]*?)\sname="' . $keys . '"([^>]*?)/?>@is', array(&$this, '_preserveValue'), $output); |
201
|
|
|
$output = preg_replace_callback('@<select[^>]*\sname="' . $keys . '".+</select>@isU', array(&$this, '_preserveSelectValue'), $output); |
202
|
|
|
$output = preg_replace_callback('@<textarea[^>]*\sname="' . $keys . '".+</textarea>@isU', array(&$this, '_preserveTextAreaValue'), $output); |
203
|
|
|
} |
204
|
|
|
|
205
|
|
|
if(__DEBUG__ == 3) |
206
|
|
|
{ |
207
|
|
|
$GLOBALS['__trans_content_elapsed__'] = getMicroTime() - $start; |
|
|
|
|
208
|
|
|
} |
209
|
|
|
|
210
|
|
|
// Remove unnecessary information |
211
|
|
|
$output = preg_replace('/member\_\-([0-9]+)/s', 'member_0', $output); |
212
|
|
|
|
213
|
|
|
// set icon |
214
|
|
|
$oAdminModel = getAdminModel('admin'); |
215
|
|
|
$favicon_url = $oAdminModel->getFaviconUrl(false); |
216
|
|
|
$mobicon_url = $oAdminModel->getMobileIconUrl(false); |
217
|
|
|
Context::set('favicon_url', $favicon_url); |
218
|
|
|
Context::set('mobicon_url', $mobicon_url); |
219
|
|
|
|
220
|
|
|
// convert the final layout |
221
|
|
|
Context::set('content', $output); |
222
|
|
|
$oTemplate = TemplateHandler::getInstance(); |
223
|
|
|
if(Mobile::isFromMobilePhone()) |
224
|
|
|
{ |
225
|
|
|
$this->_loadMobileJSCSS(); |
226
|
|
|
$output = $oTemplate->compile('./common/tpl', 'mobile_layout'); |
227
|
|
|
} |
228
|
|
|
else |
229
|
|
|
{ |
230
|
|
|
$this->_loadJSCSS(); |
231
|
|
|
$output = $oTemplate->compile('./common/tpl', 'common_layout'); |
232
|
|
|
} |
233
|
|
|
|
234
|
|
|
// replace the user-defined-language |
235
|
|
|
$oModuleController = getController('module'); |
236
|
|
|
$oModuleController->replaceDefinedLangCode($output); |
237
|
|
|
} |
238
|
|
|
|
239
|
|
|
/** |
240
|
|
|
* when display mode is HTML, prepare code before print about <input> tag value. |
241
|
|
|
* @param array $match input value. |
242
|
|
|
* @return string input value. |
243
|
|
|
*/ |
244
|
|
|
function _preserveValue($match) |
245
|
|
|
{ |
246
|
|
|
$INPUT_ERROR = Context::get('INPUT_ERROR'); |
247
|
|
|
|
248
|
|
|
$str = $match[1] . $match[2] . ' name="' . $match[3] . '"' . $match[4]; |
249
|
|
|
|
250
|
|
|
// get type |
251
|
|
|
$type = 'text'; |
252
|
|
|
if(preg_match('/\stype="([a-z]+)"/i', $str, $m)) |
253
|
|
|
{ |
254
|
|
|
$type = strtolower($m[1]); |
255
|
|
|
} |
256
|
|
|
|
257
|
|
|
switch($type) |
258
|
|
|
{ |
259
|
|
|
case 'text': |
260
|
|
|
case 'hidden': |
261
|
|
|
case 'email': |
262
|
|
|
case 'search': |
263
|
|
|
case 'tel': |
264
|
|
|
case 'url': |
265
|
|
|
case 'email': |
266
|
|
|
case 'datetime': |
267
|
|
|
case 'date': |
268
|
|
|
case 'month': |
269
|
|
|
case 'week': |
270
|
|
|
case 'time': |
271
|
|
|
case 'datetime-local': |
272
|
|
|
case 'number': |
273
|
|
|
case 'range': |
274
|
|
|
case 'color': |
275
|
|
|
$str = preg_replace('@\svalue="[^"]*?"@', ' ', $str) . ' value="' . htmlspecialchars($INPUT_ERROR[$match[3]], ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '"'; |
276
|
|
|
break; |
277
|
|
|
case 'password': |
278
|
|
|
$str = preg_replace('@\svalue="[^"]*?"@', ' ', $str); |
279
|
|
|
break; |
280
|
|
|
case 'radio': |
281
|
|
|
case 'checkbox': |
282
|
|
|
$str = preg_replace('@\schecked(="[^"]*?")?@', ' ', $str); |
283
|
|
|
if(@preg_match('@\s(?i:value)="' . $INPUT_ERROR[$match[3]] . '"@', $str)) |
284
|
|
|
{ |
285
|
|
|
$str .= ' checked="checked"'; |
286
|
|
|
} |
287
|
|
|
break; |
288
|
|
|
} |
289
|
|
|
|
290
|
|
|
return $str . ' />'; |
291
|
|
|
} |
292
|
|
|
|
293
|
|
|
/** |
294
|
|
|
* when display mode is HTML, prepare code before print about <select> tag value. |
295
|
|
|
* @param array $matches select tag. |
296
|
|
|
* @return string select tag. |
297
|
|
|
*/ |
298
|
|
|
function _preserveSelectValue($matches) |
299
|
|
|
{ |
300
|
|
|
$INPUT_ERROR = Context::get('INPUT_ERROR'); |
301
|
|
|
preg_replace('@\sselected(="[^"]*?")?@', ' ', $matches[0]); |
302
|
|
|
preg_match('@<select.*?>@is', $matches[0], $mm); |
303
|
|
|
|
304
|
|
|
preg_match_all('@<option[^>]*\svalue="([^"]*)".+</option>@isU', $matches[0], $m); |
305
|
|
|
|
306
|
|
|
$key = array_search($INPUT_ERROR[$matches[1]], $m[1]); |
307
|
|
|
if($key === FALSE) |
308
|
|
|
{ |
309
|
|
|
return $matches[0]; |
310
|
|
|
} |
311
|
|
|
|
312
|
|
|
$m[0][$key] = preg_replace('@(\svalue=".*?")@is', '$1 selected="selected"', $m[0][$key]); |
313
|
|
|
|
314
|
|
|
return $mm[0] . implode('', $m[0]) . '</select>'; |
315
|
|
|
} |
316
|
|
|
|
317
|
|
|
/** |
318
|
|
|
* when display mode is HTML, prepare code before print about <textarea> tag value. |
319
|
|
|
* @param array $matches textarea tag information. |
320
|
|
|
* @return string textarea tag |
321
|
|
|
*/ |
322
|
|
|
function _preserveTextAreaValue($matches) |
323
|
|
|
{ |
324
|
|
|
$INPUT_ERROR = Context::get('INPUT_ERROR'); |
325
|
|
|
preg_match('@<textarea.*?>@is', $matches[0], $mm); |
326
|
|
|
return $mm[0] . $INPUT_ERROR[$matches[1]] . '</textarea>'; |
327
|
|
|
} |
328
|
|
|
|
329
|
|
|
/** |
330
|
|
|
* add html style code extracted from html body to Context, which will be |
331
|
|
|
* printed inside <header></header> later. |
332
|
|
|
* @param array $matches |
333
|
|
|
* @return void |
334
|
|
|
*/ |
335
|
|
|
function _moveStyleToHeader($matches) |
336
|
|
|
{ |
337
|
|
|
if(isset($matches[1]) && stristr($matches[1], 'scoped')) |
338
|
|
|
{ |
339
|
|
|
return $matches[0]; |
340
|
|
|
} |
341
|
|
|
Context::addHtmlHeader($matches[0]); |
342
|
|
|
} |
343
|
|
|
|
344
|
|
|
/** |
345
|
|
|
* add html link code extracted from html body to Context, which will be |
346
|
|
|
* printed inside <header></header> later. |
347
|
|
|
* @param array $matches |
348
|
|
|
* @return void |
349
|
|
|
*/ |
350
|
|
|
function _moveLinkToHeader($matches) |
351
|
|
|
{ |
352
|
|
|
Context::addHtmlHeader($matches[0]); |
353
|
|
|
} |
354
|
|
|
|
355
|
|
|
/** |
356
|
|
|
* add meta code extracted from html body to Context, which will be |
357
|
|
|
* printed inside <header></header> later. |
358
|
|
|
* @param array $matches |
359
|
|
|
* @return void |
360
|
|
|
*/ |
361
|
|
|
function _moveMetaToHeader($matches) |
362
|
|
|
{ |
363
|
|
|
Context::addHtmlHeader($matches[0]); |
364
|
|
|
} |
365
|
|
|
|
366
|
|
|
/** |
367
|
|
|
* add given .css or .js file names in widget code to Context |
368
|
|
|
* @param array $matches |
369
|
|
|
* @return void |
370
|
|
|
*/ |
371
|
|
|
function _transMeta($matches) |
372
|
|
|
{ |
373
|
|
|
if($matches[1]) |
374
|
|
|
{ |
375
|
|
|
return ''; |
376
|
|
|
} |
377
|
|
|
Context::loadFile($matches[2]); |
378
|
|
|
} |
379
|
|
|
|
380
|
|
|
/** |
381
|
|
|
* import basic .js files. |
382
|
|
|
* @return void |
383
|
|
|
*/ |
384
|
|
|
function _loadJSCSS() |
385
|
|
|
{ |
386
|
|
|
$oContext = Context::getInstance(); |
387
|
|
|
$lang_type = Context::getLangType(); |
388
|
|
|
|
389
|
|
|
// add common JS/CSS files |
390
|
|
|
if(__DEBUG__ || !__XE_VERSION_STABLE__) |
391
|
|
|
{ |
392
|
|
|
$oContext->loadFile(array('./common/js/jquery-1.x.js', 'head', 'lt IE 9', -1110000), true); |
|
|
|
|
393
|
|
|
$oContext->loadFile(array('./common/js/jquery.js', 'head', 'gte IE 9', -1100000), true); |
|
|
|
|
394
|
|
|
$oContext->loadFile(array('./common/js/modernizr.js', 'head', '', -1000000), true); |
|
|
|
|
395
|
|
|
$oContext->loadFile(array('./common/js/x.js', 'head', '', -1000000), true); |
|
|
|
|
396
|
|
|
$oContext->loadFile(array('./common/js/URI.js', 'head', '', -1000000), true); |
|
|
|
|
397
|
|
|
$oContext->loadFile(array('./common/js/blankshield.min.js', 'head', '', -1000000), true); |
|
|
|
|
398
|
|
|
$oContext->loadFile(array('./common/js/common.js', 'head', '', -1000000), true); |
|
|
|
|
399
|
|
|
$oContext->loadFile(array('./common/js/js_app.js', 'head', '', -1000000), true); |
|
|
|
|
400
|
|
|
$oContext->loadFile(array('./common/js/xml2json.js', 'head', '', -1000000), true); |
|
|
|
|
401
|
|
|
$oContext->loadFile(array('./common/js/xml_handler.js', 'head', '', -1000000), true); |
|
|
|
|
402
|
|
|
$oContext->loadFile(array('./common/js/xml_js_filter.js', 'head', '', -1000000), true); |
|
|
|
|
403
|
|
View Code Duplication |
if(!__DISABLE_DEFAULT_CSS__) |
404
|
|
|
{ |
405
|
|
|
$oContext->loadFile(array('./common/css/xe.css', '', '', -10000000), true); |
|
|
|
|
406
|
|
|
} |
407
|
|
|
else |
408
|
|
|
{ |
409
|
|
|
$oContext->unloadFile(array('./common/css/xe.css', '', '', -10000000), true); |
|
|
|
|
410
|
|
|
} |
411
|
|
|
} |
412
|
|
|
else |
413
|
|
|
{ |
414
|
|
|
$oContext->loadFile(array('./common/js/jquery-1.x.min.js', 'head', 'lt IE 9', -1110000), true); |
|
|
|
|
415
|
|
|
$oContext->loadFile(array('./common/js/jquery.min.js', 'head', 'gte IE 9', -1100000), true); |
|
|
|
|
416
|
|
|
$oContext->loadFile(array('./common/js/x.min.js', 'head', '', -1000000), true); |
|
|
|
|
417
|
|
|
$oContext->loadFile(array('./common/js/xe.min.js', 'head', '', -1000000), true); |
|
|
|
|
418
|
|
View Code Duplication |
if(!__DISABLE_DEFAULT_CSS__) |
419
|
|
|
{ |
420
|
|
|
$oContext->loadFile(array('./common/css/xe.min.css', '', '', -10000000), true); |
|
|
|
|
421
|
|
|
} |
422
|
|
|
else |
423
|
|
|
{ |
424
|
|
|
$oContext->unloadFile(array('./common/css/xe.min.css', '', '', -10000000), true); |
|
|
|
|
425
|
|
|
} |
426
|
|
|
} |
427
|
|
|
|
428
|
|
|
// for admin page, add admin css |
429
|
|
|
if(Context::get('module') == 'admin' || strpos(Context::get('act'), 'Admin') > 0) |
430
|
|
|
{ |
431
|
|
|
if(__DEBUG__ || !__XE_VERSION_STABLE__) |
432
|
|
|
{ |
433
|
|
|
$oContext->loadFile(array('./modules/admin/tpl/css/admin.css', '', '', 10), true); |
|
|
|
|
434
|
|
|
$oContext->loadFile(array("./modules/admin/tpl/css/admin_{$lang_type}.css", '', '', 10), true); |
|
|
|
|
435
|
|
|
$oContext->loadFile(array("./modules/admin/tpl/css/admin.iefix.css", '', 'ie', 10), true); |
|
|
|
|
436
|
|
|
$oContext->loadFile('./modules/admin/tpl/js/admin.js', true); |
|
|
|
|
437
|
|
|
$oContext->loadFile(array('./modules/admin/tpl/css/admin.bootstrap.css', '', '', 1), true); |
|
|
|
|
438
|
|
|
$oContext->loadFile(array('./modules/admin/tpl/js/jquery.tmpl.js', '', '', 1), true); |
|
|
|
|
439
|
|
|
$oContext->loadFile(array('./modules/admin/tpl/js/jquery.jstree.js', '', '', 1), true); |
|
|
|
|
440
|
|
|
} |
441
|
|
|
else |
442
|
|
|
{ |
443
|
|
|
$oContext->loadFile(array('./modules/admin/tpl/css/admin.min.css', '', '', 10), true); |
|
|
|
|
444
|
|
|
$oContext->loadFile(array("./modules/admin/tpl/css/admin_{$lang_type}.css", '', '', 10), true); |
|
|
|
|
445
|
|
|
$oContext->loadFile(array("./modules/admin/tpl/css/admin.iefix.css", '', 'ie', 10), true); |
|
|
|
|
446
|
|
|
$oContext->loadFile('./modules/admin/tpl/js/admin.min.js', true); |
|
|
|
|
447
|
|
|
$oContext->loadFile(array('./modules/admin/tpl/css/admin.bootstrap.min.css', '', '', 1), true); |
|
|
|
|
448
|
|
|
$oContext->loadFile(array('./modules/admin/tpl/js/jquery.tmpl.js', '', '', 1), true); |
|
|
|
|
449
|
|
|
$oContext->loadFile(array('./modules/admin/tpl/js/jquery.jstree.js', '', '', 1), true); |
|
|
|
|
450
|
|
|
} |
451
|
|
|
} |
452
|
|
|
} |
453
|
|
|
|
454
|
|
|
/** |
455
|
|
|
* import basic .js files for mobile |
456
|
|
|
*/ |
457
|
|
|
private function _loadMobileJSCSS() |
458
|
|
|
{ |
459
|
|
|
$oContext = Context::getInstance(); |
460
|
|
|
$lang_type = Context::getLangType(); |
|
|
|
|
461
|
|
|
|
462
|
|
|
// add common JS/CSS files |
463
|
|
|
if(__DEBUG__ || !__XE_VERSION_STABLE__) |
464
|
|
|
{ |
465
|
|
|
$oContext->loadFile(array('./common/js/jquery.js', 'head', '', -1100000), true); |
|
|
|
|
466
|
|
|
$oContext->loadFile(array('./common/js/modernizr.js', 'head', '', -1000000), true); |
|
|
|
|
467
|
|
|
$oContext->loadFile(array('./common/js/x.js', 'head', '', -1000000), true); |
|
|
|
|
468
|
|
|
$oContext->loadFile(array('./common/js/URI.js', 'head', '', -1000000), true); |
|
|
|
|
469
|
|
|
$oContext->loadFile(array('./common/js/blankshield.min.js', 'head', '', -1000000), true); |
|
|
|
|
470
|
|
|
$oContext->loadFile(array('./common/js/common.js', 'head', '', -1000000), true); |
|
|
|
|
471
|
|
|
$oContext->loadFile(array('./common/js/js_app.js', 'head', '', -1000000), true); |
|
|
|
|
472
|
|
|
$oContext->loadFile(array('./common/js/xml2json.js', 'head', '', -1000000), true); |
|
|
|
|
473
|
|
|
$oContext->loadFile(array('./common/js/xml_handler.js', 'head', '', -1000000), true); |
|
|
|
|
474
|
|
|
$oContext->loadFile(array('./common/js/xml_js_filter.js', 'head', '', -1000000), true); |
|
|
|
|
475
|
|
View Code Duplication |
if(!__DISABLE_DEFAULT_CSS__) |
476
|
|
|
{ |
477
|
|
|
$oContext->loadFile(array('./common/css/xe.css', '', '', -10000000), true); |
|
|
|
|
478
|
|
|
$oContext->loadFile(array('./common/css/mobile.css', '', '', -10000000), true); |
|
|
|
|
479
|
|
|
} |
480
|
|
|
else |
481
|
|
|
{ |
482
|
|
|
$oContext->unloadFile(array('./common/css/xe.css', '', '', -10000000), true); |
|
|
|
|
483
|
|
|
$oContext->unloadFile(array('./common/css/mobile.css', '', '', -10000000), true); |
|
|
|
|
484
|
|
|
} |
485
|
|
|
} |
486
|
|
|
else |
487
|
|
|
{ |
488
|
|
|
$oContext->loadFile(array('./common/js/jquery.min.js', 'head', '', -1100000), true); |
|
|
|
|
489
|
|
|
$oContext->loadFile(array('./common/js/x.min.js', 'head', '', -1000000), true); |
|
|
|
|
490
|
|
|
$oContext->loadFile(array('./common/js/xe.min.js', 'head', '', -1000000), true); |
|
|
|
|
491
|
|
View Code Duplication |
if(!__DISABLE_DEFAULT_CSS__) |
492
|
|
|
{ |
493
|
|
|
$oContext->loadFile(array('./common/css/xe.min.css', '', '', -10000000), true); |
|
|
|
|
494
|
|
|
$oContext->loadFile(array('./common/css/mobile.min.css', '', '', -10000000), true); |
|
|
|
|
495
|
|
|
} |
496
|
|
|
else |
497
|
|
|
{ |
498
|
|
|
$oContext->unloadFile(array('./common/css/xe.min.css', '', '', -10000000), true); |
|
|
|
|
499
|
|
|
$oContext->unloadFile(array('./common/css/mobile.min.css', '', '', -10000000), true); |
|
|
|
|
500
|
|
|
} |
501
|
|
|
} |
502
|
|
|
} |
503
|
|
|
|
504
|
|
|
} |
505
|
|
|
/* End of file HTMLDisplayHandler.class.php */ |
506
|
|
|
/* Location: ./classes/display/HTMLDisplayHandler.class.php */ |
507
|
|
|
|
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: