@@ -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'); |
| 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 | 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,7 +174,7 @@ 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']; |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | $pattern = '/href=("|\'){1}(\?[^"\']+)/s'; |
| 186 | 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 | 190 | $pattern = '/\/' . Context::get('vid') . '\?([^=]+)=/is'; |
| 191 | 191 | $output = preg_replace($pattern, '/?$1=', $output); |
@@ -195,7 +195,7 @@ 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); |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 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'); |
@@ -253,12 +253,12 @@ discard block |
||
| 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': |
@@ -284,7 +284,7 @@ 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 | } |
@@ -308,7 +308,7 @@ 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 | } |
@@ -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); |
@@ -413,9 +413,9 @@ discard block |
||
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | // for admin page, add admin css |
| 416 | - if(Context::get('module') == 'admin' || strpos(Context::get('act'), 'Admin') > 0) |
|
| 416 | + if (Context::get('module') == 'admin' || strpos(Context::get('act'), 'Admin') > 0) |
|
| 417 | 417 | { |
| 418 | - if(__DEBUG__ || !__XE_VERSION_STABLE__) |
|
| 418 | + if (__DEBUG__ || !__XE_VERSION_STABLE__) |
|
| 419 | 419 | { |
| 420 | 420 | $oContext->loadFile(array('./modules/admin/tpl/css/admin.css', '', '', 10), true); |
| 421 | 421 | $oContext->loadFile(array("./modules/admin/tpl/css/admin_{$lang_type}.css", '', '', 10), true); |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | $lang_type = Context::getLangType(); |
| 448 | 448 | |
| 449 | 449 | // add common JS/CSS files |
| 450 | - if(__DEBUG__ || !__XE_VERSION_STABLE__) |
|
| 450 | + if (__DEBUG__ || !__XE_VERSION_STABLE__) |
|
| 451 | 451 | { |
| 452 | 452 | $oContext->loadFile(array('./common/js/jquery.js', 'head', '', -110000), true); |
| 453 | 453 | $oContext->loadFile(array('./common/js/modernizr.js', 'head', '', -100000), true); |
@@ -23,8 +23,7 @@ discard block |
||
| 23 | 23 | if($oModule->module_info->module == $oModule->module) |
| 24 | 24 | { |
| 25 | 25 | $skin = $oModule->origin_module_info->skin; |
| 26 | - } |
|
| 27 | - else |
|
| 26 | + } else |
|
| 28 | 27 | { |
| 29 | 28 | $skin = $oModule->module_config->skin; |
| 30 | 29 | } |
@@ -44,13 +43,11 @@ discard block |
||
| 44 | 43 | $template_path = sprintf('%s/modules/%s/', $theme_path, $theme_skin[1]); |
| 45 | 44 | } |
| 46 | 45 | } |
| 47 | - } |
|
| 48 | - else |
|
| 46 | + } else |
|
| 49 | 47 | { |
| 50 | 48 | $template_path = $oModule->getTemplatePath(); |
| 51 | 49 | } |
| 52 | - } |
|
| 53 | - else |
|
| 50 | + } else |
|
| 54 | 51 | { |
| 55 | 52 | $template_path = $oModule->getTemplatePath(); |
| 56 | 53 | } |
@@ -228,8 +225,7 @@ discard block |
||
| 228 | 225 | { |
| 229 | 226 | $this->_loadMobileJSCSS(); |
| 230 | 227 | $output = $oTemplate->compile('./common/tpl', 'mobile_layout'); |
| 231 | - } |
|
| 232 | - else |
|
| 228 | + } else |
|
| 233 | 229 | { |
| 234 | 230 | $this->_loadJSCSS(); |
| 235 | 231 | $output = $oTemplate->compile('./common/tpl', 'common_layout'); |
@@ -402,8 +398,7 @@ discard block |
||
| 402 | 398 | $oContext->loadFile(array('./common/js/xml_handler.js', 'head', '', -100000), true); |
| 403 | 399 | $oContext->loadFile(array('./common/js/xml_js_filter.js', 'head', '', -100000), true); |
| 404 | 400 | $oContext->loadFile(array('./common/css/xe.css', '', '', -1000000), true); |
| 405 | - } |
|
| 406 | - else |
|
| 401 | + } else |
|
| 407 | 402 | { |
| 408 | 403 | $oContext->loadFile(array('./common/js/jquery-1.x.min.js', 'head', 'lt IE 9', -111000), true); |
| 409 | 404 | $oContext->loadFile(array('./common/js/jquery.min.js', 'head', 'gte IE 9', -110000), true); |
@@ -424,8 +419,7 @@ discard block |
||
| 424 | 419 | $oContext->loadFile(array('./modules/admin/tpl/css/admin.bootstrap.css', '', '', 1), true); |
| 425 | 420 | $oContext->loadFile(array('./modules/admin/tpl/js/jquery.tmpl.js', '', '', 1), true); |
| 426 | 421 | $oContext->loadFile(array('./modules/admin/tpl/js/jquery.jstree.js', '', '', 1), true); |
| 427 | - } |
|
| 428 | - else |
|
| 422 | + } else |
|
| 429 | 423 | { |
| 430 | 424 | $oContext->loadFile(array('./modules/admin/tpl/css/admin.min.css', '', '', 10), true); |
| 431 | 425 | $oContext->loadFile(array("./modules/admin/tpl/css/admin_{$lang_type}.css", '', '', 10), true); |
@@ -458,8 +452,7 @@ discard block |
||
| 458 | 452 | $oContext->loadFile(array('./common/js/xml_js_filter.js', 'head', '', -100000), true); |
| 459 | 453 | $oContext->loadFile(array('./common/css/xe.css', '', '', -1000000), true); |
| 460 | 454 | $oContext->loadFile(array('./common/css/mobile.css', '', '', -1000000), true); |
| 461 | - } |
|
| 462 | - else |
|
| 455 | + } else |
|
| 463 | 456 | { |
| 464 | 457 | $oContext->loadFile(array('./common/js/jquery.min.js', 'head', '', -110000), true); |
| 465 | 458 | $oContext->loadFile(array('./common/js/x.min.js', 'head', '', -100000), true); |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * get layout setting view. |
| 19 | - * @return void |
|
| 19 | + * @return string|null |
|
| 20 | 20 | */ |
| 21 | 21 | public function getLayoutAdminSetInfoView() |
| 22 | 22 | { |
@@ -17,19 +17,19 @@ discard block |
||
| 17 | 17 | $request_url = Context::getRequestUri(); |
| 18 | 18 | $output = new stdClass(); |
| 19 | 19 | |
| 20 | - if(substr_compare($request_url, '/', -1) !== 0) |
|
| 20 | + if (substr_compare($request_url, '/', -1) !== 0) |
|
| 21 | 21 | { |
| 22 | 22 | $request_url .= '/'; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - if($error === 0) |
|
| 25 | + if ($error === 0) |
|
| 26 | 26 | { |
| 27 | - if($message != 'success') |
|
| 27 | + if ($message != 'success') |
|
| 28 | 28 | { |
| 29 | 29 | $output->message = $message; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - if($redirect_url) |
|
| 32 | + if ($redirect_url) |
|
| 33 | 33 | { |
| 34 | 34 | $output->url = $redirect_url; |
| 35 | 35 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | else |
| 42 | 42 | { |
| 43 | - if($message != 'fail') |
|
| 43 | + if ($message != 'fail') |
|
| 44 | 44 | { |
| 45 | 45 | $output->message = $message; |
| 46 | 46 | } |
@@ -50,12 +50,12 @@ discard block |
||
| 50 | 50 | $html[] = '<script type="text/javascript">'; |
| 51 | 51 | $html[] = '//<![CDATA['; |
| 52 | 52 | |
| 53 | - if($output->message) |
|
| 53 | + if ($output->message) |
|
| 54 | 54 | { |
| 55 | 55 | $html[] = 'alert("' . $output->message . '");'; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - if($output->url) |
|
| 58 | + if ($output->url) |
|
| 59 | 59 | { |
| 60 | 60 | $url = preg_replace('/#(.+)$/i', '', $output->url); |
| 61 | 61 | $html[] = 'self.location.href = "' . $request_url . 'common/tpl/redirect.html?redirect_url=' . urlencode($url) . '";'; |
@@ -103,8 +103,7 @@ discard block |
||
| 103 | 103 | if($category->parent_srl) |
| 104 | 104 | { |
| 105 | 105 | $categoryList[$category->parent_srl]->children[] = & $categoryList[$key]; |
| 106 | - } |
|
| 107 | - else |
|
| 106 | + } else |
|
| 108 | 107 | { |
| 109 | 108 | $depth0[] = $key; |
| 110 | 109 | } |
@@ -324,8 +323,7 @@ discard block |
||
| 324 | 323 | if(method_exists($oModule, "moduleUninstall")) |
| 325 | 324 | { |
| 326 | 325 | return TRUE; |
| 327 | - } |
|
| 328 | - else |
|
| 326 | + } else |
|
| 329 | 327 | { |
| 330 | 328 | return FALSE; |
| 331 | 329 | } |
@@ -31,25 +31,25 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | function _makeXmlDoc($obj) |
| 33 | 33 | { |
| 34 | - if(!count($obj)) |
|
| 34 | + if (!count($obj)) |
|
| 35 | 35 | { |
| 36 | 36 | return; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | $xmlDoc = ''; |
| 40 | 40 | |
| 41 | - foreach($obj as $key => $val) |
|
| 41 | + foreach ($obj as $key => $val) |
|
| 42 | 42 | { |
| 43 | - if(is_numeric($key)) |
|
| 43 | + if (is_numeric($key)) |
|
| 44 | 44 | { |
| 45 | 45 | $key = 'item'; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - if(is_string($val)) |
|
| 48 | + if (is_string($val)) |
|
| 49 | 49 | { |
| 50 | 50 | $xmlDoc .= sprintf('<%s><![CDATA[%s]]></%s>%s', $key, $val, $key, "\n"); |
| 51 | 51 | } |
| 52 | - else if(!is_array($val) && !is_object($val)) |
|
| 52 | + else if (!is_array($val) && !is_object($val)) |
|
| 53 | 53 | { |
| 54 | 54 | $xmlDoc .= sprintf('<%s>%s</%s>%s', $key, $val, $key, "\n"); |
| 55 | 55 | } |
@@ -48,12 +48,10 @@ |
||
| 48 | 48 | if(is_string($val)) |
| 49 | 49 | { |
| 50 | 50 | $xmlDoc .= sprintf('<%s><![CDATA[%s]]></%s>%s', $key, $val, $key, "\n"); |
| 51 | - } |
|
| 52 | - else if(!is_array($val) && !is_object($val)) |
|
| 51 | + } else if(!is_array($val) && !is_object($val)) |
|
| 53 | 52 | { |
| 54 | 53 | $xmlDoc .= sprintf('<%s>%s</%s>%s', $key, $val, $key, "\n"); |
| 55 | - } |
|
| 56 | - else |
|
| 54 | + } else |
|
| 57 | 55 | { |
| 58 | 56 | $xmlDoc .= sprintf('<%s>%s%s</%s>%s', $key, "\n", $this->_makeXmlDoc($val), $key, "\n"); |
| 59 | 57 | } |
@@ -20,12 +20,12 @@ |
||
| 20 | 20 | { |
| 21 | 21 | Context::set('component_info', $info); |
| 22 | 22 | |
| 23 | - if(!$info->extra_vars) |
|
| 23 | + if (!$info->extra_vars) |
|
| 24 | 24 | { |
| 25 | 25 | return; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - foreach($info->extra_vars as $key => $val) |
|
| 28 | + foreach ($info->extra_vars as $key => $val) |
|
| 29 | 29 | { |
| 30 | 30 | $this->{$key} = trim($val->value); |
| 31 | 31 | } |
@@ -51,12 +51,12 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | function setExtraVarKeys($extra_keys) |
| 53 | 53 | { |
| 54 | - if(!is_array($extra_keys) || count($extra_keys) < 1) |
|
| 54 | + if (!is_array($extra_keys) || count($extra_keys) < 1) |
|
| 55 | 55 | { |
| 56 | 56 | return; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - foreach($extra_keys as $val) |
|
| 59 | + foreach ($extra_keys as $val) |
|
| 60 | 60 | { |
| 61 | 61 | $obj = new ExtraItem($val->module_srl, $val->idx, $val->name, $val->type, $val->default, $val->desc, $val->is_required, $val->search, $val->value, $val->eid); |
| 62 | 62 | $this->keys[$val->idx] = $obj; |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | function ExtraItem($module_srl, $idx, $name, $type = 'text', $default = null, $desc = '', $is_required = 'N', $search = 'N', $value = null, $eid = '') |
| 161 | 161 | { |
| 162 | - if(!$idx) |
|
| 162 | + if (!$idx) |
|
| 163 | 163 | { |
| 164 | 164 | return; |
| 165 | 165 | } |
@@ -197,36 +197,36 @@ discard block |
||
| 197 | 197 | function _getTypeValue($type, $value) |
| 198 | 198 | { |
| 199 | 199 | $value = trim($value); |
| 200 | - if(!isset($value)) |
|
| 200 | + if (!isset($value)) |
|
| 201 | 201 | { |
| 202 | 202 | return; |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | - switch($type) |
|
| 205 | + switch ($type) |
|
| 206 | 206 | { |
| 207 | 207 | case 'homepage' : |
| 208 | - if($value && !preg_match('/^([a-z]+):\/\//i', $value)) |
|
| 208 | + if ($value && !preg_match('/^([a-z]+):\/\//i', $value)) |
|
| 209 | 209 | { |
| 210 | 210 | $value = 'http://' . $value; |
| 211 | 211 | } |
| 212 | 212 | return htmlspecialchars($value, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); |
| 213 | 213 | |
| 214 | 214 | case 'tel' : |
| 215 | - if(is_array($value)) |
|
| 215 | + if (is_array($value)) |
|
| 216 | 216 | { |
| 217 | 217 | $values = $value; |
| 218 | 218 | } |
| 219 | - elseif(strpos($value, '|@|') !== FALSE) |
|
| 219 | + elseif (strpos($value, '|@|') !== FALSE) |
|
| 220 | 220 | { |
| 221 | 221 | $values = explode('|@|', $value); |
| 222 | 222 | } |
| 223 | - elseif(strpos($value, ',') !== FALSE) |
|
| 223 | + elseif (strpos($value, ',') !== FALSE) |
|
| 224 | 224 | { |
| 225 | 225 | $values = explode(',', $value); |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | $values = array_values($values); |
| 229 | - for($i = 0, $c = count($values); $i < $c; $i++) |
|
| 229 | + for ($i = 0, $c = count($values); $i < $c; $i++) |
|
| 230 | 230 | { |
| 231 | 231 | $values[$i] = trim(htmlspecialchars($values[$i], ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
| 232 | 232 | } |
@@ -235,15 +235,15 @@ discard block |
||
| 235 | 235 | case 'checkbox' : |
| 236 | 236 | case 'radio' : |
| 237 | 237 | case 'select' : |
| 238 | - if(is_array($value)) |
|
| 238 | + if (is_array($value)) |
|
| 239 | 239 | { |
| 240 | 240 | $values = $value; |
| 241 | 241 | } |
| 242 | - elseif(strpos($value, '|@|') !== FALSE) |
|
| 242 | + elseif (strpos($value, '|@|') !== FALSE) |
|
| 243 | 243 | { |
| 244 | 244 | $values = explode('|@|', $value); |
| 245 | 245 | } |
| 246 | - elseif(strpos($value, ',') !== FALSE) |
|
| 246 | + elseif (strpos($value, ',') !== FALSE) |
|
| 247 | 247 | { |
| 248 | 248 | $values = explode(',', $value); |
| 249 | 249 | } |
@@ -253,18 +253,18 @@ discard block |
||
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | $values = array_values($values); |
| 256 | - for($i = 0, $c = count($values); $i < $c; $i++) |
|
| 256 | + for ($i = 0, $c = count($values); $i < $c; $i++) |
|
| 257 | 257 | { |
| 258 | 258 | $values[$i] = trim(htmlspecialchars($values[$i], ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
| 259 | 259 | } |
| 260 | 260 | return $values; |
| 261 | 261 | |
| 262 | 262 | case 'kr_zip' : |
| 263 | - if(is_array($value)) |
|
| 263 | + if (is_array($value)) |
|
| 264 | 264 | { |
| 265 | 265 | $values = $value; |
| 266 | 266 | } |
| 267 | - elseif(strpos($value, '|@|') !== false) |
|
| 267 | + elseif (strpos($value, '|@|') !== false) |
|
| 268 | 268 | { |
| 269 | 269 | $values = explode('|@|', $value); |
| 270 | 270 | } |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | $values = array_values($values); |
| 277 | - for($i = 0, $c = count($values); $i < $c; $i++) |
|
| 277 | + for ($i = 0, $c = count($values); $i < $c; $i++) |
|
| 278 | 278 | { |
| 279 | 279 | $values[$i] = trim(htmlspecialchars($values[$i], ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
| 280 | 280 | } |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | { |
| 309 | 309 | $value = $this->_getTypeValue($this->type, $this->value); |
| 310 | 310 | |
| 311 | - switch($this->type) |
|
| 311 | + switch ($this->type) |
|
| 312 | 312 | { |
| 313 | 313 | case 'homepage' : |
| 314 | 314 | return ($value) ? (sprintf('<a href="%s" target="_blank">%s</a>', $value, strlen($value) > 60 ? substr($value, 0, 40) . '...' . substr($value, -10) : $value)) : ""; |
@@ -328,14 +328,14 @@ discard block |
||
| 328 | 328 | case 'checkbox' : |
| 329 | 329 | case 'select' : |
| 330 | 330 | case 'radio' : |
| 331 | - if(is_array($value)) |
|
| 331 | + if (is_array($value)) |
|
| 332 | 332 | { |
| 333 | 333 | return implode(',', $value); |
| 334 | 334 | } |
| 335 | 335 | return $value; |
| 336 | 336 | |
| 337 | 337 | case 'kr_zip' : |
| 338 | - if(is_array($value)) |
|
| 338 | + if (is_array($value)) |
|
| 339 | 339 | { |
| 340 | 340 | return implode(' ', $value); |
| 341 | 341 | } |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | $tmp_id = $column_name . '-' . $id_num++; |
| 365 | 365 | |
| 366 | 366 | $buff = array(); |
| 367 | - switch($type) |
|
| 367 | + switch ($type) |
|
| 368 | 368 | { |
| 369 | 369 | // Homepage |
| 370 | 370 | case 'homepage' : |
@@ -387,10 +387,10 @@ discard block |
||
| 387 | 387 | // multiple choice |
| 388 | 388 | case 'checkbox' : |
| 389 | 389 | $buff[] = '<ul>'; |
| 390 | - foreach($default as $v) |
|
| 390 | + foreach ($default as $v) |
|
| 391 | 391 | { |
| 392 | 392 | $checked = ''; |
| 393 | - if($value && in_array(trim($v), $value)) |
|
| 393 | + if ($value && in_array(trim($v), $value)) |
|
| 394 | 394 | { |
| 395 | 395 | $checked = ' checked="checked"'; |
| 396 | 396 | } |
@@ -398,17 +398,17 @@ discard block |
||
| 398 | 398 | // Temporary ID for labeling |
| 399 | 399 | $tmp_id = $column_name . '-' . $id_num++; |
| 400 | 400 | |
| 401 | - $buff[] =' <li><input type="checkbox" name="' . $column_name . '[]" id="' . $tmp_id . '" value="' . htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '" ' . $checked . ' /><label for="' . $tmp_id . '">' . $v . '</label></li>'; |
|
| 401 | + $buff[] = ' <li><input type="checkbox" name="' . $column_name . '[]" id="' . $tmp_id . '" value="' . htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '" ' . $checked . ' /><label for="' . $tmp_id . '">' . $v . '</label></li>'; |
|
| 402 | 402 | } |
| 403 | 403 | $buff[] = '</ul>'; |
| 404 | 404 | break; |
| 405 | 405 | // single choice |
| 406 | 406 | case 'select' : |
| 407 | 407 | $buff[] = '<select name="' . $column_name . '" class="select">'; |
| 408 | - foreach($default as $v) |
|
| 408 | + foreach ($default as $v) |
|
| 409 | 409 | { |
| 410 | 410 | $selected = ''; |
| 411 | - if($value && in_array(trim($v), $value)) |
|
| 411 | + if ($value && in_array(trim($v), $value)) |
|
| 412 | 412 | { |
| 413 | 413 | $selected = ' selected="selected"'; |
| 414 | 414 | } |
@@ -419,10 +419,10 @@ discard block |
||
| 419 | 419 | // radio |
| 420 | 420 | case 'radio' : |
| 421 | 421 | $buff[] = '<ul>'; |
| 422 | - foreach($default as $v) |
|
| 422 | + foreach ($default as $v) |
|
| 423 | 423 | { |
| 424 | 424 | $checked = ''; |
| 425 | - if($value && in_array(trim($v), $value)) |
|
| 425 | + if ($value && in_array(trim($v), $value)) |
|
| 426 | 426 | { |
| 427 | 427 | $checked = ' checked="checked"'; |
| 428 | 428 | } |
@@ -440,38 +440,38 @@ discard block |
||
| 440 | 440 | Context::loadJavascriptPlugin('ui.datepicker'); |
| 441 | 441 | |
| 442 | 442 | $buff[] = '<input type="hidden" name="' . $column_name . '" value="' . $value . '" />'; |
| 443 | - $buff[] = '<input type="text" id="date_' . $column_name . '" value="' . zdate($value, 'Y-m-d') . '" class="date" />'; |
|
| 444 | - $buff[] = '<input type="button" value="' . Context::getLang('cmd_delete') . '" class="btn" id="dateRemover_' . $column_name . '" />'; |
|
| 445 | - $buff[] = '<script type="text/javascript">'; |
|
| 443 | + $buff[] = '<input type="text" id="date_' . $column_name . '" value="' . zdate($value, 'Y-m-d') . '" class="date" />'; |
|
| 444 | + $buff[] = '<input type="button" value="' . Context::getLang('cmd_delete') . '" class="btn" id="dateRemover_' . $column_name . '" />'; |
|
| 445 | + $buff[] = '<script type="text/javascript">'; |
|
| 446 | 446 | $buff[] = '//<![CDATA['; |
| 447 | - $buff[] = '(function($){'; |
|
| 448 | - $buff[] = '$(function(){'; |
|
| 449 | - $buff[] = ' var option = { dateFormat: "yy-mm-dd", changeMonth:true, changeYear:true, gotoCurrent:false, yearRange:\'-100:+10\', onSelect:function(){'; |
|
| 450 | - $buff[] = ' $(this).prev(\'input[type="hidden"]\').val(this.value.replace(/-/g,""))}'; |
|
| 451 | - $buff[] = ' };'; |
|
| 452 | - $buff[] = ' $.extend(option,$.datepicker.regional[\'' . Context::getLangType() . '\']);'; |
|
| 453 | - $buff[] = ' $("#date_' . $column_name . '").datepicker(option);'; |
|
| 454 | - $buff[] = ' $("#dateRemover_' . $column_name . '").click(function(){'; |
|
| 455 | - $buff[] = ' $(this).siblings("input").val("");'; |
|
| 456 | - $buff[] = ' return false;'; |
|
| 457 | - $buff[] = ' })'; |
|
| 458 | - $buff[] = '});'; |
|
| 459 | - $buff[] = '})(jQuery);'; |
|
| 447 | + $buff[] = '(function($){'; |
|
| 448 | + $buff[] = '$(function(){'; |
|
| 449 | + $buff[] = ' var option = { dateFormat: "yy-mm-dd", changeMonth:true, changeYear:true, gotoCurrent:false, yearRange:\'-100:+10\', onSelect:function(){'; |
|
| 450 | + $buff[] = ' $(this).prev(\'input[type="hidden"]\').val(this.value.replace(/-/g,""))}'; |
|
| 451 | + $buff[] = ' };'; |
|
| 452 | + $buff[] = ' $.extend(option,$.datepicker.regional[\'' . Context::getLangType() . '\']);'; |
|
| 453 | + $buff[] = ' $("#date_' . $column_name . '").datepicker(option);'; |
|
| 454 | + $buff[] = ' $("#dateRemover_' . $column_name . '").click(function(){'; |
|
| 455 | + $buff[] = ' $(this).siblings("input").val("");'; |
|
| 456 | + $buff[] = ' return false;'; |
|
| 457 | + $buff[] = ' })'; |
|
| 458 | + $buff[] = '});'; |
|
| 459 | + $buff[] = '})(jQuery);'; |
|
| 460 | 460 | $buff[] = '//]]>'; |
| 461 | 461 | $buff[] = '</script>'; |
| 462 | 462 | break; |
| 463 | 463 | // address |
| 464 | 464 | case "kr_zip" : |
| 465 | - if(($oKrzipModel = getModel('krzip')) && method_exists($oKrzipModel , 'getKrzipCodeSearchHtml' )) |
|
| 465 | + if (($oKrzipModel = getModel('krzip')) && method_exists($oKrzipModel, 'getKrzipCodeSearchHtml')) |
|
| 466 | 466 | { |
| 467 | - $buff[] = $oKrzipModel->getKrzipCodeSearchHtml($column_name, $value); |
|
| 467 | + $buff[] = $oKrzipModel->getKrzipCodeSearchHtml($column_name, $value); |
|
| 468 | 468 | } |
| 469 | 469 | break; |
| 470 | 470 | // General text |
| 471 | 471 | default : |
| 472 | - $buff[] =' <input type="text" name="' . $column_name . '" value="' . ($value ? $value : $default) . '" class="text" />'; |
|
| 472 | + $buff[] = ' <input type="text" name="' . $column_name . '" value="' . ($value ? $value : $default) . '" class="text" />'; |
|
| 473 | 473 | } |
| 474 | - if($this->desc) |
|
| 474 | + if ($this->desc) |
|
| 475 | 475 | { |
| 476 | 476 | $oModuleController = getController('module'); |
| 477 | 477 | $oModuleController->replaceDefinedLangCode($this->desc); |
@@ -215,12 +215,10 @@ discard block |
||
| 215 | 215 | if(is_array($value)) |
| 216 | 216 | { |
| 217 | 217 | $values = $value; |
| 218 | - } |
|
| 219 | - elseif(strpos($value, '|@|') !== FALSE) |
|
| 218 | + } elseif(strpos($value, '|@|') !== FALSE) |
|
| 220 | 219 | { |
| 221 | 220 | $values = explode('|@|', $value); |
| 222 | - } |
|
| 223 | - elseif(strpos($value, ',') !== FALSE) |
|
| 221 | + } elseif(strpos($value, ',') !== FALSE) |
|
| 224 | 222 | { |
| 225 | 223 | $values = explode(',', $value); |
| 226 | 224 | } |
@@ -238,16 +236,13 @@ discard block |
||
| 238 | 236 | if(is_array($value)) |
| 239 | 237 | { |
| 240 | 238 | $values = $value; |
| 241 | - } |
|
| 242 | - elseif(strpos($value, '|@|') !== FALSE) |
|
| 239 | + } elseif(strpos($value, '|@|') !== FALSE) |
|
| 243 | 240 | { |
| 244 | 241 | $values = explode('|@|', $value); |
| 245 | - } |
|
| 246 | - elseif(strpos($value, ',') !== FALSE) |
|
| 242 | + } elseif(strpos($value, ',') !== FALSE) |
|
| 247 | 243 | { |
| 248 | 244 | $values = explode(',', $value); |
| 249 | - } |
|
| 250 | - else |
|
| 245 | + } else |
|
| 251 | 246 | { |
| 252 | 247 | $values = array($value); |
| 253 | 248 | } |
@@ -263,12 +258,10 @@ discard block |
||
| 263 | 258 | if(is_array($value)) |
| 264 | 259 | { |
| 265 | 260 | $values = $value; |
| 266 | - } |
|
| 267 | - elseif(strpos($value, '|@|') !== false) |
|
| 261 | + } elseif(strpos($value, '|@|') !== false) |
|
| 268 | 262 | { |
| 269 | 263 | $values = explode('|@|', $value); |
| 270 | - } |
|
| 271 | - else |
|
| 264 | + } else |
|
| 272 | 265 | { |
| 273 | 266 | $values = array($value); |
| 274 | 267 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | function FileObject($path, $mode) |
| 38 | 38 | { |
| 39 | - if($path != NULL) |
|
| 39 | + if ($path != NULL) |
|
| 40 | 40 | { |
| 41 | 41 | $this->Open($path, $mode); |
| 42 | 42 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | function append($file_name) |
| 52 | 52 | { |
| 53 | 53 | $target = new FileObject($file_name, "r"); |
| 54 | - while(!$target->feof()) |
|
| 54 | + while (!$target->feof()) |
|
| 55 | 55 | { |
| 56 | 56 | $readstr = $target->read(); |
| 57 | 57 | $this->write($readstr); |
@@ -89,11 +89,11 @@ discard block |
||
| 89 | 89 | function write($str) |
| 90 | 90 | { |
| 91 | 91 | $len = strlen($str); |
| 92 | - if(!$str || $len <= 0) |
|
| 92 | + if (!$str || $len <= 0) |
|
| 93 | 93 | { |
| 94 | 94 | return FALSE; |
| 95 | 95 | } |
| 96 | - if(!$this->fp) |
|
| 96 | + if (!$this->fp) |
|
| 97 | 97 | { |
| 98 | 98 | return FALSE; |
| 99 | 99 | } |
@@ -112,12 +112,12 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | function open($path, $mode) |
| 114 | 114 | { |
| 115 | - if($this->fp != NULL) |
|
| 115 | + if ($this->fp != NULL) |
|
| 116 | 116 | { |
| 117 | 117 | $this->close(); |
| 118 | 118 | } |
| 119 | 119 | $this->fp = fopen($path, $mode); |
| 120 | - if(!is_resource($this->fp)) |
|
| 120 | + if (!is_resource($this->fp)) |
|
| 121 | 121 | { |
| 122 | 122 | $this->fp = NULL; |
| 123 | 123 | return FALSE; |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | function getPath() |
| 135 | 135 | { |
| 136 | - if($this->fp != NULL) |
|
| 136 | + if ($this->fp != NULL) |
|
| 137 | 137 | { |
| 138 | 138 | return $this->path; |
| 139 | 139 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | */ |
| 151 | 151 | function close() |
| 152 | 152 | { |
| 153 | - if($this->fp != NULL) |
|
| 153 | + if ($this->fp != NULL) |
|
| 154 | 154 | { |
| 155 | 155 | fclose($this->fp); |
| 156 | 156 | $this->fp = NULL; |
@@ -21,8 +21,7 @@ |
||
| 21 | 21 | if($absolute_url) |
| 22 | 22 | { |
| 23 | 23 | return getFullUrl('','vid',$vid, 'mid',$mid, 'act',$format); |
| 24 | - } |
|
| 25 | - else |
|
| 24 | + } else |
|
| 26 | 25 | { |
| 27 | 26 | return getUrl('','vid',$vid, 'mid',$mid, 'act',$format); |
| 28 | 27 | } |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $this->SMTPSecure = "tls"; |
| 149 | 149 | $this->Host = 'smtp.gmail.com'; |
| 150 | 150 | $this->Port = '587'; |
| 151 | - if($this->isVaildMailAddress($account_name)) |
|
| 151 | + if ($this->isVaildMailAddress($account_name)) |
|
| 152 | 152 | { |
| 153 | 153 | $this->Username = $account_name; |
| 154 | 154 | } |
@@ -180,12 +180,12 @@ discard block |
||
| 180 | 180 | $this->Password = $pass; |
| 181 | 181 | $this->Port = $port; |
| 182 | 182 | |
| 183 | - if($secure == 'ssl' || $secure == 'tls') |
|
| 183 | + if ($secure == 'ssl' || $secure == 'tls') |
|
| 184 | 184 | { |
| 185 | 185 | $this->SMTPSecure = $secure; |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | - if(($this->SMTPAuth !== NULL && $this->Host !== NULL && $this->Username !== NULL && $this->Password !== NULL) || ($this->SMTPAuth === NULL && $this->Host !== NULL)) |
|
| 188 | + if (($this->SMTPAuth !== NULL && $this->Host !== NULL && $this->Username !== NULL && $this->Password !== NULL) || ($this->SMTPAuth === NULL && $this->Host !== NULL)) |
|
| 189 | 189 | { |
| 190 | 190 | $this->IsSMTP(); |
| 191 | 191 | $this->AltBody = "To view the message, please use an HTML compatible email viewer!"; |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | */ |
| 243 | 243 | function setSender($name, $email) |
| 244 | 244 | { |
| 245 | - if($this->Mailer == "mail") |
|
| 245 | + if ($this->Mailer == "mail") |
|
| 246 | 246 | { |
| 247 | 247 | $this->sender_name = $name; |
| 248 | 248 | $this->sender_email = $email; |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | */ |
| 261 | 261 | function getSender() |
| 262 | 262 | { |
| 263 | - if(!stristr(PHP_OS, 'win') && $this->sender_name) |
|
| 263 | + if (!stristr(PHP_OS, 'win') && $this->sender_name) |
|
| 264 | 264 | { |
| 265 | 265 | return sprintf("%s <%s>", '=?utf-8?b?' . base64_encode($this->sender_name) . '?=', $this->sender_email); |
| 266 | 266 | } |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | */ |
| 277 | 277 | function setReceiptor($name, $email) |
| 278 | 278 | { |
| 279 | - if($this->Mailer == "mail") |
|
| 279 | + if ($this->Mailer == "mail") |
|
| 280 | 280 | { |
| 281 | 281 | $this->receiptor_name = $name; |
| 282 | 282 | $this->receiptor_email = $email; |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | */ |
| 295 | 295 | function getReceiptor() |
| 296 | 296 | { |
| 297 | - if(!stristr(PHP_OS, 'win') && $this->receiptor_name && $this->receiptor_name != $this->receiptor_email) |
|
| 297 | + if (!stristr(PHP_OS, 'win') && $this->receiptor_name && $this->receiptor_name != $this->receiptor_email) |
|
| 298 | 298 | { |
| 299 | 299 | return sprintf("%s <%s>", '=?utf-8?b?' . base64_encode($this->receiptor_name) . '?=', $this->receiptor_email); |
| 300 | 300 | } |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | */ |
| 310 | 310 | function setTitle($title) |
| 311 | 311 | { |
| 312 | - if($this->Mailer == "mail") |
|
| 312 | + if ($this->Mailer == "mail") |
|
| 313 | 313 | { |
| 314 | 314 | $this->title = $title; |
| 315 | 315 | } |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | */ |
| 338 | 338 | function setBCC($bcc) |
| 339 | 339 | { |
| 340 | - if($this->Mailer == "mail") |
|
| 340 | + if ($this->Mailer == "mail") |
|
| 341 | 341 | { |
| 342 | 342 | $this->bcc = $bcc; |
| 343 | 343 | } |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | */ |
| 378 | 378 | function setReplyTo($replyTo) |
| 379 | 379 | { |
| 380 | - if($this->Mailer == "mail") |
|
| 380 | + if ($this->Mailer == "mail") |
|
| 381 | 381 | { |
| 382 | 382 | $this->replyTo = $replyTo; |
| 383 | 383 | } |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | function setContent($content) |
| 397 | 397 | { |
| 398 | 398 | $content = preg_replace_callback('/<img([^>]+)>/i', array($this, 'replaceResourceRealPath'), $content); |
| 399 | - if($this->Mailer == "mail") |
|
| 399 | + if ($this->Mailer == "mail") |
|
| 400 | 400 | { |
| 401 | 401 | $this->content = $content; |
| 402 | 402 | } |
@@ -456,9 +456,9 @@ discard block |
||
| 456 | 456 | */ |
| 457 | 457 | function procAttachments() |
| 458 | 458 | { |
| 459 | - if($this->Mailer == "mail") |
|
| 459 | + if ($this->Mailer == "mail") |
|
| 460 | 460 | { |
| 461 | - if(count($this->attachments) > 0) |
|
| 461 | + if (count($this->attachments) > 0) |
|
| 462 | 462 | { |
| 463 | 463 | $this->body = $this->header . $this->body; |
| 464 | 464 | $boundary = '----==' . uniqid(rand(), TRUE); |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | $this->body = "--" . $boundary . $this->eol . $this->body . $this->eol . $this->eol; |
| 467 | 467 | $res = array(); |
| 468 | 468 | $res[] = $this->body; |
| 469 | - foreach($this->attachments as $filename => $attachment) |
|
| 469 | + foreach ($this->attachments as $filename => $attachment) |
|
| 470 | 470 | { |
| 471 | 471 | $type = $this->returnMIMEType($filename); |
| 472 | 472 | $file_handler = new FileHandler(); |
@@ -489,9 +489,9 @@ discard block |
||
| 489 | 489 | } |
| 490 | 490 | else |
| 491 | 491 | { |
| 492 | - if(count($this->attachments) > 0) |
|
| 492 | + if (count($this->attachments) > 0) |
|
| 493 | 493 | { |
| 494 | - foreach($this->attachments as $filename => $attachment) |
|
| 494 | + foreach ($this->attachments as $filename => $attachment) |
|
| 495 | 495 | { |
| 496 | 496 | parent::AddAttachment($attachment); |
| 497 | 497 | } |
@@ -506,7 +506,7 @@ discard block |
||
| 506 | 506 | */ |
| 507 | 507 | function procCidAttachments() |
| 508 | 508 | { |
| 509 | - if(count($this->cidAttachments) > 0) |
|
| 509 | + if (count($this->cidAttachments) > 0) |
|
| 510 | 510 | { |
| 511 | 511 | $this->body = $this->header . $this->body; |
| 512 | 512 | $boundary = '----==' . uniqid(rand(), TRUE); |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | $this->body = "--" . $boundary . $this->eol . $this->body . $this->eol . $this->eol; |
| 515 | 515 | $res = array(); |
| 516 | 516 | $res[] = $this->body; |
| 517 | - foreach($this->cidAttachments as $cid => $attachment) |
|
| 517 | + foreach ($this->cidAttachments as $cid => $attachment) |
|
| 518 | 518 | { |
| 519 | 519 | $filename = basename($attachment); |
| 520 | 520 | $type = $this->returnMIMEType(FileHandler::getRealPath($attachment)); |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | */ |
| 544 | 544 | function send() |
| 545 | 545 | { |
| 546 | - if($this->Mailer == "mail") |
|
| 546 | + if ($this->Mailer == "mail") |
|
| 547 | 547 | { |
| 548 | 548 | $boundary = '----==' . uniqid(rand(), TRUE); |
| 549 | 549 | $this->eol = $GLOBALS['_qmail_compatibility'] == "Y" ? "\n" : "\r\n"; |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | "MIME-Version: 1.0" . $this->eol . "", $this->getSender(), $this->messageId ? ("Message-ID: <" . $this->messageId . ">" . $this->eol) : "", $this->replyTo ? ("Reply-To: <" . $this->replyTo . ">" . $this->eol) : "", $this->bcc ? ("Bcc: " . $this->bcc . $this->eol) : "", $this->references ? ("References: <" . $this->references . ">" . $this->eol . "In-Reply-To: <" . $this->references . ">" . $this->eol) : "" |
| 574 | 574 | ); |
| 575 | 575 | $headers .= $this->header; |
| 576 | - if($this->additional_params) |
|
| 576 | + if ($this->additional_params) |
|
| 577 | 577 | { |
| 578 | 578 | return mail($this->getReceiptor(), $this->getTitle(), $this->body, $headers, $this->additional_params); |
| 579 | 579 | } |
@@ -594,14 +594,14 @@ discard block |
||
| 594 | 594 | */ |
| 595 | 595 | function checkMailMX($email_address) |
| 596 | 596 | { |
| 597 | - if(!Mail::isVaildMailAddress($email_address)) |
|
| 597 | + if (!Mail::isVaildMailAddress($email_address)) |
|
| 598 | 598 | { |
| 599 | 599 | return FALSE; |
| 600 | 600 | } |
| 601 | 601 | list($user, $host) = explode("@", $email_address); |
| 602 | - if(function_exists('checkdnsrr')) |
|
| 602 | + if (function_exists('checkdnsrr')) |
|
| 603 | 603 | { |
| 604 | - if(checkdnsrr($host, "MX") || checkdnsrr($host, "A")) |
|
| 604 | + if (checkdnsrr($host, "MX") || checkdnsrr($host, "A")) |
|
| 605 | 605 | { |
| 606 | 606 | return TRUE; |
| 607 | 607 | } |
@@ -621,7 +621,7 @@ discard block |
||
| 621 | 621 | */ |
| 622 | 622 | function isVaildMailAddress($email_address) |
| 623 | 623 | { |
| 624 | - if(preg_match("/([a-z0-9\_\-\.]+)@([a-z0-9\_\-\.]+)/i", $email_address)) |
|
| 624 | + if (preg_match("/([a-z0-9\_\-\.]+)@([a-z0-9\_\-\.]+)/i", $email_address)) |
|
| 625 | 625 | { |
| 626 | 626 | return $email_address; |
| 627 | 627 | } |
@@ -640,7 +640,7 @@ discard block |
||
| 640 | 640 | function returnMIMEType($filename) |
| 641 | 641 | { |
| 642 | 642 | preg_match("|\.([a-z0-9]{2,4})$|i", $filename, $fileSuffix); |
| 643 | - switch(strtolower($fileSuffix[1])) |
|
| 643 | + switch (strtolower($fileSuffix[1])) |
|
| 644 | 644 | { |
| 645 | 645 | case "js" : |
| 646 | 646 | return "application/x-javascript"; |
@@ -708,7 +708,7 @@ discard block |
||
| 708 | 708 | case "swf" : |
| 709 | 709 | return "application/x-shockwave-flash"; |
| 710 | 710 | default : |
| 711 | - if(function_exists("mime_content_type")) |
|
| 711 | + if (function_exists("mime_content_type")) |
|
| 712 | 712 | { |
| 713 | 713 | $fileSuffix = mime_content_type($filename); |
| 714 | 714 | } |
@@ -151,8 +151,7 @@ discard block |
||
| 151 | 151 | if($this->isVaildMailAddress($account_name)) |
| 152 | 152 | { |
| 153 | 153 | $this->Username = $account_name; |
| 154 | - } |
|
| 155 | - else |
|
| 154 | + } else |
|
| 156 | 155 | { |
| 157 | 156 | $this->Username = $account_name . '@gmail.com'; |
| 158 | 157 | } |
@@ -190,8 +189,7 @@ discard block |
||
| 190 | 189 | $this->IsSMTP(); |
| 191 | 190 | $this->AltBody = "To view the message, please use an HTML compatible email viewer!"; |
| 192 | 191 | return TRUE; |
| 193 | - } |
|
| 194 | - else |
|
| 192 | + } else |
|
| 195 | 193 | { |
| 196 | 194 | $this->IsMail(); |
| 197 | 195 | return FALSE; |
@@ -246,8 +244,7 @@ discard block |
||
| 246 | 244 | { |
| 247 | 245 | $this->sender_name = $name; |
| 248 | 246 | $this->sender_email = $email; |
| 249 | - } |
|
| 250 | - else |
|
| 247 | + } else |
|
| 251 | 248 | { |
| 252 | 249 | $this->SetFrom($email, $name); |
| 253 | 250 | } |
@@ -280,8 +277,7 @@ discard block |
||
| 280 | 277 | { |
| 281 | 278 | $this->receiptor_name = $name; |
| 282 | 279 | $this->receiptor_email = $email; |
| 283 | - } |
|
| 284 | - else |
|
| 280 | + } else |
|
| 285 | 281 | { |
| 286 | 282 | $this->AddAddress($email, $name); |
| 287 | 283 | } |
@@ -312,8 +308,7 @@ discard block |
||
| 312 | 308 | if($this->Mailer == "mail") |
| 313 | 309 | { |
| 314 | 310 | $this->title = $title; |
| 315 | - } |
|
| 316 | - else |
|
| 311 | + } else |
|
| 317 | 312 | { |
| 318 | 313 | $this->Subject = $title; |
| 319 | 314 | } |
@@ -340,8 +335,7 @@ discard block |
||
| 340 | 335 | if($this->Mailer == "mail") |
| 341 | 336 | { |
| 342 | 337 | $this->bcc = $bcc; |
| 343 | - } |
|
| 344 | - else |
|
| 338 | + } else |
|
| 345 | 339 | { |
| 346 | 340 | $this->AddBCC($bcc); |
| 347 | 341 | } |
@@ -380,8 +374,7 @@ discard block |
||
| 380 | 374 | if($this->Mailer == "mail") |
| 381 | 375 | { |
| 382 | 376 | $this->replyTo = $replyTo; |
| 383 | - } |
|
| 384 | - else |
|
| 377 | + } else |
|
| 385 | 378 | { |
| 386 | 379 | $this->AddReplyTo($replyTo); |
| 387 | 380 | } |
@@ -399,8 +392,7 @@ discard block |
||
| 399 | 392 | if($this->Mailer == "mail") |
| 400 | 393 | { |
| 401 | 394 | $this->content = $content; |
| 402 | - } |
|
| 403 | - else |
|
| 395 | + } else |
|
| 404 | 396 | { |
| 405 | 397 | $this->MsgHTML($content); |
| 406 | 398 | } |
@@ -486,8 +478,7 @@ discard block |
||
| 486 | 478 | $this->body = implode("", $res); |
| 487 | 479 | $this->body .= "--" . $boundary . "--"; |
| 488 | 480 | } |
| 489 | - } |
|
| 490 | - else |
|
| 481 | + } else |
|
| 491 | 482 | { |
| 492 | 483 | if(count($this->attachments) > 0) |
| 493 | 484 | { |
@@ -578,8 +569,7 @@ discard block |
||
| 578 | 569 | return mail($this->getReceiptor(), $this->getTitle(), $this->body, $headers, $this->additional_params); |
| 579 | 570 | } |
| 580 | 571 | return mail($this->getReceiptor(), $this->getTitle(), $this->body, $headers); |
| 581 | - } |
|
| 582 | - else |
|
| 572 | + } else |
|
| 583 | 573 | { |
| 584 | 574 | $this->procAttachments(); |
| 585 | 575 | return parent::Send(); |
@@ -604,8 +594,7 @@ discard block |
||
| 604 | 594 | if(checkdnsrr($host, "MX") || checkdnsrr($host, "A")) |
| 605 | 595 | { |
| 606 | 596 | return TRUE; |
| 607 | - } |
|
| 608 | - else |
|
| 597 | + } else |
|
| 609 | 598 | { |
| 610 | 599 | return FALSE; |
| 611 | 600 | } |
@@ -624,8 +613,7 @@ discard block |
||
| 624 | 613 | if(preg_match("/([a-z0-9\_\-\.]+)@([a-z0-9\_\-\.]+)/i", $email_address)) |
| 625 | 614 | { |
| 626 | 615 | return $email_address; |
| 627 | - } |
|
| 628 | - else |
|
| 616 | + } else |
|
| 629 | 617 | { |
| 630 | 618 | return ''; |
| 631 | 619 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * constructor |
| 28 | - * @return void |
|
| 28 | + * @return string |
|
| 29 | 29 | */ |
| 30 | 30 | public function __construct() |
| 31 | 31 | { |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | function &getInstance() |
| 24 | 24 | { |
| 25 | 25 | static $theInstance; |
| 26 | - if(!isset($theInstance)) |
|
| 26 | + if (!isset($theInstance)) |
|
| 27 | 27 | { |
| 28 | 28 | $theInstance = new Mobile(); |
| 29 | 29 | } |
@@ -48,11 +48,11 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | function _isFromMobilePhone() |
| 50 | 50 | { |
| 51 | - if($this->ismobile !== NULL) |
|
| 51 | + if ($this->ismobile !== NULL) |
|
| 52 | 52 | { |
| 53 | 53 | return $this->ismobile; |
| 54 | 54 | } |
| 55 | - if(Mobile::isMobileEnabled() === false || Context::get('full_browse') || $_COOKIE["FullBrowse"]) |
|
| 55 | + if (Mobile::isMobileEnabled() === false || Context::get('full_browse') || $_COOKIE["FullBrowse"]) |
|
| 56 | 56 | { |
| 57 | 57 | return ($this->ismobile = false); |
| 58 | 58 | } |
@@ -63,22 +63,22 @@ discard block |
||
| 63 | 63 | $this->ismobile = FALSE; |
| 64 | 64 | |
| 65 | 65 | $m = Context::get('m'); |
| 66 | - if(strlen($m) == 1) |
|
| 66 | + if (strlen($m) == 1) |
|
| 67 | 67 | { |
| 68 | - if($m == "1") |
|
| 68 | + if ($m == "1") |
|
| 69 | 69 | { |
| 70 | 70 | $this->ismobile = TRUE; |
| 71 | 71 | } |
| 72 | - elseif($m == "0") |
|
| 72 | + elseif ($m == "0") |
|
| 73 | 73 | { |
| 74 | 74 | $this->ismobile = FALSE; |
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | - elseif(isset($_COOKIE['mobile'])) |
|
| 77 | + elseif (isset($_COOKIE['mobile'])) |
|
| 78 | 78 | { |
| 79 | - if($_COOKIE['user-agent'] == md5($_SERVER['HTTP_USER_AGENT'])) |
|
| 79 | + if ($_COOKIE['user-agent'] == md5($_SERVER['HTTP_USER_AGENT'])) |
|
| 80 | 80 | { |
| 81 | - if($_COOKIE['mobile'] == 'true') |
|
| 81 | + if ($_COOKIE['mobile'] == 'true') |
|
| 82 | 82 | { |
| 83 | 83 | $this->ismobile = TRUE; |
| 84 | 84 | } |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | $this->ismobile = FALSE; |
| 93 | 93 | setcookie("mobile", FALSE, 0, $xe_web_path); |
| 94 | 94 | setcookie("user-agent", FALSE, 0, $xe_web_path); |
| 95 | - if(!$this->isMobilePadCheckByAgent() && $this->isMobileCheckByAgent()) |
|
| 95 | + if (!$this->isMobilePadCheckByAgent() && $this->isMobileCheckByAgent()) |
|
| 96 | 96 | { |
| 97 | 97 | $this->ismobile = TRUE; |
| 98 | 98 | } |
@@ -100,36 +100,36 @@ discard block |
||
| 100 | 100 | } |
| 101 | 101 | else |
| 102 | 102 | { |
| 103 | - if($this->isMobilePadCheckByAgent()) |
|
| 103 | + if ($this->isMobilePadCheckByAgent()) |
|
| 104 | 104 | { |
| 105 | 105 | $this->ismobile = FALSE; |
| 106 | 106 | } |
| 107 | 107 | else |
| 108 | 108 | { |
| 109 | - if($this->isMobileCheckByAgent()) |
|
| 109 | + if ($this->isMobileCheckByAgent()) |
|
| 110 | 110 | { |
| 111 | 111 | $this->ismobile = TRUE; |
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - if($this->ismobile !== NULL) |
|
| 116 | + if ($this->ismobile !== NULL) |
|
| 117 | 117 | { |
| 118 | - if($this->ismobile == TRUE) |
|
| 118 | + if ($this->ismobile == TRUE) |
|
| 119 | 119 | { |
| 120 | - if($_COOKIE['mobile'] != 'true') |
|
| 120 | + if ($_COOKIE['mobile'] != 'true') |
|
| 121 | 121 | { |
| 122 | 122 | $_COOKIE['mobile'] = 'true'; |
| 123 | 123 | setcookie("mobile", 'true', 0, $xe_web_path); |
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | - elseif($_COOKIE['mobile'] != 'false') |
|
| 126 | + elseif ($_COOKIE['mobile'] != 'false') |
|
| 127 | 127 | { |
| 128 | 128 | $_COOKIE['mobile'] = 'false'; |
| 129 | 129 | setcookie("mobile", 'false', 0, $xe_web_path); |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - if($_COOKIE['user-agent'] != md5($_SERVER['HTTP_USER_AGENT'])) |
|
| 132 | + if ($_COOKIE['user-agent'] != md5($_SERVER['HTTP_USER_AGENT'])) |
|
| 133 | 133 | { |
| 134 | 134 | setcookie("user-agent", md5($_SERVER['HTTP_USER_AGENT']), 0, $xe_web_path); |
| 135 | 135 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | function isMobileCheckByAgent() |
| 147 | 147 | { |
| 148 | 148 | static $UACheck; |
| 149 | - if(isset($UACheck)) |
|
| 149 | + if (isset($UACheck)) |
|
| 150 | 150 | { |
| 151 | 151 | return $UACheck; |
| 152 | 152 | } |
@@ -154,15 +154,15 @@ discard block |
||
| 154 | 154 | $oMobile = Mobile::getInstance(); |
| 155 | 155 | $mobileAgent = array('iPod', 'iPhone', 'Android', 'BlackBerry', 'SymbianOS', 'Bada', 'Tizen', 'Kindle', 'Wii', 'SCH-', 'SPH-', 'CANU-', 'Windows Phone', 'Windows CE', 'POLARIS', 'Palm', 'Dorothy Browser', 'Mobile', 'Opera Mobi', 'Opera Mini', 'Minimo', 'AvantGo', 'NetFront', 'Nokia', 'LGPlayer', 'SonyEricsson', 'HTC'); |
| 156 | 156 | |
| 157 | - if($oMobile->isMobilePadCheckByAgent()) |
|
| 157 | + if ($oMobile->isMobilePadCheckByAgent()) |
|
| 158 | 158 | { |
| 159 | 159 | $UACheck = TRUE; |
| 160 | 160 | return TRUE; |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | - foreach($mobileAgent as $agent) |
|
| 163 | + foreach ($mobileAgent as $agent) |
|
| 164 | 164 | { |
| 165 | - if(stripos($_SERVER['HTTP_USER_AGENT'], $agent) !== FALSE) |
|
| 165 | + if (stripos($_SERVER['HTTP_USER_AGENT'], $agent) !== FALSE) |
|
| 166 | 166 | { |
| 167 | 167 | $UACheck = TRUE; |
| 168 | 168 | return TRUE; |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | function isMobilePadCheckByAgent() |
| 181 | 181 | { |
| 182 | 182 | static $UACheck; |
| 183 | - if(isset($UACheck)) |
|
| 183 | + if (isset($UACheck)) |
|
| 184 | 184 | { |
| 185 | 185 | return $UACheck; |
| 186 | 186 | } |
@@ -190,21 +190,21 @@ discard block |
||
| 190 | 190 | // $exceptionAgent[0] contains exception agents for all exceptions. |
| 191 | 191 | $exceptionAgent = array(0 => array('Opera Mini', 'Opera Mobi'), 'Android' => 'Mobile'); |
| 192 | 192 | |
| 193 | - foreach($padAgent as $agent) |
|
| 193 | + foreach ($padAgent as $agent) |
|
| 194 | 194 | { |
| 195 | - if(strpos($_SERVER['HTTP_USER_AGENT'], $agent) !== FALSE) |
|
| 195 | + if (strpos($_SERVER['HTTP_USER_AGENT'], $agent) !== FALSE) |
|
| 196 | 196 | { |
| 197 | - if(!isset($exceptionAgent[$agent])) |
|
| 197 | + if (!isset($exceptionAgent[$agent])) |
|
| 198 | 198 | { |
| 199 | 199 | $UACheck = TRUE; |
| 200 | 200 | return TRUE; |
| 201 | 201 | } |
| 202 | - elseif(strpos($_SERVER['HTTP_USER_AGENT'], $exceptionAgent[$agent]) === FALSE) |
|
| 202 | + elseif (strpos($_SERVER['HTTP_USER_AGENT'], $exceptionAgent[$agent]) === FALSE) |
|
| 203 | 203 | { |
| 204 | 204 | // If the agent is the Android, that can be either tablet and mobile phone. |
| 205 | - foreach($exceptionAgent[0] as $val) |
|
| 205 | + foreach ($exceptionAgent[0] as $val) |
|
| 206 | 206 | { |
| 207 | - if(strpos($_SERVER['HTTP_USER_AGENT'], $val) !== FALSE) |
|
| 207 | + if (strpos($_SERVER['HTTP_USER_AGENT'], $val) !== FALSE) |
|
| 208 | 208 | { |
| 209 | 209 | $UACheck = FALSE; |
| 210 | 210 | return FALSE; |
@@ -68,26 +68,22 @@ discard block |
||
| 68 | 68 | if($m == "1") |
| 69 | 69 | { |
| 70 | 70 | $this->ismobile = TRUE; |
| 71 | - } |
|
| 72 | - elseif($m == "0") |
|
| 71 | + } elseif($m == "0") |
|
| 73 | 72 | { |
| 74 | 73 | $this->ismobile = FALSE; |
| 75 | 74 | } |
| 76 | - } |
|
| 77 | - elseif(isset($_COOKIE['mobile'])) |
|
| 75 | + } elseif(isset($_COOKIE['mobile'])) |
|
| 78 | 76 | { |
| 79 | 77 | if($_COOKIE['user-agent'] == md5($_SERVER['HTTP_USER_AGENT'])) |
| 80 | 78 | { |
| 81 | 79 | if($_COOKIE['mobile'] == 'true') |
| 82 | 80 | { |
| 83 | 81 | $this->ismobile = TRUE; |
| 84 | - } |
|
| 85 | - else |
|
| 82 | + } else |
|
| 86 | 83 | { |
| 87 | 84 | $this->ismobile = FALSE; |
| 88 | 85 | } |
| 89 | - } |
|
| 90 | - else |
|
| 86 | + } else |
|
| 91 | 87 | { |
| 92 | 88 | $this->ismobile = FALSE; |
| 93 | 89 | setcookie("mobile", FALSE, 0, $xe_web_path); |
@@ -97,14 +93,12 @@ discard block |
||
| 97 | 93 | $this->ismobile = TRUE; |
| 98 | 94 | } |
| 99 | 95 | } |
| 100 | - } |
|
| 101 | - else |
|
| 96 | + } else |
|
| 102 | 97 | { |
| 103 | 98 | if($this->isMobilePadCheckByAgent()) |
| 104 | 99 | { |
| 105 | 100 | $this->ismobile = FALSE; |
| 106 | - } |
|
| 107 | - else |
|
| 101 | + } else |
|
| 108 | 102 | { |
| 109 | 103 | if($this->isMobileCheckByAgent()) |
| 110 | 104 | { |
@@ -122,8 +116,7 @@ discard block |
||
| 122 | 116 | $_COOKIE['mobile'] = 'true'; |
| 123 | 117 | setcookie("mobile", 'true', 0, $xe_web_path); |
| 124 | 118 | } |
| 125 | - } |
|
| 126 | - elseif($_COOKIE['mobile'] != 'false') |
|
| 119 | + } elseif($_COOKIE['mobile'] != 'false') |
|
| 127 | 120 | { |
| 128 | 121 | $_COOKIE['mobile'] = 'false'; |
| 129 | 122 | setcookie("mobile", 'false', 0, $xe_web_path); |
@@ -198,8 +191,7 @@ discard block |
||
| 198 | 191 | { |
| 199 | 192 | $UACheck = TRUE; |
| 200 | 193 | return TRUE; |
| 201 | - } |
|
| 202 | - elseif(strpos($_SERVER['HTTP_USER_AGENT'], $exceptionAgent[$agent]) === FALSE) |
|
| 194 | + } elseif(strpos($_SERVER['HTTP_USER_AGENT'], $exceptionAgent[$agent]) === FALSE) |
|
| 203 | 195 | { |
| 204 | 196 | // If the agent is the Android, that can be either tablet and mobile phone. |
| 205 | 197 | foreach($exceptionAgent[0] as $val) |
@@ -39,18 +39,18 @@ discard block |
||
| 39 | 39 | $this->point = 0; |
| 40 | 40 | |
| 41 | 41 | $first_page = $cur_page - (int) ($page_count / 2); |
| 42 | - if($first_page < 1) |
|
| 42 | + if ($first_page < 1) |
|
| 43 | 43 | { |
| 44 | 44 | $first_page = 1; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - if($total_page > $page_count && $first_page + $page_count - 1 > $total_page) |
|
| 47 | + if ($total_page > $page_count && $first_page + $page_count - 1 > $total_page) |
|
| 48 | 48 | { |
| 49 | 49 | $first_page -= $first_page + $page_count - 1 - $total_page; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | $last_page = $total_page; |
| 53 | - if($last_page > $total_page) |
|
| 53 | + if ($last_page > $total_page) |
|
| 54 | 54 | { |
| 55 | 55 | $last_page = $total_page; |
| 56 | 56 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $this->first_page = $first_page; |
| 59 | 59 | $this->last_page = $last_page; |
| 60 | 60 | |
| 61 | - if($total_page < $this->page_count) |
|
| 61 | + if ($total_page < $this->page_count) |
|
| 62 | 62 | { |
| 63 | 63 | $this->page_count = $total_page; |
| 64 | 64 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | function getNextPage() |
| 72 | 72 | { |
| 73 | 73 | $page = $this->first_page + $this->point++; |
| 74 | - if($this->point > $this->page_count || $page > $this->last_page) |
|
| 74 | + if ($this->point > $this->page_count || $page > $this->last_page) |
|
| 75 | 75 | { |
| 76 | 76 | $page = 0; |
| 77 | 77 | } |