@@ -19,9 +19,9 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | $template_path = $oModule->getTemplatePath(); |
| 21 | 21 | |
| 22 | - if(!is_dir($template_path)) |
|
| 22 | + if (!is_dir($template_path)) |
|
| 23 | 23 | { |
| 24 | - if($oModule->module_info->module == $oModule->module) |
|
| 24 | + if ($oModule->module_info->module == $oModule->module) |
|
| 25 | 25 | { |
| 26 | 26 | $skin = $oModule->origin_module_info->skin; |
| 27 | 27 | } |
@@ -30,17 +30,17 @@ discard block |
||
| 30 | 30 | $skin = $oModule->module_config->skin; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - if(Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') === false) |
|
| 33 | + if (Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') === false) |
|
| 34 | 34 | { |
| 35 | - if($skin && is_string($skin)) |
|
| 35 | + if ($skin && is_string($skin)) |
|
| 36 | 36 | { |
| 37 | 37 | $theme_skin = explode('|@|', $skin); |
| 38 | 38 | $template_path = $oModule->getTemplatePath(); |
| 39 | - if(count($theme_skin) == 2) |
|
| 39 | + if (count($theme_skin) == 2) |
|
| 40 | 40 | { |
| 41 | 41 | $theme_path = sprintf('./themes/%s', $theme_skin[0]); |
| 42 | 42 | // FIXME $theme_path $theme_path $theme_path ?? |
| 43 | - if(substr($theme_path, 0, strlen($theme_path)) != $theme_path) |
|
| 43 | + if (substr($theme_path, 0, strlen($theme_path)) != $theme_path) |
|
| 44 | 44 | { |
| 45 | 45 | $template_path = sprintf('%s/modules/%s/', $theme_path, $theme_skin[1]); |
| 46 | 46 | } |
@@ -61,16 +61,16 @@ discard block |
||
| 61 | 61 | $output = $oTemplate->compile($template_path, $tpl_file); |
| 62 | 62 | |
| 63 | 63 | // add .x div for adminitration pages |
| 64 | - if(Context::getResponseMethod() == 'HTML') |
|
| 64 | + if (Context::getResponseMethod() == 'HTML') |
|
| 65 | 65 | { |
| 66 | - if(Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') > 0 && Context::get('act') != 'dispPageAdminContentModify' && Context::get('act') != 'dispPageAdminMobileContentModify') |
|
| 66 | + if (Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') > 0 && Context::get('act') != 'dispPageAdminContentModify' && Context::get('act') != 'dispPageAdminMobileContentModify') |
|
| 67 | 67 | { |
| 68 | - $output = '<div class="x">' . $output . '</div>'; |
|
| 68 | + $output = '<div class="x">'.$output.'</div>'; |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - if(Context::get('layout') != 'none') |
|
| 71 | + if (Context::get('layout') != 'none') |
|
| 72 | 72 | { |
| 73 | - if(__DEBUG__ == 3) |
|
| 73 | + if (__DEBUG__ == 3) |
|
| 74 | 74 | { |
| 75 | 75 | $start = getMicroTime(); |
| 76 | 76 | } |
@@ -88,11 +88,11 @@ discard block |
||
| 88 | 88 | $layout_srl = $layout_info->layout_srl; |
| 89 | 89 | |
| 90 | 90 | // compile if connected to the layout |
| 91 | - if($layout_srl > 0) |
|
| 91 | + if ($layout_srl > 0) |
|
| 92 | 92 | { |
| 93 | 93 | |
| 94 | 94 | // handle separately if the layout is faceoff |
| 95 | - if($layout_info && $layout_info->type == 'faceoff') |
|
| 95 | + if ($layout_info && $layout_info->type == 'faceoff') |
|
| 96 | 96 | { |
| 97 | 97 | $oLayoutModel->doActivateFaceOff($layout_info); |
| 98 | 98 | Context::set('layout_info', $layout_info); |
@@ -101,16 +101,16 @@ discard block |
||
| 101 | 101 | // search if the changes CSS exists in the admin layout edit window |
| 102 | 102 | $edited_layout_css = $oLayoutModel->getUserLayoutCss($layout_srl); |
| 103 | 103 | |
| 104 | - if(FileHandler::exists($edited_layout_css)) |
|
| 104 | + if (FileHandler::exists($edited_layout_css)) |
|
| 105 | 105 | { |
| 106 | 106 | Context::loadFile(array($edited_layout_css, 'all', '', 100)); |
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | - if(!$layout_path) |
|
| 109 | + if (!$layout_path) |
|
| 110 | 110 | { |
| 111 | 111 | $layout_path = './common/tpl'; |
| 112 | 112 | } |
| 113 | - if(!$layout_file) |
|
| 113 | + if (!$layout_file) |
|
| 114 | 114 | { |
| 115 | 115 | $layout_file = 'default_layout'; |
| 116 | 116 | } |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | |
| 119 | 119 | // if popup_layout, remove admin bar. |
| 120 | 120 | $realLayoutPath = FileHandler::getRealPath($layout_path); |
| 121 | - if(substr_compare($realLayoutPath, '/', -1) !== 0) |
|
| 121 | + if (substr_compare($realLayoutPath, '/', -1) !== 0) |
|
| 122 | 122 | { |
| 123 | 123 | $realLayoutPath .= '/'; |
| 124 | 124 | } |
@@ -126,12 +126,12 @@ discard block |
||
| 126 | 126 | $pathInfo = pathinfo($layout_file); |
| 127 | 127 | $onlyLayoutFile = $pathInfo['filename']; |
| 128 | 128 | |
| 129 | - if(__DEBUG__ == 3) |
|
| 129 | + if (__DEBUG__ == 3) |
|
| 130 | 130 | { |
| 131 | 131 | $GLOBALS['__layout_compile_elapsed__'] = getMicroTime() - $start; |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - if(stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE && (Context::get('_use_ssl') == 'optional' || Context::get('_use_ssl') == 'always')) |
|
| 134 | + if (stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE && (Context::get('_use_ssl') == 'optional' || Context::get('_use_ssl') == 'always')) |
|
| 135 | 135 | { |
| 136 | 136 | Context::addHtmlFooter('<iframe id="xeTmpIframe" name="xeTmpIframe" style="width:1px;height:1px;position:absolute;top:-2px;left:-2px;"></iframe>'); |
| 137 | 137 | } |
@@ -147,12 +147,12 @@ discard block |
||
| 147 | 147 | */ |
| 148 | 148 | function prepareToPrint(&$output) |
| 149 | 149 | { |
| 150 | - if(Context::getResponseMethod() != 'HTML') |
|
| 150 | + if (Context::getResponseMethod() != 'HTML') |
|
| 151 | 151 | { |
| 152 | 152 | return; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - if(__DEBUG__ == 3) |
|
| 155 | + if (__DEBUG__ == 3) |
|
| 156 | 156 | { |
| 157 | 157 | $start = getMicroTime(); |
| 158 | 158 | } |
@@ -170,20 +170,20 @@ discard block |
||
| 170 | 170 | $output = preg_replace_callback('/<!--(#)?Meta:([a-z0-9\_\-\/\.\@\:]+)-->/is', array($this, '_transMeta'), $output); |
| 171 | 171 | |
| 172 | 172 | // handles a relative path generated by using the rewrite module |
| 173 | - if(Context::isAllowRewrite()) |
|
| 173 | + if (Context::isAllowRewrite()) |
|
| 174 | 174 | { |
| 175 | 175 | $url = parse_url(Context::getRequestUri()); |
| 176 | 176 | $real_path = $url['path']; |
| 177 | 177 | |
| 178 | 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); |
|
| 179 | + $output = preg_replace($pattern, 'src=$1'.$real_path.'$2$3', $output); |
|
| 180 | 180 | |
| 181 | 181 | $pattern = '/href=("|\'){1}(\?[^"\']+)/s'; |
| 182 | - $output = preg_replace($pattern, 'href=$1' . $real_path . '$2', $output); |
|
| 182 | + $output = preg_replace($pattern, 'href=$1'.$real_path.'$2', $output); |
|
| 183 | 183 | |
| 184 | - if(Context::get('vid')) |
|
| 184 | + if (Context::get('vid')) |
|
| 185 | 185 | { |
| 186 | - $pattern = '/\/' . Context::get('vid') . '\?([^=]+)=/is'; |
|
| 186 | + $pattern = '/\/'.Context::get('vid').'\?([^=]+)=/is'; |
|
| 187 | 187 | $output = preg_replace($pattern, '/?$1=', $output); |
| 188 | 188 | } |
| 189 | 189 | } |
@@ -191,18 +191,18 @@ discard block |
||
| 191 | 191 | // prevent the 2nd request due to url(none) of the background-image |
| 192 | 192 | $output = preg_replace('/url\((["\']?)none(["\']?)\)/is', 'none', $output); |
| 193 | 193 | |
| 194 | - if(is_array(Context::get('INPUT_ERROR'))) |
|
| 194 | + if (is_array(Context::get('INPUT_ERROR'))) |
|
| 195 | 195 | { |
| 196 | 196 | $INPUT_ERROR = Context::get('INPUT_ERROR'); |
| 197 | 197 | $keys = array_keys($INPUT_ERROR); |
| 198 | - $keys = '(' . implode('|', $keys) . ')'; |
|
| 198 | + $keys = '('.implode('|', $keys).')'; |
|
| 199 | 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); |
|
| 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 | 203 | } |
| 204 | 204 | |
| 205 | - if(__DEBUG__ == 3) |
|
| 205 | + if (__DEBUG__ == 3) |
|
| 206 | 206 | { |
| 207 | 207 | $GLOBALS['__trans_content_elapsed__'] = getMicroTime() - $start; |
| 208 | 208 | } |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | // convert the final layout |
| 221 | 221 | Context::set('content', $output); |
| 222 | 222 | $oTemplate = TemplateHandler::getInstance(); |
| 223 | - if(Mobile::isFromMobilePhone()) |
|
| 223 | + if (Mobile::isFromMobilePhone()) |
|
| 224 | 224 | { |
| 225 | 225 | $this->_loadMobileJSCSS(); |
| 226 | 226 | $output = $oTemplate->compile('./common/tpl', 'mobile_layout'); |
@@ -245,16 +245,16 @@ discard block |
||
| 245 | 245 | { |
| 246 | 246 | $INPUT_ERROR = Context::get('INPUT_ERROR'); |
| 247 | 247 | |
| 248 | - $str = $match[1] . $match[2] . ' name="' . $match[3] . '"' . $match[4]; |
|
| 248 | + $str = $match[1].$match[2].' name="'.$match[3].'"'.$match[4]; |
|
| 249 | 249 | |
| 250 | 250 | // get type |
| 251 | 251 | $type = 'text'; |
| 252 | - if(preg_match('/\stype="([a-z]+)"/i', $str, $m)) |
|
| 252 | + if (preg_match('/\stype="([a-z]+)"/i', $str, $m)) |
|
| 253 | 253 | { |
| 254 | 254 | $type = strtolower($m[1]); |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | - switch($type) |
|
| 257 | + switch ($type) |
|
| 258 | 258 | { |
| 259 | 259 | case 'text': |
| 260 | 260 | case 'hidden': |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | case 'number': |
| 273 | 273 | case 'range': |
| 274 | 274 | case 'color': |
| 275 | - $str = preg_replace('@\svalue="[^"]*?"@', ' ', $str) . ' value="' . htmlspecialchars($INPUT_ERROR[$match[3]], ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '"'; |
|
| 275 | + $str = preg_replace('@\svalue="[^"]*?"@', ' ', $str).' value="'.htmlspecialchars($INPUT_ERROR[$match[3]], ENT_COMPAT | ENT_HTML401, 'UTF-8', false).'"'; |
|
| 276 | 276 | break; |
| 277 | 277 | case 'password': |
| 278 | 278 | $str = preg_replace('@\svalue="[^"]*?"@', ' ', $str); |
@@ -280,14 +280,14 @@ discard block |
||
| 280 | 280 | case 'radio': |
| 281 | 281 | case 'checkbox': |
| 282 | 282 | $str = preg_replace('@\schecked(="[^"]*?")?@', ' ', $str); |
| 283 | - if(@preg_match('@\s(?i:value)="' . $INPUT_ERROR[$match[3]] . '"@', $str)) |
|
| 283 | + if (@preg_match('@\s(?i:value)="'.$INPUT_ERROR[$match[3]].'"@', $str)) |
|
| 284 | 284 | { |
| 285 | 285 | $str .= ' checked="checked"'; |
| 286 | 286 | } |
| 287 | 287 | break; |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | - return $str . ' />'; |
|
| 290 | + return $str.' />'; |
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | /** |
@@ -304,14 +304,14 @@ discard block |
||
| 304 | 304 | preg_match_all('@<option[^>]*\svalue="([^"]*)".+</option>@isU', $matches[0], $m); |
| 305 | 305 | |
| 306 | 306 | $key = array_search($INPUT_ERROR[$matches[1]], $m[1]); |
| 307 | - if($key === FALSE) |
|
| 307 | + if ($key === FALSE) |
|
| 308 | 308 | { |
| 309 | 309 | return $matches[0]; |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | $m[0][$key] = preg_replace('@(\svalue=".*?")@is', '$1 selected="selected"', $m[0][$key]); |
| 313 | 313 | |
| 314 | - return $mm[0] . implode('', $m[0]) . '</select>'; |
|
| 314 | + return $mm[0].implode('', $m[0]).'</select>'; |
|
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | /** |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | { |
| 324 | 324 | $INPUT_ERROR = Context::get('INPUT_ERROR'); |
| 325 | 325 | preg_match('@<textarea.*?>@is', $matches[0], $mm); |
| 326 | - return $mm[0] . $INPUT_ERROR[$matches[1]] . '</textarea>'; |
|
| 326 | + return $mm[0].$INPUT_ERROR[$matches[1]].'</textarea>'; |
|
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | /** |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | */ |
| 335 | 335 | function _moveStyleToHeader($matches) |
| 336 | 336 | { |
| 337 | - if(isset($matches[1]) && stristr($matches[1], 'scoped')) |
|
| 337 | + if (isset($matches[1]) && stristr($matches[1], 'scoped')) |
|
| 338 | 338 | { |
| 339 | 339 | return $matches[0]; |
| 340 | 340 | } |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | */ |
| 371 | 371 | function _transMeta($matches) |
| 372 | 372 | { |
| 373 | - if($matches[1]) |
|
| 373 | + if ($matches[1]) |
|
| 374 | 374 | { |
| 375 | 375 | return ''; |
| 376 | 376 | } |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | $lang_type = Context::getLangType(); |
| 388 | 388 | |
| 389 | 389 | // add common JS/CSS files |
| 390 | - if(__DEBUG__ || !__XE_VERSION_STABLE__) |
|
| 390 | + if (__DEBUG__ || !__XE_VERSION_STABLE__) |
|
| 391 | 391 | { |
| 392 | 392 | $oContext->loadFile(array('./common/js/jquery-1.x.js', 'head', 'lt IE 9', -111000), true); |
| 393 | 393 | $oContext->loadFile(array('./common/js/jquery.js', 'head', 'gte IE 9', -110000), true); |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | $oContext->loadFile(array('./common/js/xml2json.js', 'head', '', -100000), true); |
| 401 | 401 | $oContext->loadFile(array('./common/js/xml_handler.js', 'head', '', -100000), true); |
| 402 | 402 | $oContext->loadFile(array('./common/js/xml_js_filter.js', 'head', '', -100000), true); |
| 403 | - if(!__DISABLE_DEFAULT_CSS__) |
|
| 403 | + if (!__DISABLE_DEFAULT_CSS__) |
|
| 404 | 404 | { |
| 405 | 405 | $oContext->loadFile(array('./common/css/xe.css', '', '', -1000000), true); |
| 406 | 406 | } |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | $oContext->loadFile(array('./common/js/jquery.min.js', 'head', 'gte IE 9', -110000), true); |
| 416 | 416 | $oContext->loadFile(array('./common/js/x.min.js', 'head', '', -100000), true); |
| 417 | 417 | $oContext->loadFile(array('./common/js/xe.min.js', 'head', '', -100000), true); |
| 418 | - if(!__DISABLE_DEFAULT_CSS__) |
|
| 418 | + if (!__DISABLE_DEFAULT_CSS__) |
|
| 419 | 419 | { |
| 420 | 420 | $oContext->loadFile(array('./common/css/xe.min.css', '', '', -1000000), true); |
| 421 | 421 | } |
@@ -426,9 +426,9 @@ discard block |
||
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | // for admin page, add admin css |
| 429 | - if(Context::get('module') == 'admin' || strpos(Context::get('act'), 'Admin') > 0) |
|
| 429 | + if (Context::get('module') == 'admin' || strpos(Context::get('act'), 'Admin') > 0) |
|
| 430 | 430 | { |
| 431 | - if(__DEBUG__ || !__XE_VERSION_STABLE__) |
|
| 431 | + if (__DEBUG__ || !__XE_VERSION_STABLE__) |
|
| 432 | 432 | { |
| 433 | 433 | $oContext->loadFile(array('./modules/admin/tpl/css/admin.css', '', '', 10), true); |
| 434 | 434 | $oContext->loadFile(array("./modules/admin/tpl/css/admin_{$lang_type}.css", '', '', 10), true); |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | $lang_type = Context::getLangType(); |
| 461 | 461 | |
| 462 | 462 | // add common JS/CSS files |
| 463 | - if(__DEBUG__ || !__XE_VERSION_STABLE__) |
|
| 463 | + if (__DEBUG__ || !__XE_VERSION_STABLE__) |
|
| 464 | 464 | { |
| 465 | 465 | $oContext->loadFile(array('./common/js/jquery.js', 'head', '', -110000), true); |
| 466 | 466 | $oContext->loadFile(array('./common/js/modernizr.js', 'head', '', -100000), true); |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | $oContext->loadFile(array('./common/js/xml2json.js', 'head', '', -100000), true); |
| 471 | 471 | $oContext->loadFile(array('./common/js/xml_handler.js', 'head', '', -100000), true); |
| 472 | 472 | $oContext->loadFile(array('./common/js/xml_js_filter.js', 'head', '', -100000), true); |
| 473 | - if(!__DISABLE_DEFAULT_CSS__) |
|
| 473 | + if (!__DISABLE_DEFAULT_CSS__) |
|
| 474 | 474 | { |
| 475 | 475 | $oContext->loadFile(array('./common/css/xe.css', '', '', -1000000), true); |
| 476 | 476 | $oContext->loadFile(array('./common/css/mobile.css', '', '', -1000000), true); |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | $oContext->loadFile(array('./common/js/jquery.min.js', 'head', '', -110000), true); |
| 487 | 487 | $oContext->loadFile(array('./common/js/x.min.js', 'head', '', -100000), true); |
| 488 | 488 | $oContext->loadFile(array('./common/js/xe.min.js', 'head', '', -100000), true); |
| 489 | - if(!__DISABLE_DEFAULT_CSS__) |
|
| 489 | + if (!__DISABLE_DEFAULT_CSS__) |
|
| 490 | 490 | { |
| 491 | 491 | $oContext->loadFile(array('./common/css/xe.min.css', '', '', -1000000), true); |
| 492 | 492 | $oContext->loadFile(array('./common/css/mobile.min.css', '', '', -1000000), true); |