@@ -1,7 +1,9 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
| 3 | 3 | |
| 4 | -if(!defined("__XE__")) exit(); |
|
| 4 | +if(!defined("__XE__")) { |
|
| 5 | + exit(); |
|
| 6 | +} |
|
| 5 | 7 | |
| 6 | 8 | /** |
| 7 | 9 | * @file captcha.addon.php |
@@ -85,8 +87,7 @@ discard block |
||
| 85 | 87 | $_SESSION['XE_VALIDATOR_RETURN_URL'] = Context::get('error_return_url'); |
| 86 | 88 | $ModuleHandler->_setInputValueToSession(); |
| 87 | 89 | } |
| 88 | - } |
|
| 89 | - else |
|
| 90 | + } else |
|
| 90 | 91 | { |
| 91 | 92 | Context::addHtmlHeader('<script> |
| 92 | 93 | if(!captchaTargetAct) {var captchaTargetAct = [];} |
@@ -216,8 +217,7 @@ discard block |
||
| 216 | 217 | |
| 217 | 218 | $background_color = imagecolorallocate($im[$i + 1], 255, 255, 255); |
| 218 | 219 | imagecolortransparent($im[$i + 1], $background_color); |
| 219 | - } |
|
| 220 | - else |
|
| 220 | + } else |
|
| 221 | 221 | { |
| 222 | 222 | imagestring($im[$i + 1], (array_pop($ran) % 3) + 3, 2, (array_pop($ran) % 4), $str, $text_color); |
| 223 | 223 | } |
@@ -315,7 +315,9 @@ discard block |
||
| 315 | 315 | |
| 316 | 316 | function compareCaptcha() |
| 317 | 317 | { |
| 318 | - if(!in_array(Context::get('act'), $this->target_acts)) return true; |
|
| 318 | + if(!in_array(Context::get('act'), $this->target_acts)) { |
|
| 319 | + return true; |
|
| 320 | + } |
|
| 319 | 321 | |
| 320 | 322 | if($_SESSION['member_captcha_authed']) |
| 321 | 323 | { |
@@ -275,6 +275,9 @@ |
||
| 275 | 275 | exit(); |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | + /** |
|
| 279 | + * @param string $string |
|
| 280 | + */ |
|
| 278 | 281 | function createCaptchaAudio($string) |
| 279 | 282 | { |
| 280 | 283 | $data = ''; |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
| 3 | 3 | |
| 4 | -if(!defined("__XE__")) exit(); |
|
| 4 | +if (!defined("__XE__")) exit(); |
|
| 5 | 5 | |
| 6 | 6 | /** |
| 7 | 7 | * @file captcha.addon.php |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | * @brief Captcha for a particular action |
| 10 | 10 | * English alphabets and voice verification added |
| 11 | 11 | * */ |
| 12 | -if(!class_exists('AddonMemberCaptcha', false)) |
|
| 12 | +if (!class_exists('AddonMemberCaptcha', false)) |
|
| 13 | 13 | { |
| 14 | 14 | class AddonMemberCaptcha |
| 15 | 15 | { |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | function before_module_init(&$ModuleHandler) |
| 33 | 33 | { |
| 34 | 34 | $logged_info = Context::get('logged_info'); |
| 35 | - if($logged_info->is_admin == 'Y' || $logged_info->is_site_admin) |
|
| 35 | + if ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin) |
|
| 36 | 36 | { |
| 37 | 37 | return false; |
| 38 | 38 | } |
@@ -40,11 +40,11 @@ discard block |
||
| 40 | 40 | // { |
| 41 | 41 | // return false; |
| 42 | 42 | // } |
| 43 | - if($_SESSION['XE_VALIDATOR_ERROR'] == -1) |
|
| 43 | + if ($_SESSION['XE_VALIDATOR_ERROR'] == -1) |
|
| 44 | 44 | { |
| 45 | 45 | $_SESSION['member_captcha_authed'] = false; |
| 46 | 46 | } |
| 47 | - if($_SESSION['member_captcha_authed']) |
|
| 47 | + if ($_SESSION['member_captcha_authed']) |
|
| 48 | 48 | { |
| 49 | 49 | return false; |
| 50 | 50 | } |
@@ -52,26 +52,26 @@ discard block |
||
| 52 | 52 | $type = Context::get('captchaType'); |
| 53 | 53 | |
| 54 | 54 | $this->target_acts = array(); |
| 55 | - if($this->addon_info->apply_find_account == 'apply') |
|
| 55 | + if ($this->addon_info->apply_find_account == 'apply') |
|
| 56 | 56 | { |
| 57 | 57 | $this->target_acts[] = 'procMemberFindAccount'; |
| 58 | 58 | } |
| 59 | - if($this->addon_info->apply_resend_auth_mail == 'apply') |
|
| 59 | + if ($this->addon_info->apply_resend_auth_mail == 'apply') |
|
| 60 | 60 | { |
| 61 | 61 | $this->target_acts[] = 'procMemberResendAuthMail'; |
| 62 | 62 | } |
| 63 | - if($this->addon_info->apply_signup == 'apply') |
|
| 63 | + if ($this->addon_info->apply_signup == 'apply') |
|
| 64 | 64 | { |
| 65 | 65 | $this->target_acts[] = 'procMemberInsert'; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - if(Context::getRequestMethod() != 'XMLRPC' && Context::getRequestMethod() !== 'JSON') |
|
| 68 | + if (Context::getRequestMethod() != 'XMLRPC' && Context::getRequestMethod() !== 'JSON') |
|
| 69 | 69 | { |
| 70 | - if($type == 'inline') |
|
| 70 | + if ($type == 'inline') |
|
| 71 | 71 | { |
| 72 | - if(!$this->compareCaptcha()) |
|
| 72 | + if (!$this->compareCaptcha()) |
|
| 73 | 73 | { |
| 74 | - Context::loadLang(_XE_PATH_ . 'addons/captcha_member/lang'); |
|
| 74 | + Context::loadLang(_XE_PATH_.'addons/captcha_member/lang'); |
|
| 75 | 75 | $_SESSION['XE_VALIDATOR_ERROR'] = -1; |
| 76 | 76 | $_SESSION['XE_VALIDATOR_MESSAGE'] = Context::getLang('captcha_denied'); |
| 77 | 77 | $_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = 'error'; |
@@ -83,16 +83,16 @@ discard block |
||
| 83 | 83 | { |
| 84 | 84 | Context::addHtmlHeader('<script> |
| 85 | 85 | if(!captchaTargetAct) {var captchaTargetAct = [];} |
| 86 | - captchaTargetAct.push("' . implode('","', $this->target_acts) . '"); |
|
| 86 | + captchaTargetAct.push("' . implode('","', $this->target_acts).'"); |
|
| 87 | 87 | </script>'); |
| 88 | 88 | Context::loadFile(array('./addons/captcha/captcha.min.js', 'body', '', null), true); |
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | // compare session when calling actions such as writing a post or a comment on the board/issue tracker module |
| 93 | - if(!$_SESSION['member_captcha_authed'] && in_array(Context::get('act'), $this->target_acts)) |
|
| 93 | + if (!$_SESSION['member_captcha_authed'] && in_array(Context::get('act'), $this->target_acts)) |
|
| 94 | 94 | { |
| 95 | - Context::loadLang(_XE_PATH_ . 'addons/captcha_member/lang'); |
|
| 95 | + Context::loadLang(_XE_PATH_.'addons/captcha_member/lang'); |
|
| 96 | 96 | $ModuleHandler->error = "captcha_denied"; |
| 97 | 97 | } |
| 98 | 98 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | function createKeyword() |
| 103 | 103 | { |
| 104 | 104 | $type = Context::get('captchaType'); |
| 105 | - if($type == 'inline' && $_SESSION['captcha_keyword']) |
|
| 105 | + if ($type == 'inline' && $_SESSION['captcha_keyword']) |
|
| 106 | 106 | { |
| 107 | 107 | return; |
| 108 | 108 | } |
@@ -115,19 +115,19 @@ discard block |
||
| 115 | 115 | |
| 116 | 116 | function before_module_init_setCaptchaSession() |
| 117 | 117 | { |
| 118 | - if($_SESSION['member_captcha_authed']) |
|
| 118 | + if ($_SESSION['member_captcha_authed']) |
|
| 119 | 119 | { |
| 120 | 120 | return false; |
| 121 | 121 | } |
| 122 | 122 | // Load language files |
| 123 | - Context::loadLang(_XE_PATH_ . 'addons/captcha_member/lang'); |
|
| 123 | + Context::loadLang(_XE_PATH_.'addons/captcha_member/lang'); |
|
| 124 | 124 | // Generate keywords |
| 125 | 125 | $this->createKeyword(); |
| 126 | 126 | |
| 127 | 127 | $target = Context::getLang('target_captcha'); |
| 128 | 128 | header("Content-Type: text/xml; charset=UTF-8"); |
| 129 | 129 | header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); |
| 130 | - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
|
| 130 | + header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); |
|
| 131 | 131 | header("Cache-Control: no-store, no-cache, must-revalidate"); |
| 132 | 132 | header("Cache-Control: post-check=0, pre-check=0", false); |
| 133 | 133 | header("Pragma: no-cache"); |
@@ -144,11 +144,11 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | function before_module_init_captchaImage() |
| 146 | 146 | { |
| 147 | - if($_SESSION['member_captcha_authed']) |
|
| 147 | + if ($_SESSION['member_captcha_authed']) |
|
| 148 | 148 | { |
| 149 | 149 | return false; |
| 150 | 150 | } |
| 151 | - if(Context::get('renew')) |
|
| 151 | + if (Context::get('renew')) |
|
| 152 | 152 | { |
| 153 | 153 | $this->createKeyword(); |
| 154 | 154 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | function createCaptchaImage($string) |
| 171 | 171 | { |
| 172 | 172 | $arr = array(); |
| 173 | - for($i = 0, $c = strlen($string); $i < $c; $i++) |
|
| 173 | + for ($i = 0, $c = strlen($string); $i < $c; $i++) |
|
| 174 | 174 | { |
| 175 | 175 | $arr[] = $string{$i}; |
| 176 | 176 | } |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | shuffle($deg); |
| 193 | 193 | |
| 194 | 194 | // Create an image for each letter |
| 195 | - foreach($arr as $i => $str) |
|
| 195 | + foreach ($arr as $i => $str) |
|
| 196 | 196 | { |
| 197 | 197 | $im[$i + 1] = @imagecreate($w, $h); |
| 198 | 198 | $background_color = imagecolorallocate($im[$i + 1], 255, 255, 255); |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | $ran = range(1, 20); |
| 203 | 203 | shuffle($ran); |
| 204 | 204 | |
| 205 | - if(function_exists('imagerotate')) |
|
| 205 | + if (function_exists('imagerotate')) |
|
| 206 | 206 | { |
| 207 | 207 | imagestring($im[$i + 1], (array_pop($ran) % 3) + 3, 2, (array_pop($ran) % 8), $str, $text_color); |
| 208 | 208 | $im[$i + 1] = imagerotate($im[$i + 1], array_pop($deg), 0); |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | // Combine images of each character |
| 220 | - for($i = 1; $i < count($im); $i++) |
|
| 220 | + for ($i = 1; $i < count($im); $i++) |
|
| 221 | 221 | { |
| 222 | 222 | imagecopy($im[0], $im[$i], (($w + 2) * ($i - 1)), 0, 0, 0, $w, $h); |
| 223 | 223 | imagedestroy($im[$i]); |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | imagecopyresized($big, $im[0], 0, 0, 0, 0, ($w + 2) * $big_count * $c, $h * $big_count, ($w + 2) * $c, $h); |
| 230 | 230 | imagedestroy($im[0]); |
| 231 | 231 | |
| 232 | - if(function_exists('imageantialias')) |
|
| 232 | + if (function_exists('imageantialias')) |
|
| 233 | 233 | { |
| 234 | 234 | imageantialias($big, true); |
| 235 | 235 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | $h = $h * $big_count; |
| 242 | 242 | $d = array_pop($deg); |
| 243 | 243 | |
| 244 | - for($i = -abs($d); $i < $h + abs($d); $i = $i + 7) |
|
| 244 | + for ($i = -abs($d); $i < $h + abs($d); $i = $i + 7) |
|
| 245 | 245 | { |
| 246 | 246 | imageline($big, 0, $i + $d, $w, $i, $line_color); |
| 247 | 247 | } |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | $x = range(0, ($w - 10)); |
| 250 | 250 | shuffle($x); |
| 251 | 251 | |
| 252 | - for($i = 0; $i < 200; $i++) |
|
| 252 | + for ($i = 0; $i < 200; $i++) |
|
| 253 | 253 | { |
| 254 | 254 | imagesetpixel($big, $x[$i] % $w, $x[$i + 1] % $h, $line_color); |
| 255 | 255 | } |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | |
| 260 | 260 | function before_module_init_captchaAudio() |
| 261 | 261 | { |
| 262 | - if($_SESSION['member_captcha_authed']) |
|
| 262 | + if ($_SESSION['member_captcha_authed']) |
|
| 263 | 263 | { |
| 264 | 264 | return false; |
| 265 | 265 | } |
@@ -271,8 +271,8 @@ discard block |
||
| 271 | 271 | header("Content-Disposition: attachment; filename=\"captcha_audio.mp3\""); |
| 272 | 272 | header('Cache-Control: no-store, no-cache, must-revalidate'); |
| 273 | 273 | header('Expires: Sun, 1 Jan 2000 12:00:00 GMT'); |
| 274 | - header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT'); |
|
| 275 | - header('Content-Length: ' . strlen($data)); |
|
| 274 | + header('Last-Modified: '.gmdate('D, d M Y H:i:s').'GMT'); |
|
| 275 | + header('Content-Length: '.strlen($data)); |
|
| 276 | 276 | |
| 277 | 277 | echo $data; |
| 278 | 278 | Context::close(); |
@@ -283,17 +283,17 @@ discard block |
||
| 283 | 283 | { |
| 284 | 284 | $data = ''; |
| 285 | 285 | $_audio = './addons/captcha/audio/F_%s.mp3'; |
| 286 | - for($i = 0, $c = strlen($string); $i < $c; $i++) |
|
| 286 | + for ($i = 0, $c = strlen($string); $i < $c; $i++) |
|
| 287 | 287 | { |
| 288 | 288 | $_data = FileHandler::readFile(sprintf($_audio, $string{$i})); |
| 289 | 289 | |
| 290 | 290 | $start = rand(5, 68); // Random start in 4-byte header and 64 byte data |
| 291 | 291 | $datalen = strlen($_data) - $start - 256; // Last unchanged 256 bytes |
| 292 | 292 | |
| 293 | - for($j = $start; $j < $datalen; $j+=64) |
|
| 293 | + for ($j = $start; $j < $datalen; $j += 64) |
|
| 294 | 294 | { |
| 295 | 295 | $ch = ord($_data{$j}); |
| 296 | - if($ch < 9 || $ch > 119) |
|
| 296 | + if ($ch < 9 || $ch > 119) |
|
| 297 | 297 | { |
| 298 | 298 | continue; |
| 299 | 299 | } |
@@ -308,14 +308,14 @@ discard block |
||
| 308 | 308 | |
| 309 | 309 | function compareCaptcha() |
| 310 | 310 | { |
| 311 | - if(!in_array(Context::get('act'), $this->target_acts)) return true; |
|
| 311 | + if (!in_array(Context::get('act'), $this->target_acts)) return true; |
|
| 312 | 312 | |
| 313 | - if($_SESSION['member_captcha_authed']) |
|
| 313 | + if ($_SESSION['member_captcha_authed']) |
|
| 314 | 314 | { |
| 315 | 315 | return true; |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | - if(strtoupper($_SESSION['captcha_keyword']) == strtoupper(Context::get('secret_text'))) |
|
| 318 | + if (strtoupper($_SESSION['captcha_keyword']) == strtoupper(Context::get('secret_text'))) |
|
| 319 | 319 | { |
| 320 | 320 | $_SESSION['member_captcha_authed'] = true; |
| 321 | 321 | return true; |
@@ -328,14 +328,14 @@ discard block |
||
| 328 | 328 | |
| 329 | 329 | function before_module_init_captchaCompare() |
| 330 | 330 | { |
| 331 | - if(!$this->compareCaptcha()) |
|
| 331 | + if (!$this->compareCaptcha()) |
|
| 332 | 332 | { |
| 333 | 333 | return false; |
| 334 | 334 | } |
| 335 | 335 | |
| 336 | 336 | header("Content-Type: text/xml; charset=UTF-8"); |
| 337 | 337 | header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); |
| 338 | - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
|
| 338 | + header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); |
|
| 339 | 339 | header("Cache-Control: no-store, no-cache, must-revalidate"); |
| 340 | 340 | header("Cache-Control: post-check=0, pre-check=0", false); |
| 341 | 341 | header("Pragma: no-cache"); |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | unset($_SESSION['member_captcha_authed']); |
| 351 | 351 | $this->createKeyword(); |
| 352 | 352 | |
| 353 | - $swfURL = getUrl() . 'addons/captcha/swf/play.swf'; |
|
| 353 | + $swfURL = getUrl().'addons/captcha/swf/play.swf'; |
|
| 354 | 354 | Context::unloadFile('./addons/captcha/captcha.min.js'); |
| 355 | 355 | Context::loadFile(array('./addons/captcha/inline_captcha.js', 'body')); |
| 356 | 356 | |
@@ -388,18 +388,18 @@ discard block |
||
| 388 | 388 | |
| 389 | 389 | $oAddonMemberCaptcha = &$GLOBALS['__AddonMemberCaptcha__']; |
| 390 | 390 | |
| 391 | -if(method_exists($oAddonMemberCaptcha, $called_position)) |
|
| 391 | +if (method_exists($oAddonMemberCaptcha, $called_position)) |
|
| 392 | 392 | { |
| 393 | - if(!call_user_func_array(array(&$oAddonMemberCaptcha, $called_position), array(&$this))) |
|
| 393 | + if (!call_user_func_array(array(&$oAddonMemberCaptcha, $called_position), array(&$this))) |
|
| 394 | 394 | { |
| 395 | 395 | return false; |
| 396 | 396 | } |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | $addon_act = Context::get('captcha_action'); |
| 400 | -if($addon_act && method_exists($oAddonMemberCaptcha, $called_position . '_' . $addon_act)) |
|
| 400 | +if ($addon_act && method_exists($oAddonMemberCaptcha, $called_position.'_'.$addon_act)) |
|
| 401 | 401 | { |
| 402 | - if(!call_user_func_array(array(&$oAddonMemberCaptcha, $called_position . '_' . $addon_act), array(&$this))) |
|
| 402 | + if (!call_user_func_array(array(&$oAddonMemberCaptcha, $called_position.'_'.$addon_act), array(&$this))) |
|
| 403 | 403 | { |
| 404 | 404 | return false; |
| 405 | 405 | } |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
| 3 | 3 | |
| 4 | -if(!defined('__XE__')) |
|
| 4 | +if (!defined('__XE__')) |
|
| 5 | 5 | exit(); |
| 6 | 6 | |
| 7 | 7 | /** |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | * @brief Counter add-on |
| 11 | 11 | */ |
| 12 | 12 | // Execute if called_position is before_display_content |
| 13 | -if($called_position == 'before_module_init' && Context::get('module') != 'admin' && Context::getResponseMethod() == 'HTML' && Context::isInstalled() && !isCrawler()) |
|
| 13 | +if ($called_position == 'before_module_init' && Context::get('module') != 'admin' && Context::getResponseMethod() == 'HTML' && Context::isInstalled() && !isCrawler()) |
|
| 14 | 14 | { |
| 15 | 15 | $oCounterController = getController('counter'); |
| 16 | 16 | $oCounterController->counterExecute(); |
@@ -1,8 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
| 3 | 3 | |
| 4 | -if(!defined('__XE__')) |
|
| 4 | +if(!defined('__XE__')) { |
|
| 5 | 5 | exit(); |
| 6 | +} |
|
| 6 | 7 | |
| 7 | 8 | /** |
| 8 | 9 | * @file counter.addon.php |
@@ -1,8 +1,9 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
| 3 | 3 | |
| 4 | -if(!defined('__XE__')) |
|
| 4 | +if(!defined('__XE__')) { |
|
| 5 | 5 | exit(); |
| 6 | +} |
|
| 6 | 7 | |
| 7 | 8 | /** |
| 8 | 9 | * @file member_communication.addon.php |
@@ -44,8 +45,7 @@ discard block |
||
| 44 | 45 | $text = preg_replace('@\r?\n@', '\\n', addslashes(Context::getLang('alert_new_message_arrived'))); |
| 45 | 46 | Context::addHtmlFooter("<script type=\"text/javascript\">jQuery(function(){ xeNotifyMessage('{$text}','{$new_message_count}'); });</script>"); |
| 46 | 47 | } |
| 47 | -} |
|
| 48 | -elseif($this->act == 'getMemberMenu' && $called_position == 'before_module_proc') |
|
| 48 | +} elseif($this->act == 'getMemberMenu' && $called_position == 'before_module_proc') |
|
| 49 | 49 | { |
| 50 | 50 | $member_srl = Context::get('target_srl'); |
| 51 | 51 | $oCommunicationModel = getModel('communication'); |
@@ -60,8 +60,7 @@ discard block |
||
| 60 | 60 | // Display a list of friends |
| 61 | 61 | $oMemberController->addMemberPopupMenu(getUrl('', 'mid', $mid, 'act', 'dispCommunicationFriend'), 'cmd_view_friend', '', 'self'); |
| 62 | 62 | // If not, Add menus to send message and to add friends |
| 63 | - } |
|
| 64 | - else |
|
| 63 | + } else |
|
| 65 | 64 | { |
| 66 | 65 | // Get member information |
| 67 | 66 | $oMemberModel = getModel('member'); |
@@ -73,11 +72,13 @@ discard block |
||
| 73 | 72 | |
| 74 | 73 | $oMemberController = getController('member'); |
| 75 | 74 | // Add a menu for sending message |
| 76 | - if($logged_info->is_admin == 'Y' || $target_member_info->allow_message == 'Y' || ($target_member_info->allow_message == 'F' && $oCommunicationModel->isFriend($member_srl))) |
|
| 77 | - $oMemberController->addMemberPopupMenu(getUrl('', 'mid', Context::get('cur_mid'), 'act', 'dispCommunicationSendMessage', 'receiver_srl', $member_srl), 'cmd_send_message', '', 'popup'); |
|
| 75 | + if($logged_info->is_admin == 'Y' || $target_member_info->allow_message == 'Y' || ($target_member_info->allow_message == 'F' && $oCommunicationModel->isFriend($member_srl))) { |
|
| 76 | + $oMemberController->addMemberPopupMenu(getUrl('', 'mid', Context::get('cur_mid'), 'act', 'dispCommunicationSendMessage', 'receiver_srl', $member_srl), 'cmd_send_message', '', 'popup'); |
|
| 77 | + } |
|
| 78 | 78 | // Add a menu for listing friends (if a friend is new) |
| 79 | - if(!$oCommunicationModel->isAddedFriend($member_srl)) |
|
| 80 | - $oMemberController->addMemberPopupMenu(getUrl('', 'mid', Context::get('cur_mid'), 'act', 'dispCommunicationAddFriend', 'target_srl', $member_srl), 'cmd_add_friend', '', 'popup'); |
|
| 79 | + if(!$oCommunicationModel->isAddedFriend($member_srl)) { |
|
| 80 | + $oMemberController->addMemberPopupMenu(getUrl('', 'mid', Context::get('cur_mid'), 'act', 'dispCommunicationAddFriend', 'target_srl', $member_srl), 'cmd_add_friend', '', 'popup'); |
|
| 81 | + } |
|
| 81 | 82 | } |
| 82 | 83 | } |
| 83 | 84 | /* End of file member_communication.addon.php */ |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
| 3 | 3 | |
| 4 | -if(!defined('__XE__')) |
|
| 4 | +if (!defined('__XE__')) |
|
| 5 | 5 | exit(); |
| 6 | 6 | |
| 7 | 7 | /** |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | // Stop if non-logged-in user is |
| 17 | 17 | $logged_info = Context::get('logged_info'); |
| 18 | -if(!$logged_info|| isCrawler()) |
|
| 18 | +if (!$logged_info || isCrawler()) |
|
| 19 | 19 | { |
| 20 | 20 | return; |
| 21 | 21 | } |
@@ -23,35 +23,35 @@ discard block |
||
| 23 | 23 | /** |
| 24 | 24 | * Message/Friend munus are added on the pop-up window and member profile. Check if a new message is received |
| 25 | 25 | * */ |
| 26 | -if($this->module != 'member' && $called_position == 'before_module_init') |
|
| 26 | +if ($this->module != 'member' && $called_position == 'before_module_init') |
|
| 27 | 27 | { |
| 28 | 28 | // Load a language file from the communication module |
| 29 | - Context::loadLang(_XE_PATH_ . 'modules/communication/lang'); |
|
| 29 | + Context::loadLang(_XE_PATH_.'modules/communication/lang'); |
|
| 30 | 30 | // Add menus on the member login information |
| 31 | 31 | $oMemberController = getController('member'); |
| 32 | 32 | $oMemberController->addMemberMenu('dispCommunicationFriend', 'cmd_view_friend'); |
| 33 | 33 | $oMemberController->addMemberMenu('dispCommunicationMessages', 'cmd_view_message_box'); |
| 34 | 34 | |
| 35 | - $flag_file = _XE_PATH_ . 'files/member_extra_info/new_message_flags/' . getNumberingPath($logged_info->member_srl) . $logged_info->member_srl; |
|
| 36 | - if($addon_info->use_alarm != 'N' && file_exists($flag_file)) |
|
| 35 | + $flag_file = _XE_PATH_.'files/member_extra_info/new_message_flags/'.getNumberingPath($logged_info->member_srl).$logged_info->member_srl; |
|
| 36 | + if ($addon_info->use_alarm != 'N' && file_exists($flag_file)) |
|
| 37 | 37 | { |
| 38 | 38 | // Pop-up to display messages if a flag on new message is set |
| 39 | 39 | $new_message_count = (int) trim(FileHandler::readFile($flag_file)); |
| 40 | 40 | FileHandler::removeFile($flag_file); |
| 41 | - Context::loadLang(_XE_PATH_ . 'addons/member_communication/lang'); |
|
| 41 | + Context::loadLang(_XE_PATH_.'addons/member_communication/lang'); |
|
| 42 | 42 | Context::loadFile(array('./addons/member_communication/tpl/member_communication.js'), true); |
| 43 | 43 | |
| 44 | 44 | $text = preg_replace('@\r?\n@', '\\n', addslashes(Context::getLang('alert_new_message_arrived'))); |
| 45 | 45 | Context::addHtmlFooter("<script type=\"text/javascript\">jQuery(function(){ xeNotifyMessage('{$text}','{$new_message_count}'); });</script>"); |
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | -elseif($this->act == 'getMemberMenu' && $called_position == 'before_module_proc') |
|
| 48 | +elseif ($this->act == 'getMemberMenu' && $called_position == 'before_module_proc') |
|
| 49 | 49 | { |
| 50 | 50 | $member_srl = Context::get('target_srl'); |
| 51 | 51 | $oCommunicationModel = getModel('communication'); |
| 52 | 52 | |
| 53 | 53 | // Add a feature to display own message box. |
| 54 | - if($logged_info->member_srl == $member_srl) |
|
| 54 | + if ($logged_info->member_srl == $member_srl) |
|
| 55 | 55 | { |
| 56 | 56 | $mid = Context::get('cur_mid'); |
| 57 | 57 | $oMemberController = getController('member'); |
@@ -66,17 +66,17 @@ discard block |
||
| 66 | 66 | // Get member information |
| 67 | 67 | $oMemberModel = getModel('member'); |
| 68 | 68 | $target_member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); |
| 69 | - if(!$target_member_info->member_srl) |
|
| 69 | + if (!$target_member_info->member_srl) |
|
| 70 | 70 | { |
| 71 | 71 | return; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | $oMemberController = getController('member'); |
| 75 | 75 | // Add a menu for sending message |
| 76 | - if($logged_info->is_admin == 'Y' || $target_member_info->allow_message == 'Y' || ($target_member_info->allow_message == 'F' && $oCommunicationModel->isFriend($member_srl))) |
|
| 76 | + if ($logged_info->is_admin == 'Y' || $target_member_info->allow_message == 'Y' || ($target_member_info->allow_message == 'F' && $oCommunicationModel->isFriend($member_srl))) |
|
| 77 | 77 | $oMemberController->addMemberPopupMenu(getUrl('', 'mid', Context::get('cur_mid'), 'act', 'dispCommunicationSendMessage', 'receiver_srl', $member_srl), 'cmd_send_message', '', 'popup'); |
| 78 | 78 | // Add a menu for listing friends (if a friend is new) |
| 79 | - if(!$oCommunicationModel->isAddedFriend($member_srl)) |
|
| 79 | + if (!$oCommunicationModel->isAddedFriend($member_srl)) |
|
| 80 | 80 | $oMemberController->addMemberPopupMenu(getUrl('', 'mid', Context::get('cur_mid'), 'act', 'dispCommunicationAddFriend', 'target_srl', $member_srl), 'cmd_add_friend', '', 'popup'); |
| 81 | 81 | } |
| 82 | 82 | } |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
| 3 | 3 | |
| 4 | -if(!defined('__XE__')) |
|
| 4 | +if (!defined('__XE__')) |
|
| 5 | 5 | { |
| 6 | 6 | exit(); |
| 7 | 7 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | /** |
| 18 | 18 | * Just before displaying, change image name/ image mark |
| 19 | 19 | */ |
| 20 | -if($called_position != "before_display_content" || Context::get('act') == 'dispPageAdminContentModify' || Context::getResponseMethod() != 'HTML' || isCrawler()) |
|
| 20 | +if ($called_position != "before_display_content" || Context::get('act') == 'dispPageAdminContentModify' || Context::getResponseMethod() != 'HTML' || isCrawler()) |
|
| 21 | 21 | { |
| 22 | 22 | return; |
| 23 | 23 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | require_once('./addons/member_extra_info/member_extra_info.lib.php'); |
| 26 | 26 | // 1. Find a part <div class="member_MemberSerialNumber"> content </div> in the output document, change it to image name/mark by using MemberController::transImageName() |
| 27 | 27 | $temp_output = preg_replace_callback('!<(div|span|a)([^\>]*)member_([0-9]+)([^\>]*)>(.*?)\<\/(div|span|a)\>!is', 'memberTransImageName', $output); |
| 28 | -if($temp_output) |
|
| 28 | +if ($temp_output) |
|
| 29 | 29 | { |
| 30 | 30 | $output = $temp_output; |
| 31 | 31 | } |
@@ -40,7 +40,9 @@ discard block |
||
| 40 | 40 | **/ |
| 41 | 41 | function printTitle() |
| 42 | 42 | { |
| 43 | - if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); |
|
| 43 | + if($this->totalPage > $this->mobilePage) { |
|
| 44 | + $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); |
|
| 45 | + } |
|
| 44 | 46 | printf('<b><%s%s>%s', $this->title,$titlePageStr,"\n"); |
| 45 | 47 | } |
| 46 | 48 | |
@@ -54,11 +56,12 @@ discard block |
||
| 54 | 56 | { |
| 55 | 57 | foreach($this->getChilds() as $key => $val) |
| 56 | 58 | { |
| 57 | - if(!$val['link']) continue; |
|
| 59 | + if(!$val['link']) { |
|
| 60 | + continue; |
|
| 61 | + } |
|
| 58 | 62 | printf('<ce task=go label="%s" dest="%s">%s%s',Context::getLang('cmd_select'), $val['href'], $val['text'], "\n"); |
| 59 | 63 | } |
| 60 | - } |
|
| 61 | - else |
|
| 64 | + } else |
|
| 62 | 65 | { |
| 63 | 66 | printf('<wrap>%s<br>%s', $this->getContent(),"\n"); |
| 64 | 67 | } |
@@ -88,8 +91,7 @@ discard block |
||
| 88 | 91 | printf('<ce task=go label="%s" dest="%s">%s%s', $url->text, $url->url, $url->text, "\n"); |
| 89 | 92 | } |
| 90 | 93 | // Content Types |
| 91 | - } |
|
| 92 | - else |
|
| 94 | + } else |
|
| 93 | 95 | { |
| 94 | 96 | if($this->nextUrl) |
| 95 | 97 | { |
@@ -25,10 +25,10 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | print '<hdml version=3.0 ttl=0 markable=true>'; |
| 27 | 27 | print "\n"; |
| 28 | - print $this->hasChilds()?'<choice name=main>':'<display>'; |
|
| 28 | + print $this->hasChilds() ? '<choice name=main>' : '<display>'; |
|
| 29 | 29 | print "\n"; |
| 30 | 30 | |
| 31 | - if($this->upperUrl) |
|
| 31 | + if ($this->upperUrl) |
|
| 32 | 32 | { |
| 33 | 33 | $url = $this->upperUrl; |
| 34 | 34 | printf('<action type=soft1 task=go dest="%s" label="%s">%s', $url->url, $url->text, "\n"); |
@@ -40,8 +40,8 @@ discard block |
||
| 40 | 40 | **/ |
| 41 | 41 | function printTitle() |
| 42 | 42 | { |
| 43 | - if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); |
|
| 44 | - printf('<b><%s%s>%s', $this->title,$titlePageStr,"\n"); |
|
| 43 | + if ($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)", $this->mobilePage, $this->totalPage); |
|
| 44 | + printf('<b><%s%s>%s', $this->title, $titlePageStr, "\n"); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -50,17 +50,17 @@ discard block |
||
| 50 | 50 | **/ |
| 51 | 51 | function printContent() |
| 52 | 52 | { |
| 53 | - if($this->hasChilds()) |
|
| 53 | + if ($this->hasChilds()) |
|
| 54 | 54 | { |
| 55 | - foreach($this->getChilds() as $key => $val) |
|
| 55 | + foreach ($this->getChilds() as $key => $val) |
|
| 56 | 56 | { |
| 57 | - if(!$val['link']) continue; |
|
| 58 | - printf('<ce task=go label="%s" dest="%s">%s%s',Context::getLang('cmd_select'), $val['href'], $val['text'], "\n"); |
|
| 57 | + if (!$val['link']) continue; |
|
| 58 | + printf('<ce task=go label="%s" dest="%s">%s%s', Context::getLang('cmd_select'), $val['href'], $val['text'], "\n"); |
|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | else |
| 62 | 62 | { |
| 63 | - printf('<wrap>%s<br>%s', $this->getContent(),"\n"); |
|
| 63 | + printf('<wrap>%s<br>%s', $this->getContent(), "\n"); |
|
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
@@ -70,19 +70,19 @@ discard block |
||
| 70 | 70 | function printBtn() |
| 71 | 71 | { |
| 72 | 72 | // Menu Types |
| 73 | - if($this->hasChilds()) |
|
| 73 | + if ($this->hasChilds()) |
|
| 74 | 74 | { |
| 75 | - if($this->nextUrl) |
|
| 75 | + if ($this->nextUrl) |
|
| 76 | 76 | { |
| 77 | 77 | $url = $this->nextUrl; |
| 78 | 78 | printf('<ce task=go label="%s" dest="%s">%s%s', $url->text, $url->url, $url->text, "\n"); |
| 79 | 79 | } |
| 80 | - if($this->prevUrl) |
|
| 80 | + if ($this->prevUrl) |
|
| 81 | 81 | { |
| 82 | 82 | $url = $this->prevUrl; |
| 83 | 83 | printf('<ce task=go label="%s" dest="%s">%s%s', $url->text, $url->url, $url->text, "\n"); |
| 84 | 84 | } |
| 85 | - if($this->homeUrl) |
|
| 85 | + if ($this->homeUrl) |
|
| 86 | 86 | { |
| 87 | 87 | $url = $this->homeUrl; |
| 88 | 88 | printf('<ce task=go label="%s" dest="%s">%s%s', $url->text, $url->url, $url->text, "\n"); |
@@ -91,17 +91,17 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | else |
| 93 | 93 | { |
| 94 | - if($this->nextUrl) |
|
| 94 | + if ($this->nextUrl) |
|
| 95 | 95 | { |
| 96 | 96 | $url = $this->nextUrl; |
| 97 | 97 | printf('<a task=gosub label="%s" dest="%s">%s</a>', $url->text, $url->url, $url->text); |
| 98 | 98 | } |
| 99 | - if($this->prevUrl) |
|
| 99 | + if ($this->prevUrl) |
|
| 100 | 100 | { |
| 101 | 101 | $url = $this->prevUrl; |
| 102 | 102 | printf('<a task=gosub label="%s" dest="%s">%s</a>', $url->text, $url->url, $url->text); |
| 103 | 103 | } |
| 104 | - if($this->homeUrl) |
|
| 104 | + if ($this->homeUrl) |
|
| 105 | 105 | { |
| 106 | 106 | $url = $this->homeUrl; |
| 107 | 107 | printf('<a task=gosub label="%s" dest="%s">%s</a>', $url->text, $url->url, $url->text); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | **/ |
| 115 | 115 | function printFooter() |
| 116 | 116 | { |
| 117 | - print $this->hasChilds()?'</choice>':'</display>'; |
|
| 117 | + print $this->hasChilds() ? '</choice>' : '</display>'; |
|
| 118 | 118 | print "\n"; |
| 119 | 119 | print("</hdml>"); |
| 120 | 120 | } |
@@ -20,13 +20,17 @@ discard block |
||
| 20 | 20 | function printHeader() |
| 21 | 21 | { |
| 22 | 22 | print("<html><head>\n"); |
| 23 | - if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); |
|
| 23 | + if($this->totalPage > $this->mobilePage) { |
|
| 24 | + $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); |
|
| 25 | + } |
|
| 24 | 26 | printf("<title>%s%s</title></head><body>\n", htmlspecialchars($this->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false),htmlspecialchars($titlePageStr, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
| 25 | 27 | } |
| 26 | 28 | // Output title |
| 27 | 29 | function printTitle() |
| 28 | 30 | { |
| 29 | - if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); |
|
| 31 | + if($this->totalPage > $this->mobilePage) { |
|
| 32 | + $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); |
|
| 33 | + } |
|
| 30 | 34 | printf('<%s%s><br>%s', htmlspecialchars($this->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false),htmlspecialchars($titlePageStr, ENT_COMPAT | ENT_HTML401, 'UTF-8', false),"\n"); |
| 31 | 35 | } |
| 32 | 36 | |
@@ -40,12 +44,15 @@ discard block |
||
| 40 | 44 | { |
| 41 | 45 | foreach($this->getChilds() as $key => $val) |
| 42 | 46 | { |
| 43 | - if(!$val['link']) continue; |
|
| 47 | + if(!$val['link']) { |
|
| 48 | + continue; |
|
| 49 | + } |
|
| 44 | 50 | printf('<a href="%s" accesskey="%s">%s</a><br>%s', $val['href'], $this->getNo(), $val['text'], "\n"); |
| 45 | - if($val['extra']) printf("<br>%s\n",str_replace('<br/>','<br>',$val['extra'])); |
|
| 51 | + if($val['extra']) { |
|
| 52 | + printf("<br>%s\n",str_replace('<br/>','<br>',$val['extra'])); |
|
| 53 | + } |
|
| 46 | 54 | } |
| 47 | - } |
|
| 48 | - else |
|
| 55 | + } else |
|
| 49 | 56 | { |
| 50 | 57 | print(str_replace('<br/>','<br>',$this->getContent())."\n"); |
| 51 | 58 | } |
@@ -72,8 +79,7 @@ discard block |
||
| 72 | 79 | { |
| 73 | 80 | $url = getUrl('','lcm','1','sel_lang',Context::getLangType(),'return_uri',Context::get('current_url')); |
| 74 | 81 | printf('<a href="%s">%s</a><br>%s', $url, 'Language : '.Context::getLang('select_lang'), "\n"); |
| 75 | - } |
|
| 76 | - else |
|
| 82 | + } else |
|
| 77 | 83 | { |
| 78 | 84 | printf('<a href="%s">%s</a><br>%s', Context::get('return_uri'), Context::getLang('lang_return'), "\n"); |
| 79 | 85 | } |
@@ -20,14 +20,14 @@ discard block |
||
| 20 | 20 | function printHeader() |
| 21 | 21 | { |
| 22 | 22 | print("<html><head>\n"); |
| 23 | - if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); |
|
| 24 | - printf("<title>%s%s</title></head><body>\n", htmlspecialchars($this->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false),htmlspecialchars($titlePageStr, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
|
| 23 | + if ($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)", $this->mobilePage, $this->totalPage); |
|
| 24 | + printf("<title>%s%s</title></head><body>\n", htmlspecialchars($this->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), htmlspecialchars($titlePageStr, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
|
| 25 | 25 | } |
| 26 | 26 | // Output title |
| 27 | 27 | function printTitle() |
| 28 | 28 | { |
| 29 | - if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); |
|
| 30 | - printf('<%s%s><br>%s', htmlspecialchars($this->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false),htmlspecialchars($titlePageStr, ENT_COMPAT | ENT_HTML401, 'UTF-8', false),"\n"); |
|
| 29 | + if ($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)", $this->mobilePage, $this->totalPage); |
|
| 30 | + printf('<%s%s><br>%s', htmlspecialchars($this->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), htmlspecialchars($titlePageStr, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), "\n"); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /** |
@@ -36,18 +36,18 @@ discard block |
||
| 36 | 36 | **/ |
| 37 | 37 | function printContent() |
| 38 | 38 | { |
| 39 | - if($this->hasChilds()) |
|
| 39 | + if ($this->hasChilds()) |
|
| 40 | 40 | { |
| 41 | - foreach($this->getChilds() as $key => $val) |
|
| 41 | + foreach ($this->getChilds() as $key => $val) |
|
| 42 | 42 | { |
| 43 | - if(!$val['link']) continue; |
|
| 43 | + if (!$val['link']) continue; |
|
| 44 | 44 | printf('<a href="%s" accesskey="%s">%s</a><br>%s', $val['href'], $this->getNo(), $val['text'], "\n"); |
| 45 | - if($val['extra']) printf("<br>%s\n",str_replace('<br/>','<br>',$val['extra'])); |
|
| 45 | + if ($val['extra']) printf("<br>%s\n", str_replace('<br/>', '<br>', $val['extra'])); |
|
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | else |
| 49 | 49 | { |
| 50 | - print(str_replace('<br/>','<br>',$this->getContent())."\n"); |
|
| 50 | + print(str_replace('<br/>', '<br>', $this->getContent())."\n"); |
|
| 51 | 51 | } |
| 52 | 52 | print "<hr><br>"; |
| 53 | 53 | } |
@@ -57,32 +57,32 @@ discard block |
||
| 57 | 57 | **/ |
| 58 | 58 | function printBtn() |
| 59 | 59 | { |
| 60 | - if($this->nextUrl) |
|
| 60 | + if ($this->nextUrl) |
|
| 61 | 61 | { |
| 62 | 62 | $url = $this->nextUrl; |
| 63 | 63 | printf('<a href="%s">%s</a><br>%s', $url->url, $url->text, "\n"); |
| 64 | 64 | } |
| 65 | - if($this->prevUrl) |
|
| 65 | + if ($this->prevUrl) |
|
| 66 | 66 | { |
| 67 | 67 | $url = $this->prevUrl; |
| 68 | 68 | printf('<a href="%s">%s</a><br>%s', $url->url, $url->text, "\n"); |
| 69 | 69 | } |
| 70 | 70 | // Select Language |
| 71 | - if(!parent::isLangChange()) |
|
| 71 | + if (!parent::isLangChange()) |
|
| 72 | 72 | { |
| 73 | - $url = getUrl('','lcm','1','sel_lang',Context::getLangType(),'return_uri',Context::get('current_url')); |
|
| 73 | + $url = getUrl('', 'lcm', '1', 'sel_lang', Context::getLangType(), 'return_uri', Context::get('current_url')); |
|
| 74 | 74 | printf('<a href="%s">%s</a><br>%s', $url, 'Language : '.Context::getLang('select_lang'), "\n"); |
| 75 | 75 | } |
| 76 | 76 | else |
| 77 | 77 | { |
| 78 | 78 | printf('<a href="%s">%s</a><br>%s', Context::get('return_uri'), Context::getLang('lang_return'), "\n"); |
| 79 | 79 | } |
| 80 | - if($this->upperUrl) |
|
| 80 | + if ($this->upperUrl) |
|
| 81 | 81 | { |
| 82 | 82 | $url = $this->upperUrl; |
| 83 | 83 | printf('<btn href="%s" name="%s">%s', $url->url, $url->text, "\n"); |
| 84 | 84 | } |
| 85 | - if($this->homeUrl) |
|
| 85 | + if ($this->homeUrl) |
|
| 86 | 86 | { |
| 87 | 87 | $url = $this->homeUrl; |
| 88 | 88 | printf('<a btn="%s" href="%s">%s</a><br>%s', $url->text, $url->url, $url->text, "\n"); |
@@ -20,7 +20,9 @@ discard block |
||
| 20 | 20 | { |
| 21 | 21 | header("Content-Type: text/vnd.wap.wml"); |
| 22 | 22 | header("charset: ".$this->charset); |
| 23 | - if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); |
|
| 23 | + if($this->totalPage > $this->mobilePage) { |
|
| 24 | + $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); |
|
| 25 | + } |
|
| 24 | 26 | print("<?xml version=\"1.0\" encoding=\"".$this->charset."\"?><!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n"); |
| 25 | 27 | // Card Title |
| 26 | 28 | printf("<wml>\n<card title=\"%s%s\">\n<p>\n",htmlspecialchars($this->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false),htmlspecialchars($titlePageStr, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
@@ -31,7 +33,9 @@ discard block |
||
| 31 | 33 | */ |
| 32 | 34 | function printTitle() |
| 33 | 35 | { |
| 34 | - if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); |
|
| 36 | + if($this->totalPage > $this->mobilePage) { |
|
| 37 | + $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); |
|
| 38 | + } |
|
| 35 | 39 | printf('<%s%s><br/>%s', htmlspecialchars($this->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false),htmlspecialchars($titlePageStr, ENT_COMPAT | ENT_HTML401, 'UTF-8', false),"\n"); |
| 36 | 40 | } |
| 37 | 41 | |
@@ -45,12 +49,15 @@ discard block |
||
| 45 | 49 | { |
| 46 | 50 | foreach($this->getChilds() as $key => $val) |
| 47 | 51 | { |
| 48 | - if(!$val['link']) continue; |
|
| 52 | + if(!$val['link']) { |
|
| 53 | + continue; |
|
| 54 | + } |
|
| 49 | 55 | printf('<do type="%s" label="%s"><go href="%s" /></do>%s', $this->getNo(), htmlspecialchars($val['text'], ENT_COMPAT | ENT_HTML401, 'UTF-8', false), $val['href'], "\n"); |
| 50 | - if($val['extra']) printf("%s\n",$val['extra']); |
|
| 56 | + if($val['extra']) { |
|
| 57 | + printf("%s\n",$val['extra']); |
|
| 58 | + } |
|
| 51 | 59 | } |
| 52 | - } |
|
| 53 | - else |
|
| 60 | + } else |
|
| 54 | 61 | { |
| 55 | 62 | printf('%s<br/>%s', str_replace("<br>","<br/>",$this->getContent()),"\n"); |
| 56 | 63 | } |
@@ -88,8 +95,7 @@ discard block |
||
| 88 | 95 | { |
| 89 | 96 | $url = getUrl('','lcm','1','sel_lang',Context::getLangType(),'return_uri',Context::get('current_url')); |
| 90 | 97 | printf('<do type="vnd.lang" label="%s"><go href="%s"/></do>%s', 'Language : '.Context::getLang('select_lang'), $url, "\n"); |
| 91 | - } |
|
| 92 | - else |
|
| 98 | + } else |
|
| 93 | 99 | { |
| 94 | 100 | printf('<do type="vnd.lang" label="%s"><go href="%s"/></do>%s', Context::getLang('lang_return'), Context::get('return_uri'), "\n"); |
| 95 | 101 | } |
@@ -115,8 +121,7 @@ discard block |
||
| 115 | 121 | if(Context::get('mobile_skt')==1) |
| 116 | 122 | { |
| 117 | 123 | return "vnd.skmn".parent::getNo(); |
| 118 | - } |
|
| 119 | - else |
|
| 124 | + } else |
|
| 120 | 125 | { |
| 121 | 126 | return parent::getNo(); |
| 122 | 127 | } |
@@ -20,10 +20,10 @@ discard block |
||
| 20 | 20 | { |
| 21 | 21 | header("Content-Type: text/vnd.wap.wml"); |
| 22 | 22 | header("charset: ".$this->charset); |
| 23 | - if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); |
|
| 23 | + if ($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)", $this->mobilePage, $this->totalPage); |
|
| 24 | 24 | print("<?xml version=\"1.0\" encoding=\"".$this->charset."\"?><!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n"); |
| 25 | 25 | // Card Title |
| 26 | - printf("<wml>\n<card title=\"%s%s\">\n<p>\n",htmlspecialchars($this->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false),htmlspecialchars($titlePageStr, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
|
| 26 | + printf("<wml>\n<card title=\"%s%s\">\n<p>\n", htmlspecialchars($this->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), htmlspecialchars($titlePageStr, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | function printTitle() |
| 33 | 33 | { |
| 34 | - if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); |
|
| 35 | - printf('<%s%s><br/>%s', htmlspecialchars($this->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false),htmlspecialchars($titlePageStr, ENT_COMPAT | ENT_HTML401, 'UTF-8', false),"\n"); |
|
| 34 | + if ($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)", $this->mobilePage, $this->totalPage); |
|
| 35 | + printf('<%s%s><br/>%s', htmlspecialchars($this->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), htmlspecialchars($titlePageStr, ENT_COMPAT | ENT_HTML401, 'UTF-8', false), "\n"); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -41,18 +41,18 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | function printContent() |
| 43 | 43 | { |
| 44 | - if($this->hasChilds()) |
|
| 44 | + if ($this->hasChilds()) |
|
| 45 | 45 | { |
| 46 | - foreach($this->getChilds() as $key => $val) |
|
| 46 | + foreach ($this->getChilds() as $key => $val) |
|
| 47 | 47 | { |
| 48 | - if(!$val['link']) continue; |
|
| 48 | + if (!$val['link']) continue; |
|
| 49 | 49 | printf('<do type="%s" label="%s"><go href="%s" /></do>%s', $this->getNo(), htmlspecialchars($val['text'], ENT_COMPAT | ENT_HTML401, 'UTF-8', false), $val['href'], "\n"); |
| 50 | - if($val['extra']) printf("%s\n",$val['extra']); |
|
| 50 | + if ($val['extra']) printf("%s\n", $val['extra']); |
|
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | else |
| 54 | 54 | { |
| 55 | - printf('%s<br/>%s', str_replace("<br>","<br/>",$this->getContent()),"\n"); |
|
| 55 | + printf('%s<br/>%s', str_replace("<br>", "<br/>", $this->getContent()), "\n"); |
|
| 56 | 56 | } |
| 57 | 57 | print('<br/>'); |
| 58 | 58 | } |
@@ -62,43 +62,43 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | function printBtn() |
| 64 | 64 | { |
| 65 | - if($this->nextUrl) |
|
| 65 | + if ($this->nextUrl) |
|
| 66 | 66 | { |
| 67 | 67 | $url = $this->nextUrl; |
| 68 | 68 | printf('<do type="vnd.next" label="%s"><go href="%s"/></do>%s', $url->text, $url->url, "\n"); |
| 69 | 69 | } |
| 70 | - if($this->prevUrl) |
|
| 70 | + if ($this->prevUrl) |
|
| 71 | 71 | { |
| 72 | 72 | $url = $this->prevUrl; |
| 73 | 73 | printf('<do type="vnd.prev" label="%s"><go href="%s"/></do>%s', $url->text, $url->url, "\n"); |
| 74 | 74 | } |
| 75 | 75 | // Others are not applicable in charge of the button output (array passed) type?? |
| 76 | - if($this->etcBtn) |
|
| 76 | + if ($this->etcBtn) |
|
| 77 | 77 | { |
| 78 | - if(is_array($this->etcBtn)) |
|
| 78 | + if (is_array($this->etcBtn)) |
|
| 79 | 79 | { |
| 80 | - foreach($this->etcBtn as $key=>$val) |
|
| 80 | + foreach ($this->etcBtn as $key=>$val) |
|
| 81 | 81 | { |
| 82 | 82 | printf('<do type="vnd.btn%s" label="%s"><go href="%s"/></do>%s', $key, $val['text'], $val['url'], "\n"); |
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | 86 | // Select Language |
| 87 | - if(!parent::isLangChange()) |
|
| 87 | + if (!parent::isLangChange()) |
|
| 88 | 88 | { |
| 89 | - $url = getUrl('','lcm','1','sel_lang',Context::getLangType(),'return_uri',Context::get('current_url')); |
|
| 89 | + $url = getUrl('', 'lcm', '1', 'sel_lang', Context::getLangType(), 'return_uri', Context::get('current_url')); |
|
| 90 | 90 | printf('<do type="vnd.lang" label="%s"><go href="%s"/></do>%s', 'Language : '.Context::getLang('select_lang'), $url, "\n"); |
| 91 | 91 | } |
| 92 | 92 | else |
| 93 | 93 | { |
| 94 | 94 | printf('<do type="vnd.lang" label="%s"><go href="%s"/></do>%s', Context::getLang('lang_return'), Context::get('return_uri'), "\n"); |
| 95 | 95 | } |
| 96 | - if($this->homeUrl) |
|
| 96 | + if ($this->homeUrl) |
|
| 97 | 97 | { |
| 98 | 98 | $url = $this->homeUrl; |
| 99 | 99 | printf('<do type="access" label="%s"><go href="%s"/></do>%s', $url->text, $url->url, "\n"); |
| 100 | 100 | } |
| 101 | - if($this->upperUrl) |
|
| 101 | + if ($this->upperUrl) |
|
| 102 | 102 | { |
| 103 | 103 | $url = $this->upperUrl; |
| 104 | 104 | printf('<do type="vnd.up" label="%s"><go href="%s"/></do>%s', $url->text, $url->url, "\n"); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | // And returns a list of serial numbers in |
| 113 | 113 | function getNo() |
| 114 | 114 | { |
| 115 | - if(Context::get('mobile_skt')==1) |
|
| 115 | + if (Context::get('mobile_skt') == 1) |
|
| 116 | 116 | { |
| 117 | 117 | return "vnd.skmn".parent::getNo(); |
| 118 | 118 | } |
@@ -1,8 +1,9 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
| 3 | 3 | |
| 4 | -if(!defined('__XE__')) |
|
| 4 | +if(!defined('__XE__')) { |
|
| 5 | 5 | exit(); |
| 6 | +} |
|
| 6 | 7 | |
| 7 | 8 | /** |
| 8 | 9 | * @file mobile.addon.php |
@@ -66,8 +67,7 @@ discard block |
||
| 66 | 67 | $oMobile->displayModuleContent(); |
| 67 | 68 | } |
| 68 | 69 | // If neither navigation mode nor WAP class is, display the module's result |
| 69 | -} |
|
| 70 | -else if($called_position == 'after_module_proc') |
|
| 70 | +} else if($called_position == 'after_module_proc') |
|
| 71 | 71 | { |
| 72 | 72 | // Display |
| 73 | 73 | $oMobile->displayContent(); |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
| 3 | 3 | |
| 4 | -if(!defined('__XE__')) |
|
| 4 | +if (!defined('__XE__')) |
|
| 5 | 5 | exit(); |
| 6 | 6 | |
| 7 | 7 | /** |
@@ -19,24 +19,24 @@ discard block |
||
| 19 | 19 | * Condition |
| 20 | 20 | * */ |
| 21 | 21 | // Ignore admin page |
| 22 | -if(Context::get('module') == 'admin') |
|
| 22 | +if (Context::get('module') == 'admin') |
|
| 23 | 23 | { |
| 24 | 24 | return; |
| 25 | 25 | } |
| 26 | 26 | // Manage when to call it |
| 27 | -if($called_position != 'before_module_proc' && $called_position != 'after_module_proc') |
|
| 27 | +if ($called_position != 'before_module_proc' && $called_position != 'after_module_proc') |
|
| 28 | 28 | { |
| 29 | 29 | return; |
| 30 | 30 | } |
| 31 | 31 | // Ignore if not mobile browser |
| 32 | -require_once(_XE_PATH_ . 'addons/mobile/classes/mobile.class.php'); |
|
| 33 | -if(!mobileXE::getBrowserType()) |
|
| 32 | +require_once(_XE_PATH_.'addons/mobile/classes/mobile.class.php'); |
|
| 33 | +if (!mobileXE::getBrowserType()) |
|
| 34 | 34 | { |
| 35 | 35 | return; |
| 36 | 36 | } |
| 37 | 37 | // Generate mobile instance |
| 38 | 38 | $oMobile = &mobileXE::getInstance(); |
| 39 | -if(!$oMobile) |
|
| 39 | +if (!$oMobile) |
|
| 40 | 40 | { |
| 41 | 41 | return; |
| 42 | 42 | } |
@@ -48,15 +48,15 @@ discard block |
||
| 48 | 48 | $oMobile->setModuleInstance($this); |
| 49 | 49 | |
| 50 | 50 | // Extract content and display/exit if navigate mode is or if WAP class exists |
| 51 | -if($called_position == 'before_module_proc') |
|
| 51 | +if ($called_position == 'before_module_proc') |
|
| 52 | 52 | { |
| 53 | - if($oMobile->isLangChange()) |
|
| 53 | + if ($oMobile->isLangChange()) |
|
| 54 | 54 | { |
| 55 | 55 | $oMobile->setLangType(); |
| 56 | 56 | $oMobile->displayLangSelect(); |
| 57 | 57 | } |
| 58 | 58 | // On navigation mode, display navigation content |
| 59 | - if($oMobile->isNavigationMode()) |
|
| 59 | + if ($oMobile->isNavigationMode()) |
|
| 60 | 60 | { |
| 61 | 61 | $oMobile->displayNavigationContent(); |
| 62 | 62 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | // If neither navigation mode nor WAP class is, display the module's result |
| 69 | 69 | } |
| 70 | -else if($called_position == 'after_module_proc') |
|
| 70 | +else if ($called_position == 'after_module_proc') |
|
| 71 | 71 | { |
| 72 | 72 | // Display |
| 73 | 73 | $oMobile->displayContent(); |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /* Copyright (C) NAVER <http://www.navercorp.com> */ |
| 3 | 3 | |
| 4 | -if(!defined('__XE__')) |
|
| 4 | +if (!defined('__XE__')) |
|
| 5 | 5 | { |
| 6 | 6 | exit(); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -if($called_position == 'after_module_proc' && Context::getResponseMethod() == 'HTML') |
|
| 9 | +if ($called_position == 'after_module_proc' && Context::getResponseMethod() == 'HTML') |
|
| 10 | 10 | { |
| 11 | 11 | Context::loadFile('./addons/oembed/jquery.oembed.css'); |
| 12 | 12 | Context::loadFile(array('./addons/oembed/jquery.oembed.js', 'body', '', null), true); |