@@ -18,9 +18,9 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | $template_path = $oModule->getTemplatePath(); |
| 20 | 20 | |
| 21 | - if(!is_dir($template_path)) |
|
| 21 | + if (!is_dir($template_path)) |
|
| 22 | 22 | { |
| 23 | - if($oModule->module_info->module == $oModule->module) |
|
| 23 | + if ($oModule->module_info->module == $oModule->module) |
|
| 24 | 24 | { |
| 25 | 25 | $skin = $oModule->origin_module_info->skin; |
| 26 | 26 | } |
@@ -29,17 +29,17 @@ discard block |
||
| 29 | 29 | $skin = $oModule->module_config->skin; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - if(Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') === false) |
|
| 32 | + if (Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') === false) |
|
| 33 | 33 | { |
| 34 | - if($skin && is_string($skin)) |
|
| 34 | + if ($skin && is_string($skin)) |
|
| 35 | 35 | { |
| 36 | 36 | $theme_skin = explode('|@|', $skin); |
| 37 | 37 | $template_path = $oModule->getTemplatePath(); |
| 38 | - if(count($theme_skin) == 2) |
|
| 38 | + if (count($theme_skin) == 2) |
|
| 39 | 39 | { |
| 40 | 40 | $theme_path = sprintf('./themes/%s', $theme_skin[0]); |
| 41 | 41 | // FIXME $theme_path $theme_path $theme_path ?? |
| 42 | - if(substr($theme_path, 0, strlen($theme_path)) != $theme_path) |
|
| 42 | + if (substr($theme_path, 0, strlen($theme_path)) != $theme_path) |
|
| 43 | 43 | { |
| 44 | 44 | $template_path = sprintf('%s/modules/%s/', $theme_path, $theme_skin[1]); |
| 45 | 45 | } |
@@ -65,16 +65,16 @@ discard block |
||
| 65 | 65 | $oSecurity->encodeHTML('is_keyword', 'search_keyword', 'search_target', 'order_target', 'order_type'); |
| 66 | 66 | |
| 67 | 67 | // add .x div for adminitration pages |
| 68 | - if(Context::getResponseMethod() == 'HTML') |
|
| 68 | + if (Context::getResponseMethod() == 'HTML') |
|
| 69 | 69 | { |
| 70 | - if(Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') > 0 && Context::get('act') != 'dispPageAdminContentModify' && Context::get('act') != 'dispPageAdminMobileContentModify') |
|
| 70 | + if (Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') > 0 && Context::get('act') != 'dispPageAdminContentModify' && Context::get('act') != 'dispPageAdminMobileContentModify') |
|
| 71 | 71 | { |
| 72 | - $output = '<div class="x">' . $output . '</div>'; |
|
| 72 | + $output = '<div class="x">'.$output.'</div>'; |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - if(Context::get('layout') != 'none') |
|
| 75 | + if (Context::get('layout') != 'none') |
|
| 76 | 76 | { |
| 77 | - if(__DEBUG__ == 3) |
|
| 77 | + if (__DEBUG__ == 3) |
|
| 78 | 78 | { |
| 79 | 79 | $start = getMicroTime(); |
| 80 | 80 | } |
@@ -92,11 +92,11 @@ discard block |
||
| 92 | 92 | $layout_srl = $layout_info->layout_srl; |
| 93 | 93 | |
| 94 | 94 | // compile if connected to the layout |
| 95 | - if($layout_srl > 0) |
|
| 95 | + if ($layout_srl > 0) |
|
| 96 | 96 | { |
| 97 | 97 | |
| 98 | 98 | // handle separately if the layout is faceoff |
| 99 | - if($layout_info && $layout_info->type == 'faceoff') |
|
| 99 | + if ($layout_info && $layout_info->type == 'faceoff') |
|
| 100 | 100 | { |
| 101 | 101 | $oLayoutModel->doActivateFaceOff($layout_info); |
| 102 | 102 | Context::set('layout_info', $layout_info); |
@@ -105,16 +105,16 @@ discard block |
||
| 105 | 105 | // search if the changes CSS exists in the admin layout edit window |
| 106 | 106 | $edited_layout_css = $oLayoutModel->getUserLayoutCss($layout_srl); |
| 107 | 107 | |
| 108 | - if(FileHandler::exists($edited_layout_css)) |
|
| 108 | + if (FileHandler::exists($edited_layout_css)) |
|
| 109 | 109 | { |
| 110 | 110 | Context::loadFile(array($edited_layout_css, 'all', '', 100)); |
| 111 | 111 | } |
| 112 | 112 | } |
| 113 | - if(!$layout_path) |
|
| 113 | + if (!$layout_path) |
|
| 114 | 114 | { |
| 115 | 115 | $layout_path = './common/tpl'; |
| 116 | 116 | } |
| 117 | - if(!$layout_file) |
|
| 117 | + if (!$layout_file) |
|
| 118 | 118 | { |
| 119 | 119 | $layout_file = 'default_layout'; |
| 120 | 120 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | // if popup_layout, remove admin bar. |
| 124 | 124 | $realLayoutPath = FileHandler::getRealPath($layout_path); |
| 125 | - if(substr_compare($realLayoutPath, '/', -1) !== 0) |
|
| 125 | + if (substr_compare($realLayoutPath, '/', -1) !== 0) |
|
| 126 | 126 | { |
| 127 | 127 | $realLayoutPath .= '/'; |
| 128 | 128 | } |
@@ -130,12 +130,12 @@ discard block |
||
| 130 | 130 | $pathInfo = pathinfo($layout_file); |
| 131 | 131 | $onlyLayoutFile = $pathInfo['filename']; |
| 132 | 132 | |
| 133 | - if(__DEBUG__ == 3) |
|
| 133 | + if (__DEBUG__ == 3) |
|
| 134 | 134 | { |
| 135 | 135 | $GLOBALS['__layout_compile_elapsed__'] = getMicroTime() - $start; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - if(stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE && (Context::get('_use_ssl') == 'optional' || Context::get('_use_ssl') == 'always')) |
|
| 138 | + if (stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE && (Context::get('_use_ssl') == 'optional' || Context::get('_use_ssl') == 'always')) |
|
| 139 | 139 | { |
| 140 | 140 | Context::addHtmlFooter('<iframe id="xeTmpIframe" name="xeTmpIframe" style="width:1px;height:1px;position:absolute;top:-2px;left:-2px;"></iframe>'); |
| 141 | 141 | } |
@@ -151,12 +151,12 @@ discard block |
||
| 151 | 151 | */ |
| 152 | 152 | function prepareToPrint(&$output) |
| 153 | 153 | { |
| 154 | - if(Context::getResponseMethod() != 'HTML') |
|
| 154 | + if (Context::getResponseMethod() != 'HTML') |
|
| 155 | 155 | { |
| 156 | 156 | return; |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | - if(__DEBUG__ == 3) |
|
| 159 | + if (__DEBUG__ == 3) |
|
| 160 | 160 | { |
| 161 | 161 | $start = getMicroTime(); |
| 162 | 162 | } |
@@ -174,20 +174,20 @@ discard block |
||
| 174 | 174 | $output = preg_replace_callback('/<!--(#)?Meta:([a-z0-9\_\-\/\.\@\:]+)-->/is', array($this, '_transMeta'), $output); |
| 175 | 175 | |
| 176 | 176 | // handles a relative path generated by using the rewrite module |
| 177 | - if(Context::isAllowRewrite()) |
|
| 177 | + if (Context::isAllowRewrite()) |
|
| 178 | 178 | { |
| 179 | 179 | $url = parse_url(Context::getRequestUri()); |
| 180 | 180 | $real_path = $url['path']; |
| 181 | 181 | |
| 182 | 182 | $pattern = '/src=("|\'){1}(?:\.\/)?((?:files\/(?:attach|cache|faceOff|member_extra_info|thumbnails)|addons|common|(?:m\.)?layouts|modules|widgets|widgetstyle)\/[^"\']+)("|\'){1}/s'; |
| 183 | - $output = preg_replace($pattern, 'src=$1' . $real_path . '$2$3', $output); |
|
| 183 | + $output = preg_replace($pattern, 'src=$1'.$real_path.'$2$3', $output); |
|
| 184 | 184 | |
| 185 | 185 | $pattern = '/href=("|\'){1}(\?[^"\']+)/s'; |
| 186 | - $output = preg_replace($pattern, 'href=$1' . $real_path . '$2', $output); |
|
| 186 | + $output = preg_replace($pattern, 'href=$1'.$real_path.'$2', $output); |
|
| 187 | 187 | |
| 188 | - if(Context::get('vid')) |
|
| 188 | + if (Context::get('vid')) |
|
| 189 | 189 | { |
| 190 | - $pattern = '/\/' . Context::get('vid') . '\?([^=]+)=/is'; |
|
| 190 | + $pattern = '/\/'.Context::get('vid').'\?([^=]+)=/is'; |
|
| 191 | 191 | $output = preg_replace($pattern, '/?$1=', $output); |
| 192 | 192 | } |
| 193 | 193 | } |
@@ -195,18 +195,18 @@ discard block |
||
| 195 | 195 | // prevent the 2nd request due to url(none) of the background-image |
| 196 | 196 | $output = preg_replace('/url\((["\']?)none(["\']?)\)/is', 'none', $output); |
| 197 | 197 | |
| 198 | - if(is_array(Context::get('INPUT_ERROR'))) |
|
| 198 | + if (is_array(Context::get('INPUT_ERROR'))) |
|
| 199 | 199 | { |
| 200 | 200 | $INPUT_ERROR = Context::get('INPUT_ERROR'); |
| 201 | 201 | $keys = array_keys($INPUT_ERROR); |
| 202 | - $keys = '(' . implode('|', $keys) . ')'; |
|
| 202 | + $keys = '('.implode('|', $keys).')'; |
|
| 203 | 203 | |
| 204 | - $output = preg_replace_callback('@(<input)([^>]*?)\sname="' . $keys . '"([^>]*?)/?>@is', array(&$this, '_preserveValue'), $output); |
|
| 205 | - $output = preg_replace_callback('@<select[^>]*\sname="' . $keys . '".+</select>@isU', array(&$this, '_preserveSelectValue'), $output); |
|
| 206 | - $output = preg_replace_callback('@<textarea[^>]*\sname="' . $keys . '".+</textarea>@isU', array(&$this, '_preserveTextAreaValue'), $output); |
|
| 204 | + $output = preg_replace_callback('@(<input)([^>]*?)\sname="'.$keys.'"([^>]*?)/?>@is', array(&$this, '_preserveValue'), $output); |
|
| 205 | + $output = preg_replace_callback('@<select[^>]*\sname="'.$keys.'".+</select>@isU', array(&$this, '_preserveSelectValue'), $output); |
|
| 206 | + $output = preg_replace_callback('@<textarea[^>]*\sname="'.$keys.'".+</textarea>@isU', array(&$this, '_preserveTextAreaValue'), $output); |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - if(__DEBUG__ == 3) |
|
| 209 | + if (__DEBUG__ == 3) |
|
| 210 | 210 | { |
| 211 | 211 | $GLOBALS['__trans_content_elapsed__'] = getMicroTime() - $start; |
| 212 | 212 | } |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | // convert the final layout |
| 225 | 225 | Context::set('content', $output); |
| 226 | 226 | $oTemplate = TemplateHandler::getInstance(); |
| 227 | - if(Mobile::isFromMobilePhone()) |
|
| 227 | + if (Mobile::isFromMobilePhone()) |
|
| 228 | 228 | { |
| 229 | 229 | $this->_loadMobileJSCSS(); |
| 230 | 230 | $output = $oTemplate->compile('./common/tpl', 'mobile_layout'); |
@@ -249,16 +249,16 @@ discard block |
||
| 249 | 249 | { |
| 250 | 250 | $INPUT_ERROR = Context::get('INPUT_ERROR'); |
| 251 | 251 | |
| 252 | - $str = $match[1] . $match[2] . ' name="' . $match[3] . '"' . $match[4]; |
|
| 252 | + $str = $match[1].$match[2].' name="'.$match[3].'"'.$match[4]; |
|
| 253 | 253 | |
| 254 | 254 | // get type |
| 255 | 255 | $type = 'text'; |
| 256 | - if(preg_match('/\stype="([a-z]+)"/i', $str, $m)) |
|
| 256 | + if (preg_match('/\stype="([a-z]+)"/i', $str, $m)) |
|
| 257 | 257 | { |
| 258 | 258 | $type = strtolower($m[1]); |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | - switch($type) |
|
| 261 | + switch ($type) |
|
| 262 | 262 | { |
| 263 | 263 | case 'text': |
| 264 | 264 | case 'hidden': |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | case 'number': |
| 277 | 277 | case 'range': |
| 278 | 278 | case 'color': |
| 279 | - $str = preg_replace('@\svalue="[^"]*?"@', ' ', $str) . ' value="' . htmlspecialchars($INPUT_ERROR[$match[3]], ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '"'; |
|
| 279 | + $str = preg_replace('@\svalue="[^"]*?"@', ' ', $str).' value="'.htmlspecialchars($INPUT_ERROR[$match[3]], ENT_COMPAT | ENT_HTML401, 'UTF-8', false).'"'; |
|
| 280 | 280 | break; |
| 281 | 281 | case 'password': |
| 282 | 282 | $str = preg_replace('@\svalue="[^"]*?"@', ' ', $str); |
@@ -284,14 +284,14 @@ discard block |
||
| 284 | 284 | case 'radio': |
| 285 | 285 | case 'checkbox': |
| 286 | 286 | $str = preg_replace('@\schecked(="[^"]*?")?@', ' ', $str); |
| 287 | - if(@preg_match('@\s(?i:value)="' . $INPUT_ERROR[$match[3]] . '"@', $str)) |
|
| 287 | + if (@preg_match('@\s(?i:value)="'.$INPUT_ERROR[$match[3]].'"@', $str)) |
|
| 288 | 288 | { |
| 289 | 289 | $str .= ' checked="checked"'; |
| 290 | 290 | } |
| 291 | 291 | break; |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | - return $str . ' />'; |
|
| 294 | + return $str.' />'; |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | /** |
@@ -308,14 +308,14 @@ discard block |
||
| 308 | 308 | preg_match_all('@<option[^>]*\svalue="([^"]*)".+</option>@isU', $matches[0], $m); |
| 309 | 309 | |
| 310 | 310 | $key = array_search($INPUT_ERROR[$matches[1]], $m[1]); |
| 311 | - if($key === FALSE) |
|
| 311 | + if ($key === FALSE) |
|
| 312 | 312 | { |
| 313 | 313 | return $matches[0]; |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | $m[0][$key] = preg_replace('@(\svalue=".*?")@is', '$1 selected="selected"', $m[0][$key]); |
| 317 | 317 | |
| 318 | - return $mm[0] . implode('', $m[0]) . '</select>'; |
|
| 318 | + return $mm[0].implode('', $m[0]).'</select>'; |
|
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | /** |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | { |
| 328 | 328 | $INPUT_ERROR = Context::get('INPUT_ERROR'); |
| 329 | 329 | preg_match('@<textarea.*?>@is', $matches[0], $mm); |
| 330 | - return $mm[0] . $INPUT_ERROR[$matches[1]] . '</textarea>'; |
|
| 330 | + return $mm[0].$INPUT_ERROR[$matches[1]].'</textarea>'; |
|
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | /** |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | */ |
| 339 | 339 | function _moveStyleToHeader($matches) |
| 340 | 340 | { |
| 341 | - if(isset($matches[1]) && stristr($matches[1], 'scoped')) |
|
| 341 | + if (isset($matches[1]) && stristr($matches[1], 'scoped')) |
|
| 342 | 342 | { |
| 343 | 343 | return $matches[0]; |
| 344 | 344 | } |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | */ |
| 375 | 375 | function _transMeta($matches) |
| 376 | 376 | { |
| 377 | - if($matches[1]) |
|
| 377 | + if ($matches[1]) |
|
| 378 | 378 | { |
| 379 | 379 | return ''; |
| 380 | 380 | } |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | $lang_type = Context::getLangType(); |
| 392 | 392 | |
| 393 | 393 | // add common JS/CSS files |
| 394 | - if(__DEBUG__ || !__XE_VERSION_STABLE__) |
|
| 394 | + if (__DEBUG__ || !__XE_VERSION_STABLE__) |
|
| 395 | 395 | { |
| 396 | 396 | $oContext->loadFile(array('./common/js/jquery-1.x.js', 'head', 'lt IE 9', -111000), true); |
| 397 | 397 | $oContext->loadFile(array('./common/js/jquery.js', 'head', 'gte IE 9', -110000), true); |
@@ -414,9 +414,9 @@ discard block |
||
| 414 | 414 | } |
| 415 | 415 | |
| 416 | 416 | // for admin page, add admin css |
| 417 | - if(Context::get('module') == 'admin' || strpos(Context::get('act'), 'Admin') > 0) |
|
| 417 | + if (Context::get('module') == 'admin' || strpos(Context::get('act'), 'Admin') > 0) |
|
| 418 | 418 | { |
| 419 | - if(__DEBUG__ || !__XE_VERSION_STABLE__) |
|
| 419 | + if (__DEBUG__ || !__XE_VERSION_STABLE__) |
|
| 420 | 420 | { |
| 421 | 421 | $oContext->loadFile(array('./modules/admin/tpl/css/admin.css', '', '', 10), true); |
| 422 | 422 | $oContext->loadFile(array("./modules/admin/tpl/css/admin_{$lang_type}.css", '', '', 10), true); |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | $lang_type = Context::getLangType(); |
| 449 | 449 | |
| 450 | 450 | // add common JS/CSS files |
| 451 | - if(__DEBUG__ || !__XE_VERSION_STABLE__) |
|
| 451 | + if (__DEBUG__ || !__XE_VERSION_STABLE__) |
|
| 452 | 452 | { |
| 453 | 453 | $oContext->loadFile(array('./common/js/jquery.js', 'head', '', -110000), true); |
| 454 | 454 | $oContext->loadFile(array('./common/js/modernizr.js', 'head', '', -100000), true); |