diff --git a/addons/adminlogging/adminlogging.addon.php b/addons/adminlogging/adminlogging.addon.php index a3eb4981a..f0c6f5cc7 100644 --- a/addons/adminlogging/adminlogging.addon.php +++ b/addons/adminlogging/adminlogging.addon.php @@ -5,13 +5,15 @@ if(!defined('__XE__')) exit(); * @file adminlogging.addon.php * @author NHN (developers@xpressengine.com) * @brief Automatic link add-on - **/ + */ $logged_info = Context::get('logged_info'); $act = Context::get('act'); $kind = strpos(strtolower($act),'admin')!==false?'admin':''; -if($called_position == 'before_module_proc' && $kind == 'admin' && $logged_info->is_admin == 'Y') { +if($called_position == 'before_module_proc' && $kind == 'admin' && $logged_info->is_admin == 'Y') +{ $oAdminloggingController = &getController('adminlogging'); $oAdminloggingController->insertLog($this->module, $this->act); } -?> +/* End of file adminlogging.php */ +/* Location: ./addons/adminlogging */ diff --git a/addons/autolink/autolink.addon.php b/addons/autolink/autolink.addon.php index b5910a76a..ee8e16eec 100644 --- a/addons/autolink/autolink.addon.php +++ b/addons/autolink/autolink.addon.php @@ -5,8 +5,10 @@ if(!defined('__XE__')) exit(); * @file autolink.addon.php * @author NHN (developers@xpressengine.com) * @brief Automatic link add-on - **/ -if($called_position == 'after_module_proc' && Context::getResponseMethod()!="XMLRPC") { + */ +if($called_position == 'after_module_proc' && Context::getResponseMethod()!="XMLRPC") +{ Context::loadFile(array('./addons/autolink/autolink.js', 'body', '', null), true); } -?> +/* End of file autolink.addon.php */ +/* Location: .//addons/autolink/autolink.addon.php */ diff --git a/addons/blogapi/blogapi.addon.php b/addons/blogapi/blogapi.addon.php index 9a9cee575..56555b6e1 100644 --- a/addons/blogapi/blogapi.addon.php +++ b/addons/blogapi/blogapi.addon.php @@ -435,4 +435,5 @@ RSDContent; break; } } -?> +/* End of file blogapi.addon.php */ +/* Location: ./addons/blogapi/blogapi.addon.php */ diff --git a/addons/blogapi/blogapi.func.php b/addons/blogapi/blogapi.func.php index 2d289bf40..e85d8120e 100644 --- a/addons/blogapi/blogapi.func.php +++ b/addons/blogapi/blogapi.func.php @@ -1,66 +1,79 @@ \n\n\nfaultCode\n%d\n\n\nfaultString\n%s\n\n\n\n", - $error, - htmlspecialchars($message) - ); - } - // Display results - function getXmlRpcResponse($params) { - $buff = ''."\n"; - $buff .= _getEncodedVal($params); - $buff .= "\n\n"; +/** + * @file ./addons/blogapi/blogapi.func.php + * @author NHN (developers@xpressengine.com) + * @brief Function collections for the implementation of blogapi + **/ - return $buff; - } - // Encoding - function _getEncodedVal($val, $is_sub_set = false) { - if(is_int($val)) $buff = sprintf("%d", $val); - elseif(is_string($val)&&preg_match('/^([0-9]+)T([0-9\:]+)$/', $val)) $buff = sprintf("%s\n", $val); - elseif(is_double($val)) $buff = sprintf("%f", $val); - elseif(is_bool($val)) $buff = sprintf("%d", $val?1:0); - elseif(is_object($val)) { - $values = get_object_vars($val); - $val_count = count($values); - $buff = ""; - foreach($values as $k => $v) { - $buff .= sprintf("\n%s\n%s\n", htmlspecialchars($k), _getEncodedVal($v, true)); - } - $buff .= "\n"; - } elseif(is_array($val)) { - $val_count = count($val); - $buff = "\n"; - for($i=0;$i<$val_count;$i++) { - $buff .= _getEncodedVal($val[$i], true); - } - $buff .= "\n"; - } else { - $buff = sprintf("%s\n", $val); - } - if(!$is_sub_set) return sprintf("\n%s", $buff); - return $buff; - } - // Display the result - function printContent($content) { - header("Content-Type: text/xml; charset=UTF-8"); - header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); - header("Cache-Control: no-store, no-cache, must-revalidate"); - header("Cache-Control: post-check=0, pre-check=0", false); - header("Pragma: no-cache"); - print $content; - Context::close(); - exit(); - } -?> +// Error messages +function getXmlRpcFailure($error, $message) +{ + return + sprintf( + "\n\n\nfaultCode\n%d\n\n\nfaultString\n%s\n\n\n\n", + $error, + htmlspecialchars($message) + ); +} + +// Display results +function getXmlRpcResponse($params) +{ + $buff = ''."\n"; + $buff .= _getEncodedVal($params); + $buff .= "\n\n"; + + return $buff; +} + +// Encoding +function _getEncodedVal($val, $is_sub_set = false) +{ + if(is_int($val)) $buff = sprintf("%d", $val); + elseif(is_string($val)&&preg_match('/^([0-9]+)T([0-9\:]+)$/', $val)) $buff = sprintf("%s\n", $val); + elseif(is_double($val)) $buff = sprintf("%f", $val); + elseif(is_bool($val)) $buff = sprintf("%d", $val?1:0); + elseif(is_object($val)) + { + $values = get_object_vars($val); + $val_count = count($values); + $buff = ""; + foreach($values as $k => $v) { + $buff .= sprintf("\n%s\n%s\n", htmlspecialchars($k), _getEncodedVal($v, true)); + } + $buff .= "\n"; + } + elseif(is_array($val)) + { + $val_count = count($val); + $buff = "\n"; + for($i=0;$i<$val_count;$i++) { + $buff .= _getEncodedVal($val[$i], true); + } + $buff .= "\n"; + } + else + { + $buff = sprintf("%s\n", $val); + } + if(!$is_sub_set) return sprintf("\n%s", $buff); + return $buff; +} + +// Display the result +function printContent($content) +{ + header("Content-Type: text/xml; charset=UTF-8"); + header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + header("Cache-Control: no-store, no-cache, must-revalidate"); + header("Cache-Control: post-check=0, pre-check=0", false); + header("Pragma: no-cache"); + print $content; + Context::close(); + exit(); +} +/* End of file blogapi.func.php */ +/* Location: ./addons/blogapi/blogapi.func.php */ diff --git a/addons/captcha/captcha.addon.php b/addons/captcha/captcha.addon.php index a58c21055..384987a73 100644 --- a/addons/captcha/captcha.addon.php +++ b/addons/captcha/captcha.addon.php @@ -1,347 +1,353 @@ addon_info = $addon_info; + } - function setInfo(&$addon_info) + function before_module_proc() + { + if($this->addon_info->act_type == 'everytime' && $_SESSION['captcha_authed']) { - $this->addon_info = $addon_info; + unset($_SESSION['captcha_authed']); } + } - function before_module_proc() + function before_module_init(&$ModuleHandler) + { + $logged_info = Context::get('logged_info'); + if($logged_info->is_admin == 'Y' || $logged_info->is_site_admin) return false; + if($this->addon_info->target != 'all' && Context::get('is_logged')) return false; + if($_SESSION['XE_VALIDATOR_ERROR'] == -1) $_SESSION['captcha_authed'] = false; + if($_SESSION['captcha_authed']) return false; + + $type = Context::get('captchaType'); + + $target_acts = array('procBoardInsertDocument','procBoardInsertComment','procIssuetrackerInsertIssue','procIssuetrackerInsertHistory','procTextyleInsertComment'); + if($this->addon_info->apply_find_account=='apply') $target_acts[] = 'procMemberFindAccount'; + if($this->addon_info->apply_resend_auth_mail=='apply') $target_acts[] = 'procMemberResendAuthMail'; + if($this->addon_info->apply_signup=='apply') $target_acts[] = 'procMemberInsert'; + + if(Context::getRequestMethod()!='XMLRPC' && Context::getRequestMethod()!=='JSON') { - if($this->addon_info->act_type == 'everytime' && $_SESSION['captcha_authed']) { - unset($_SESSION['captcha_authed']); - } - } - - function before_module_init(&$ModuleHandler) - { - $logged_info = Context::get('logged_info'); - if($logged_info->is_admin == 'Y' || $logged_info->is_site_admin) return false; - if($this->addon_info->target != 'all' && Context::get('is_logged')) return false; - if($_SESSION['XE_VALIDATOR_ERROR'] == -1) $_SESSION['captcha_authed'] = false; - if($_SESSION['captcha_authed']) return false; - - $type = Context::get('captchaType'); - - $target_acts = array('procBoardInsertDocument','procBoardInsertComment','procIssuetrackerInsertIssue','procIssuetrackerInsertHistory','procTextyleInsertComment'); - if($this->addon_info->apply_find_account=='apply') $target_acts[] = 'procMemberFindAccount'; - if($this->addon_info->apply_resend_auth_mail=='apply') $target_acts[] = 'procMemberResendAuthMail'; - if($this->addon_info->apply_signup=='apply') $target_acts[] = 'procMemberInsert'; - - if(Context::getRequestMethod()!='XMLRPC' && Context::getRequestMethod()!=='JSON') + if($type == 'inline') { - if($type == 'inline') { - if(!$this->compareCaptcha()) - { - Context::loadLang('./addons/captcha/lang'); - $_SESSION['XE_VALIDATOR_ERROR'] = -1; - $_SESSION['XE_VALIDATOR_MESSAGE'] = Context::getLang('captcha_denied');; - $_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = 'error'; - $_SESSION['XE_VALIDATOR_RETURN_URL'] = Context::get('error_return_url'); - $ModuleHandler->_setInputValueToSession(); - } - } else { - Context::addHtmlHeader(''); - Context::loadFile(array('./addons/captcha/captcha.min.js', 'body', '', null), true); + if(!$this->compareCaptcha()) + { + Context::loadLang('./addons/captcha/lang'); + $_SESSION['XE_VALIDATOR_ERROR'] = -1; + $_SESSION['XE_VALIDATOR_MESSAGE'] = Context::getLang('captcha_denied');; + $_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = 'error'; + $_SESSION['XE_VALIDATOR_RETURN_URL'] = Context::get('error_return_url'); + $ModuleHandler->_setInputValueToSession(); } } + else + { + Context::addHtmlHeader(''); + Context::loadFile(array('./addons/captcha/captcha.min.js', 'body', '', null), true); + } + } - // compare session when calling actions such as writing a post or a comment on the board/issue tracker module - if(!$_SESSION['captcha_authed'] && in_array(Context::get('act'), $target_acts)) { - Context::loadLang('./addons/captcha/lang'); - $ModuleHandler->error = "captcha_denied"; + // compare session when calling actions such as writing a post or a comment on the board/issue tracker module + if(!$_SESSION['captcha_authed'] && in_array(Context::get('act'), $target_acts)) + { + Context::loadLang('./addons/captcha/lang'); + $ModuleHandler->error = "captcha_denied"; + } + + return true; + } + + function createKeyword() + { + $type = Context::get('captchaType'); + if ($type == 'inline' && $_SESSION['captcha_keyword']) return; + + $arr = range('A','Y'); + shuffle($arr); + $arr = array_slice($arr,0,6); + $_SESSION['captcha_keyword'] = join('', $arr); + } + + function before_module_init_setCaptchaSession() + { + if($_SESSION['captcha_authed']) return false; + // Load language files + + Context::loadLang(_XE_PATH_.'addons/captcha/lang'); + // Generate keywords + + $this->createKeyword(); + + $target = Context::getLang('target_captcha'); + header("Content-Type: text/xml; charset=UTF-8"); + header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + header("Cache-Control: no-store, no-cache, must-revalidate"); + header("Cache-Control: post-check=0, pre-check=0", false); + header("Pragma: no-cache"); + printf("\r\n 0\r\n success\r\n \r\n \r\n \r\n \r\n \r\n " + ,Context::getLang('about_captcha') + ,Context::getLang('captcha_reload') + ,Context::getLang('captcha_play') + ,Context::getLang('cmd_input') + ,Context::getLang('cmd_cancel') + ); + Context::close(); + exit(); + } + + function before_module_init_captchaImage() + { + if($_SESSION['captcha_authed']) return false; + if(Context::get('renew')) $this->createKeyword(); + + $keyword = $_SESSION['captcha_keyword']; + $im = $this->createCaptchaImage($keyword); + + header("Cache-Control: "); + header("Pragma: "); + header("Content-Type: image/png"); + + imagepng($im); + imagedestroy($im); + + Context::close(); + exit(); + } + + function createCaptchaImage($string) + { + $arr = array(); + for($i=0,$c=strlen($string);$i<$c;$i++) $arr[] = $string{$i}; + // Font site + + $w = 18; + $h = 25; + // Character length + + $c = count($arr); + // Character image + + $im = array(); + // Create an image by total size + + $im[] = imagecreate(($w+2)*count($arr), $h); + + $deg = range(-30,30); + shuffle($deg); + // Create an image for each letter + + foreach($arr as $i => $str) + { + $im[$i+1] = @imagecreate($w, $h); + $background_color = imagecolorallocate($im[$i+1], 255, 255, 255); + $text_color = imagecolorallocate($im[$i+1], 0, 0, 0); + // Control font size + + $ran = range(1,20); + shuffle($ran); + + if(function_exists('imagerotate')) + { + imagestring($im[$i+1], (array_pop($ran)%3)+3, 2, (array_pop($ran)%8), $str, $text_color); + $im[$i+1] = imagerotate($im[$i+1], array_pop($deg), 0); + + $background_color = imagecolorallocate($im[$i+1], 255, 255, 255); + imagecolortransparent($im[$i+1], $background_color); + } + else + { + imagestring($im[$i+1], (array_pop($ran)%3)+3, 2, (array_pop($ran)%4), $str, $text_color); + } + } + + // Combine images of each character + + for($i=1;$icreateCaptchaAudio($keyword); + + header('Content-type: audio/mpeg'); + header("Content-Disposition: attachment; filename=\"captcha_audio.mp3\""); + header('Cache-Control: no-store, no-cache, must-revalidate'); + header('Expires: Sun, 1 Jan 2000 12:00:00 GMT'); + header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT'); + header('Content-Length: ' . strlen($data)); + + echo $data; + Context::close(); + exit(); + } + + function createCaptchaAudio($string) + { + $data = ''; + $_audio = './addons/captcha/audio/F_%s.mp3'; + for($i=0,$c=strlen($string);$i<$c;$i++) + { + $_data = FileHandler::readFile(sprintf($_audio, $string{$i})); + + $start = rand(5, 68); // Random start in 4-byte header and 64 byte data + $datalen = strlen($_data) - $start - 256; // Last unchanged 256 bytes + + for($j=$start;$j<$datalen;$j+=64) + { + $ch = ord($_data{$j}); + if($ch<9 || $ch>119) continue; + $_data{$j} = chr($ch+rand(-8,8)); } + $data .= $_data; + } + + return $data; + } + + function compareCaptcha() + { + if($_SESSION['captcha_authed']) return true; + + if(strtoupper($_SESSION['captcha_keyword']) == strtoupper(Context::get('secret_text'))) + { + $_SESSION['captcha_authed'] = true; return true; } - function createKeyword() + unset($_SESSION['captcha_authed']); + + return false; + } + + function before_module_init_captchaCompare() + { + if(!$this->compareCaptcha()) { - $type = Context::get('captchaType'); - if ($type == 'inline' && $_SESSION['captcha_keyword']) return; - - $arr = range('A','Y'); - shuffle($arr); - $arr = array_slice($arr,0,6); - $_SESSION['captcha_keyword'] = join('', $arr); - } - - function before_module_init_setCaptchaSession() - { - if($_SESSION['captcha_authed']) return false; - // Load language files - - Context::loadLang(_XE_PATH_.'addons/captcha/lang'); - // Generate keywords - - $this->createKeyword(); - - $target = Context::getLang('target_captcha'); - header("Content-Type: text/xml; charset=UTF-8"); - header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); - header("Cache-Control: no-store, no-cache, must-revalidate"); - header("Cache-Control: post-check=0, pre-check=0", false); - header("Pragma: no-cache"); - printf("\r\n 0\r\n success\r\n \r\n \r\n \r\n \r\n \r\n " - ,Context::getLang('about_captcha') - ,Context::getLang('captcha_reload') - ,Context::getLang('captcha_play') - ,Context::getLang('cmd_input') - ,Context::getLang('cmd_cancel') - ); - Context::close(); - exit(); - } - - function before_module_init_captchaImage() - { - if($_SESSION['captcha_authed']) return false; - if(Context::get('renew')) $this->createKeyword(); - - $keyword = $_SESSION['captcha_keyword']; - $im = $this->createCaptchaImage($keyword); - - header("Cache-Control: "); - header("Pragma: "); - header("Content-Type: image/png"); - - imagepng($im); - imagedestroy($im); - - Context::close(); - exit(); - } - - function createCaptchaImage($string) - { - $arr = array(); - for($i=0,$c=strlen($string);$i<$c;$i++) $arr[] = $string{$i}; - // Font site - - $w = 18; - $h = 25; - // Character length - - $c = count($arr); - // Character image - - $im = array(); - // Create an image by total size - - $im[] = imagecreate(($w+2)*count($arr), $h); - - $deg = range(-30,30); - shuffle($deg); - // Create an image for each letter - - foreach($arr as $i => $str) - { - $im[$i+1] = @imagecreate($w, $h); - $background_color = imagecolorallocate($im[$i+1], 255, 255, 255); - $text_color = imagecolorallocate($im[$i+1], 0, 0, 0); - // Control font size - - $ran = range(1,20); - shuffle($ran); - - if(function_exists('imagerotate')) - { - imagestring($im[$i+1], (array_pop($ran)%3)+3, 2, (array_pop($ran)%8), $str, $text_color); - $im[$i+1] = imagerotate($im[$i+1], array_pop($deg), 0); - - $background_color = imagecolorallocate($im[$i+1], 255, 255, 255); - imagecolortransparent($im[$i+1], $background_color); - } - else - { - imagestring($im[$i+1], (array_pop($ran)%3)+3, 2, (array_pop($ran)%4), $str, $text_color); - } - } - - // Combine images of each character - - for($i=1;$icreateCaptchaAudio($keyword); - - header('Content-type: audio/mpeg'); - header("Content-Disposition: attachment; filename=\"captcha_audio.mp3\""); - header('Cache-Control: no-store, no-cache, must-revalidate'); - header('Expires: Sun, 1 Jan 2000 12:00:00 GMT'); - header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT'); - header('Content-Length: ' . strlen($data)); - - echo $data; - Context::close(); - exit(); - } - - function createCaptchaAudio($string) - { - $data = ''; - $_audio = './addons/captcha/audio/F_%s.mp3'; - for($i=0,$c=strlen($string);$i<$c;$i++) - { - $_data = FileHandler::readFile(sprintf($_audio, $string{$i})); - - $start = rand(5, 68); // Random start in 4-byte header and 64 byte data - $datalen = strlen($_data) - $start - 256; // Last unchanged 256 bytes - - for($j=$start;$j<$datalen;$j+=64) - { - $ch = ord($_data{$j}); - if($ch<9 || $ch>119) continue; - $_data{$j} = chr($ch+rand(-8,8)); - } - - $data .= $_data; - } - - return $data; - } - - function compareCaptcha() - { - if($_SESSION['captcha_authed']) return true; - - if(strtoupper($_SESSION['captcha_keyword']) == strtoupper(Context::get('secret_text'))) { - $_SESSION['captcha_authed'] = true; - return true; - } - - unset($_SESSION['captcha_authed']); - return false; } - function before_module_init_captchaCompare() - { - if(!$this->compareCaptcha()) - { - return false; - } + header("Content-Type: text/xml; charset=UTF-8"); + header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + header("Cache-Control: no-store, no-cache, must-revalidate"); + header("Cache-Control: post-check=0, pre-check=0", false); + header("Pragma: no-cache"); + print("\r\n0\r\nsuccess\r\n"); - header("Content-Type: text/xml; charset=UTF-8"); - header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); - header("Cache-Control: no-store, no-cache, must-revalidate"); - header("Cache-Control: post-check=0, pre-check=0", false); - header("Pragma: no-cache"); - print("\r\n0\r\nsuccess\r\n"); + Context::close(); + exit(); + } - Context::close(); - exit(); - } + function inlineDisplay() + { + unset($_SESSION['captcha_authed']); + $this->createKeyword(); - function inlineDisplay() - { - unset($_SESSION['captcha_authed']); - $this->createKeyword(); + $swfURL = getUrl().'addons/captcha/swf/play.swf'; + Context::unloadFile('./addons/captcha/captcha.min.js'); + Context::loadFile(array('./addons/captcha/inline_captcha.js','body')); - $swfURL = getUrl().'addons/captcha/swf/play.swf'; - Context::unloadFile('./addons/captcha/captcha.min.js'); - Context::loadFile(array('./addons/captcha/inline_captcha.js','body')); + global $lang; - global $lang; - - $tags=<< - - - - - - - + + + + + + +
EOD; - $tags = sprintf($tags, getUrl('captcha_action','captchaImage', 'rand', mt_rand(10000, 99999)) - , $swfURL - , $swfURL - , $lang->reload - , $lang->play); - return $tags; - } + $tags = sprintf($tags, getUrl('captcha_action','captchaImage', 'rand', mt_rand(10000, 99999)) + , $swfURL + , $swfURL + , $lang->reload + , $lang->play); + return $tags; } - - $GLOBALS['__AddonCaptcha__'] = new AddonCaptcha; - $GLOBALS['__AddonCaptcha__']->setInfo($addon_info); - Context::set('oCaptcha', &$GLOBALS['__AddonCaptcha__']); } - $oAddonCaptcha = &$GLOBALS['__AddonCaptcha__']; + $GLOBALS['__AddonCaptcha__'] = new AddonCaptcha; + $GLOBALS['__AddonCaptcha__']->setInfo($addon_info); + Context::set('oCaptcha', $GLOBALS['__AddonCaptcha__']); +} - if(method_exists($oAddonCaptcha, $called_position)) +$oAddonCaptcha = &$GLOBALS['__AddonCaptcha__']; + +if(method_exists($oAddonCaptcha, $called_position)) +{ + if(!call_user_func_array(array(&$oAddonCaptcha, $called_position), array(&$this))) { - if(!call_user_func_array(array(&$oAddonCaptcha, $called_position), array(&$this))) - { - return false; - } + return false; } +} - $addon_act = Context::get('captcha_action'); - if($addon_act && method_exists($oAddonCaptcha, $called_position.'_'.$addon_act)) +$addon_act = Context::get('captcha_action'); +if($addon_act && method_exists($oAddonCaptcha, $called_position.'_'.$addon_act)) +{ + if(!call_user_func_array(array(&$oAddonCaptcha, $called_position.'_'.$addon_act), array(&$this))) { - if(!call_user_func_array(array(&$oAddonCaptcha, $called_position.'_'.$addon_act), array(&$this))) - { - return false; - } + return false; } - -?> +} +/* End of file captcha.addon.php */ +/* Location: ./addons/captcha/captcha.addon.php */ diff --git a/addons/counter/counter.addon.php b/addons/counter/counter.addon.php index 3d6c8115e..b61c4bbf4 100644 --- a/addons/counter/counter.addon.php +++ b/addons/counter/counter.addon.php @@ -5,10 +5,12 @@ if(!defined('__XE__')) exit(); * @file counter.addon.php * @author NHN (developers@xpressengine.com) * @brief Counter add-on - **/ + */ // Execute if called_position is before_display_content -if(Context::isInstalled() && $called_position == 'before_module_init' && Context::get('module')!='admin' && Context::getResponseMethod() == 'HTML') { +if(Context::isInstalled() && $called_position == 'before_module_init' && Context::get('module')!='admin' && Context::getResponseMethod() == 'HTML') +{ $oCounterController = &getController('counter'); $oCounterController->counterExecute(); } -?> +/* End of file counter.addon.php */ +/* Location: ./addons/counter/counter.addon.php */ diff --git a/addons/member_communication/member_communication.addon.php b/addons/member_communication/member_communication.addon.php index 89ed0fc6d..ca49fcc17 100644 --- a/addons/member_communication/member_communication.addon.php +++ b/addons/member_communication/member_communication.addon.php @@ -9,7 +9,7 @@ if(!defined('__XE__')) exit(); * - Pop-up the message if new message comes in * - When calling MemberModel::getMemberMenu, feature to send a message is added * - When caliing MemberModel::getMemberMenu, feature to add a friend is added - **/ + */ // Stop if non-logged-in user is $logged_info = Context::get('logged_info'); if(!$logged_info) return; @@ -17,7 +17,8 @@ if(!$logged_info) return; /** * Message/Friend munus are added on the pop-up window and member profile. Check if a new message is received **/ -if($called_position == 'before_module_init' && $this->module != 'member') { +if($called_position == 'before_module_init' && $this->module != 'member') +{ // Load a language file from the communication module Context::loadLang('./modules/communication/lang'); // Add menus on the member login information @@ -28,7 +29,8 @@ if($called_position == 'before_module_init' && $this->module != 'member') { $flag_path = './files/member_extra_info/new_message_flags/'.getNumberingPath($logged_info->member_srl); $flag_file = $flag_path.$logged_info->member_srl; - if(file_exists($flag_file)) { + if(file_exists($flag_file)) + { $new_message_count = trim(FileHandler::readFile($flag_file)); FileHandler::removeFile($flag_file); Context::loadLang('./addons/member_communication/lang'); @@ -40,20 +42,25 @@ if($called_position == 'before_module_init' && $this->module != 'member') { Context::addHtmlFooter($script); } -} elseif($called_position == 'before_module_proc' && $this->act == 'getMemberMenu') { +} +elseif($called_position == 'before_module_proc' && $this->act == 'getMemberMenu') +{ $oMemberController = &getController('member'); $member_srl = Context::get('target_srl'); $mid = Context::get('cur_mid'); // Creates communication model object $oCommunicationModel = &getModel('communication'); // Add a feature to display own message box. - if($logged_info->member_srl == $member_srl) { + if($logged_info->member_srl == $member_srl) + { // Add your own viewing Note Template $oMemberController->addMemberPopupMenu(getUrl('','mid',$mid,'act','dispCommunicationMessages'), 'cmd_view_message_box', '', 'self'); // Display a list of friends $oMemberController->addMemberPopupMenu(getUrl('','mid',$mid,'act','dispCommunicationFriend'), 'cmd_view_friend', '', 'self'); - // If not, Add menus to send message and to add friends - } else { + // If not, Add menus to send message and to add friends + } + else + { // Get member information $oMemberModel = &getModel('member'); $target_member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); @@ -68,4 +75,5 @@ if($called_position == 'before_module_init' && $this->module != 'member') { $oMemberController->addMemberPopupMenu(getUrl('','module','communication','act','dispCommunicationAddFriend','target_srl',$member_srl), 'cmd_add_friend', '', 'popup'); } } -?> +/* End of file member_communication.addon.php */ +/* Location: ./addons/member_communication/member_communication.addon.php */ diff --git a/addons/member_extra_info/member_extra_info.addon.php b/addons/member_extra_info/member_extra_info.addon.php index 925675453..86138a487 100644 --- a/addons/member_extra_info/member_extra_info.addon.php +++ b/addons/member_extra_info/member_extra_info.addon.php @@ -8,11 +8,11 @@ if(!defined('__XE__')) exit(); * * Find member_srl in the part with
....
* Check if ther is image name and image mark. Then change it. - **/ + */ /** * Just before displaying, change image name/ image mark - **/ + */ if($called_position != "before_display_content" || Context::get('act')=='dispPageAdminContentModify') return; // Include a file having functions to replace member image name/mark require_once('./addons/member_extra_info/member_extra_info.lib.php'); @@ -20,4 +20,6 @@ require_once('./addons/member_extra_info/member_extra_info.lib.php'); $temp_output = preg_replace_callback('!<(div|span|a)([^\>]*)member_([0-9]+)([^\>]*)>(.*?)\<\/(div|span|a)\>!is', 'memberTransImageName', $output); if($temp_output) $output = $temp_output; unset($temp_output); -?> + +/* End of file member_extra_info.addon.php */ +/* Location: ./addons/member_extra_info/member_extra_info.addon.php */ diff --git a/addons/member_extra_info/member_extra_info.lib.php b/addons/member_extra_info/member_extra_info.lib.php index d2019a717..429ec8243 100644 --- a/addons/member_extra_info/member_extra_info.lib.php +++ b/addons/member_extra_info/member_extra_info.lib.php @@ -1,49 +1,54 @@ cached) { - $GLOBALS['_transImageNameList'][$member_srl]->cached = true; - $image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl); - $image_mark_file = sprintf('files/member_extra_info/image_mark/%s%d.gif', getNumberingPath($member_srl), $member_srl); - if(file_exists($image_name_file)) $GLOBALS['_transImageNameList'][$member_srl]->image_name_file = $image_name_file; - else $image_name_file = ''; - if(file_exists($image_mark_file)) $GLOBALS['_transImageNameList'][$member_srl]->image_mark_file = $image_mark_file; - else $image_mark_file = ''; + // If pre-defined data in the global variablesm return it + if(!$GLOBALS['_transImageNameList'][$member_srl]->cached) + { + $GLOBALS['_transImageNameList'][$member_srl]->cached = true; + $image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl); + $image_mark_file = sprintf('files/member_extra_info/image_mark/%s%d.gif', getNumberingPath($member_srl), $member_srl); + if(file_exists($image_name_file)) $GLOBALS['_transImageNameList'][$member_srl]->image_name_file = $image_name_file; + else $image_name_file = ''; + if(file_exists($image_mark_file)) $GLOBALS['_transImageNameList'][$member_srl]->image_mark_file = $image_mark_file; + else $image_mark_file = ''; - $site_module_info = Context::get('site_module_info'); - $group_image = $oMemberModel->getGroupImageMark($member_srl,$site_module_info->site_srl); - $GLOBALS['_transImageNameList'][$member_srl]->group_image = $group_image; - } else { - $group_image = $GLOBALS['_transImageNameList'][$member_srl]->group_image; - $image_name_file = $GLOBALS['_transImageNameList'][$member_srl]->image_name_file; - $image_mark_file = $GLOBALS['_transImageNameList'][$member_srl]->image_mark_file; - } - // If image name and mark doesn't exist, set the original information - if(!$image_name_file && !$image_mark_file && !$group_image) return $matches[0]; + $site_module_info = Context::get('site_module_info'); + $group_image = $oMemberModel->getGroupImageMark($member_srl,$site_module_info->site_srl); + $GLOBALS['_transImageNameList'][$member_srl]->group_image = $group_image; + } + else + { + $group_image = $GLOBALS['_transImageNameList'][$member_srl]->group_image; + $image_name_file = $GLOBALS['_transImageNameList'][$member_srl]->image_name_file; + $image_mark_file = $GLOBALS['_transImageNameList'][$member_srl]->image_mark_file; + } + // If image name and mark doesn't exist, set the original information + if(!$image_name_file && !$image_mark_file && !$group_image) return $matches[0]; - // check member_config - - $config = $oMemberModel->getMemberConfig(); + // check member_config - if($config->image_name == 'Y' && $image_name_file) $nick_name = sprintf('id: %s', Context::getRequestUri(),$image_name_file, strip_tags($nick_name), strip_tags($nick_name)); - if($config->image_mark == 'Y' && $image_mark_file) $nick_name = sprintf('id: %s%s', Context::getRequestUri(),$image_mark_file, strip_tags($nick_name), strip_tags($nick_name), $nick_name); + $config = $oMemberModel->getMemberConfig(); - if($group_image) $nick_name = sprintf('%s%s', $group_image->src, $group_image->title, $group_image->description, $nick_name); + if($config->image_name == 'Y' && $image_name_file) $nick_name = sprintf('id: %s', Context::getRequestUri(),$image_name_file, strip_tags($nick_name), strip_tags($nick_name)); + if($config->image_mark == 'Y' && $image_mark_file) $nick_name = sprintf('id: %s%s', Context::getRequestUri(),$image_mark_file, strip_tags($nick_name), strip_tags($nick_name), $nick_name); + + if($group_image) $nick_name = sprintf('%s%s', $group_image->src, $group_image->title, $group_image->description, $nick_name); - $orig_text = preg_replace('/'.preg_quote($matches[5],'/').'<\/'.$matches[6].'>$/', '', $matches[0]); - return $orig_text.$nick_name.''; - } -?> + $orig_text = preg_replace('/'.preg_quote($matches[5],'/').'<\/'.$matches[6].'>$/', '', $matches[0]); + return $orig_text.$nick_name.''; +} +/* End of file member_extra_info.lib.php */ +/* Location: ./addons/member_extra_info/member_extra_info.lib.php */ diff --git a/addons/mobile/classes/hdml.class.php b/addons/mobile/classes/hdml.class.php index fbad40d06..a51eb79bc 100644 --- a/addons/mobile/classes/hdml.class.php +++ b/addons/mobile/classes/hdml.class.php @@ -1,103 +1,124 @@ charset); - header("Cache-Control: no-store, no-cache, must-revalidate"); - header("Cache-Control: post-check=0, pre-check=0", false); - header("Pragma: no-cache"); + /** + * @brief hdml header output + **/ + function printHeader() + { + header("Content-Type:text/x-hdml; charset=".$this->charset); + header("Cache-Control: no-store, no-cache, must-revalidate"); + header("Cache-Control: post-check=0, pre-check=0", false); + header("Pragma: no-cache"); - print ''; - print "\n"; - print $this->hasChilds()?'':''; - print "\n"; + print ''; + print "\n"; + print $this->hasChilds()?'':''; + print "\n"; - if($this->upperUrl) { - $url = $this->upperUrl; - printf('%s', $url->url, $url->text, "\n"); - } - } + if($this->upperUrl) + { + $url = $this->upperUrl; + printf('%s', $url->url, $url->text, "\n"); + } + } - /** - * @brief Output title - **/ - function printTitle() { - if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); - printf('<%s%s>%s', $this->title,$titlePageStr,"\n"); - } + /** + * @brief Output title + **/ + function printTitle() + { + if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); + printf('<%s%s>%s', $this->title,$titlePageStr,"\n"); + } - /** - * @brief Output information - * hasChilds() if there is a list of content types, otherwise output - **/ - function printContent() { - if($this->hasChilds()) { - foreach($this->getChilds() as $key => $val) { - if(!$val['link']) continue; - printf('%s%s',Context::getLang('cmd_select'), $val['href'], $val['text'], "\n"); - } - } else { - printf('%s
%s', $this->getContent(),"\n"); - } - } + /** + * @brief Output information + * hasChilds() if there is a list of content types, otherwise output + **/ + function printContent() + { + if($this->hasChilds()) + { + foreach($this->getChilds() as $key => $val) + { + if(!$val['link']) continue; + printf('%s%s',Context::getLang('cmd_select'), $val['href'], $val['text'], "\n"); + } + } + else + { + printf('%s
%s', $this->getContent(),"\n"); + } + } - /** - * @brief Button to output - **/ - function printBtn() { - // Menu Types - if($this->hasChilds()) { - if($this->nextUrl) { - $url = $this->nextUrl; - printf('%s%s', $url->text, $url->url, $url->text, "\n"); - } - if($this->prevUrl) { - $url = $this->prevUrl; - printf('%s%s', $url->text, $url->url, $url->text, "\n"); - } - if($this->homeUrl) { - $url = $this->homeUrl; - printf('%s%s', $url->text, $url->url, $url->text, "\n"); - } - // Content Types - } else { - if($this->nextUrl) { - $url = $this->nextUrl; - printf('%s', $url->text, $url->url, $url->text); - } - if($this->prevUrl) { - $url = $this->prevUrl; - printf('%s', $url->text, $url->url, $url->text); - } - if($this->homeUrl) { - $url = $this->homeUrl; - printf('%s', $url->text, $url->url, $url->text); - } - } - } + /** + * @brief Button to output + **/ + function printBtn() + { + // Menu Types + if($this->hasChilds()) + { + if($this->nextUrl) + { + $url = $this->nextUrl; + printf('%s%s', $url->text, $url->url, $url->text, "\n"); + } + if($this->prevUrl) + { + $url = $this->prevUrl; + printf('%s%s', $url->text, $url->url, $url->text, "\n"); + } + if($this->homeUrl) + { + $url = $this->homeUrl; + printf('%s%s', $url->text, $url->url, $url->text, "\n"); + } + // Content Types + } + else + { + if($this->nextUrl) + { + $url = $this->nextUrl; + printf('%s', $url->text, $url->url, $url->text); + } + if($this->prevUrl) + { + $url = $this->prevUrl; + printf('%s', $url->text, $url->url, $url->text); + } + if($this->homeUrl) + { + $url = $this->homeUrl; + printf('%s', $url->text, $url->url, $url->text); + } + } + } - /** - * @brief Footer information output - **/ - function printFooter() { - print $this->hasChilds()?'
':'
'; - print "\n"; - print("
"); - } + /** + * @brief Footer information output + **/ + function printFooter() + { + print $this->hasChilds()?'':''; + print "\n"; + print(""); + } +} - } -?> +/* End of file hdml.class.php */ +/* Location: ./addons/mobile/classes/hdml.class.php */ diff --git a/addons/mobile/classes/mhtml.class.php b/addons/mobile/classes/mhtml.class.php index a03ffb20b..8a1074f58 100644 --- a/addons/mobile/classes/mhtml.class.php +++ b/addons/mobile/classes/mhtml.class.php @@ -1,80 +1,98 @@ \n"); + if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); + printf("%s%s\n", htmlspecialchars($this->title),htmlspecialchars($titlePageStr)); + } + // Output title + function printTitle() + { + if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); + printf('<%s%s>
%s', htmlspecialchars($this->title),htmlspecialchars($titlePageStr),"\n"); + } - /** - * @brief hdml header output - **/ - function printHeader() { - print("\n"); - if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); - printf("%s%s\n", htmlspecialchars($this->title),htmlspecialchars($titlePageStr)); - } - // Output title - function printTitle() { - if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); - printf('<%s%s>
%s', htmlspecialchars($this->title),htmlspecialchars($titlePageStr),"\n"); - } + /** + * @brief Output information + * hasChilds() if there is a list of content types, otherwise output + **/ + function printContent() + { + if($this->hasChilds()) + { + foreach($this->getChilds() as $key => $val) + { + if(!$val['link']) continue; + printf('%s
%s', $val['href'], $this->getNo(), $val['text'], "\n"); + if($val['extra']) printf("
%s\n",str_replace('
','
',$val['extra'])); + } + } + else + { + print(str_replace('
','
',$this->getContent())."\n"); + } + print "

"; + } - /** - * @brief Output information - * hasChilds() if there is a list of content types, otherwise output - **/ - function printContent() { - if($this->hasChilds()) { - foreach($this->getChilds() as $key => $val) { - if(!$val['link']) continue; - printf('%s
%s', $val['href'], $this->getNo(), $val['text'], "\n"); - if($val['extra']) printf("
%s\n",str_replace('
','
',$val['extra'])); - } - } else { - print(str_replace('
','
',$this->getContent())."\n"); - } - print "

"; - } - - /** - * @brief Button to output - **/ - function printBtn() { - if($this->nextUrl) { - $url = $this->nextUrl; - printf('%s
%s', $url->url, $url->text, "\n"); - } - if($this->prevUrl) { - $url = $this->prevUrl; - printf('%s
%s', $url->url, $url->text, "\n"); - } - // Select Language - if(!parent::isLangChange()){ - $url = getUrl('','lcm','1','sel_lang',Context::getLangType(),'return_uri',Context::get('current_url')); - printf('%s
%s', $url, 'Language : '.Context::getLang('select_lang'), "\n"); - } - else { - printf('%s
%s', Context::get('return_uri'), Context::getLang('lang_return'), "\n"); - } - if($this->upperUrl) { - $url = $this->upperUrl; - printf('%s', $url->url, $url->text, "\n"); - } - if($this->homeUrl) { - $url = $this->homeUrl; - printf('%s
%s', $url->text, $url->url, $url->text, "\n"); - } - } - // Footer information output - function printFooter() { - print("\n"); - } - } -?> + /** + * @brief Button to output + **/ + function printBtn() + { + if($this->nextUrl) + { + $url = $this->nextUrl; + printf('%s
%s', $url->url, $url->text, "\n"); + } + if($this->prevUrl) + { + $url = $this->prevUrl; + printf('%s
%s', $url->url, $url->text, "\n"); + } + // Select Language + if(!parent::isLangChange()) + { + $url = getUrl('','lcm','1','sel_lang',Context::getLangType(),'return_uri',Context::get('current_url')); + printf('%s
%s', $url, 'Language : '.Context::getLang('select_lang'), "\n"); + } + else + { + printf('%s
%s', Context::get('return_uri'), Context::getLang('lang_return'), "\n"); + } + if($this->upperUrl) + { + $url = $this->upperUrl; + printf('%s', $url->url, $url->text, "\n"); + } + if($this->homeUrl) + { + $url = $this->homeUrl; + printf('%s
%s', $url->text, $url->url, $url->text, "\n"); + } + } + // Footer information output + function printFooter() + { + print("\n"); + } +} +/* End of file mhtml.class.php */ +/* Location: ./addons/mobile/classes/mhtml.class.php */ diff --git a/addons/mobile/classes/mobile.class.php b/addons/mobile/classes/mobile.class.php index bd460da87..2592b4681 100644 --- a/addons/mobile/classes/mobile.class.php +++ b/addons/mobile/classes/mobile.class.php @@ -1,565 +1,632 @@ lang = FileHandler::readFile('./files/cache/addons/mobile/setLangType/personal_settings/'.md5(trim($_SERVER['HTTP_USER_AGENT']).trim($_SERVER['HTTP_PHONE_NUMBER']).trim($_SERVER['HTTP_HTTP_PHONE_NUMBER'])).'.php'); - if($this->lang) { - $lang_supported = Context::get('lang_supported'); - $this->lang = str_replace(array(''),array('',''),$this->lang); - if(isset($lang_supported[$this->lang])) Context::setLangType($this->lang); - } - Context::loadLang(_XE_PATH_.'addons/mobile/lang'); - - $instance = new wap(); - - $mobilePage = (int)Context::get('mpage'); - if(!$mobilePage) $mobilePage = 1; - - $instance->setMobilePage($mobilePage); - - } - - return $instance; - } - - /** - * @brief constructor - **/ - function mobileXE() { - // Check navigation mode - if(Context::get('nm')) { - $this->navigationMode = 1; - $this->cmid = (int)Context::get('cmid'); - } - - if(Context::get('lcm')) { - $this->languageMode = 1; - $this->lang = Context::get('sel_lang'); - } - } - - /** - * @brief Check navigation mode - * navigationMode settings and modules of information must be menu_srl return to navigation mode = true - **/ - function isNavigationMode() { - return ($this->navigationMode && $this->module_info->menu_srl)?true:false; - } - - /** - * @brief Check langchange mode - * true return should be set languageMode - **/ - function isLangChange() { - if($this->languageMode) return true; - else return false; - } - - /** - * @brief Language settings - * Cookies Since you set your phone to store language-specific file, file creation - **/ - function setLangType() { - $lang_supported = Context::get('lang_supported'); - // Make sure that the language variables and parameters are valid - if($this->lang && isset($lang_supported[$this->lang])) { - $langbuff = FileHandler::readFile('./files/cache/addons/mobile/setLangType/personal_settings/'.md5(trim($_SERVER['HTTP_USER_AGENT']).trim($_SERVER['HTTP_PHONE_NUMBER']).trim($_SERVER['HTTP_HTTP_PHONE_NUMBER'])).'.php'); - if($langbuff) FileHandler::removeFile('./files/cache/addons/mobile/setLangType/personal_settings/'.md5(trim($_SERVER['HTTP_USER_AGENT']).trim($_SERVER['HTTP_PHONE_NUMBER']).trim($_SERVER['HTTP_HTTP_PHONE_NUMBER'])).'.php'); - $langbuff = 'lang.'**/ ?>'; - FileHandler::writeFile('./files/cache/addons/mobile/setLangType/personal_settings/'.md5(trim($_SERVER['HTTP_USER_AGENT']).trim($_SERVER['HTTP_PHONE_NUMBER']).trim($_SERVER['HTTP_HTTP_PHONE_NUMBER'])).'.php',$langbuff); - } - } - - /** - * @brief Information currently requested module settings - **/ - function setModuleInfo(&$module_info) { - if($this->module_info) return; - $this->module_info = $module_info; - } - - /** - * @brief Set the module instance is currently running - **/ - function setModuleInstance(&$oModule) { - if($this->oModule) return; - // Save instance - $this->oModule = $oModule; - // Of the current module if there is a menu by menu - $menu_cache_file = sprintf(_XE_PATH_.'files/cache/menu/%d.php', $this->module_info->menu_srl); - if(!file_exists($menu_cache_file)) return; - - include $menu_cache_file; - // One-dimensional arrangement of menu changes - $this->getListedItems($menu->list, $listed_items, $node_list); - - $this->listed_items = $listed_items; - $this->node_list = $node_list; - $this->menu = $menu->list; - - $k = array_keys($node_list); - $v = array_values($node_list); - $this->index_mid = $k[0]; - // The depth of the current menu, the top button to specify if one or more - $cur_menu_item = $listed_items[$node_list[$this->module_info->mid]]; - if($cur_menu_item['parent_srl']) { - $parent_srl = $cur_menu_item['parent_srl']; - if($parent_srl && $listed_items[$parent_srl]) { - $parent_item = $listed_items[$parent_srl]; - if($parent_item) $this->setUpperUrl(getUrl('','mid',$parent_item['mid']), Context::getLang('cmd_go_upper')); - } - } elseif (!$this->isNavigationMode()) { - $this->setUpperUrl(getUrl('','mid',$this->index_mid,'nm','1','cmid',0), Context::getLang('cmd_view_sitemap')); - } - } - - /** - * @brief Access the browser's header to determine the return type of the browser - * Mobile browser, if not null return - **/ - function getBrowserType() { - if(Context::get('smartphone')) return null; - // Determine the type of browser - $browserAccept = $_SERVER['HTTP_ACCEPT']; - $userAgent = $_SERVER['HTTP_USER_AGENT']; - $wap_sid = $_SERVER['HTTP_X_UP_SUBNO']; - - if(preg_match("/SKT11/i", $userAgent) || preg_match("/skt/i", $browserAccept)) { - Context::set('mobile_skt',1); - return "wml"; - } - elseif(preg_match("/hdml/i", $browserAccept)) return "hdml"; - elseif(preg_match("/CellPhone/i", $userAgent)) return "mhtml"; - return null; - } - - /** - * @brief Specify charset - **/ - function setCharSet($charset = 'UTF-8') { - if(!$charset) $charset = 'UTF-8'; - // SKT supports the euc-kr - if(Context::get('mobile_skt')==1) $charset = 'euc-kr'; - - $this->charset = $charset; - } - - /** - * @brief Limited capacity of mobile devices, specifying a different virtual page - **/ - function setMobilePage($page=1) { - if(!$page) $page = 1; - $this->mobilePage = $page; - } - - /** - * @brief Mokrokhyeong child menu for specifying the data set - **/ - function setChilds($childs) { - // If more than nine the number of menu paging processing itself - $menu_count = count($childs); - if($menu_count>9) { - $startNum = ($this->mobilePage-1)*9; - $idx = 0; - $new_childs = array(); - foreach($childs as $k => $v) { - if($idx >= $startNum && $idx < $startNum+9) { - $new_childs[$k] = $v; - } - $idx ++; - } - $childs = $new_childs; - - $this->totalPage = (int)(($menu_count-1)/9)+1; - // next/prevUrl specify - if($this->mobilePage>1) { - $url = getUrl('mid',$_GET['mid'],'mpage',$this->mobilePage-1); - $text = sprintf('%s (%d/%d)', Context::getLang('cmd_prev'), $this->mobilePage-1, $this->totalPage); - $this->setPrevUrl($url, $text); - } - - if($this->mobilePage<$this->totalPage) { - $url = getUrl('mid',$_GET['mid'],'mpage',$this->mobilePage+1); - $text = sprintf('%s (%d/%d)', Context::getLang('cmd_next'), $this->mobilePage+1, $this->totalPage); - $this->setNextUrl($url, $text); - } - } - $this->childs = $childs; - } - - /** - * @brief Check the menu to be output - **/ - function hasChilds() { - return count($this->childs)?true:0; - } - - /** - * @brief Returns the child menu - **/ - function getChilds() { - return $this->childs; - } - - /** - * @brief Specify title - **/ - function setTitle($title) { - $oModuleController = &getController('module'); - $this->title = $title; - $oModuleController->replaceDefinedLangCode($this->title); - } - - /** - * @brief return title - **/ - function getTitle() { - return $this->title; - } - - /** - * @brief Content Cleanup - * In HTML content, the ability to extract text and links - **/ - function setContent($content) { - $oModuleController = &getController('module'); - $allow_tag_array = array('','
','

','','','','','','','','','','
'); - // Links/wrap, remove all tags except gangjoman - $content = strip_tags($content, implode($allow_tag_array)); - // Margins tab removed - $content = str_replace("\t", "", $content); - // Repeat two more times the space and remove julnanumeul - $content = preg_replace('/( ){2,}/s', '', $content); - $content = preg_replace("/([\r\n]+)/s", "\r\n", $content); - $content = preg_replace(array("/","
"), array("
","
"), $content); - - while(strpos($content, '

')) { - $content = str_replace('

','
',$content); - } - // If the required size of a deck of mobile content to write down all the dividing pages - $contents = array(); - while($content) { - $tmp = $this->cutStr($content, $this->deckSize, ''); - $contents[] = $tmp; - $content = substr($content, strlen($tmp)); - - //$content = str_replace(array('&','<','>','"','&nbsp;'), array('&','<','>','"',' '), $content); - - foreach($allow_tag_array as $tag) { - if($tag == '
') continue; - $tag_open_pos = strpos($content, str_replace('>','',$tag)); - $tag_close_pos = strpos($content, str_replace('<','totalPage = count($contents); - // next/prevUrl specify - if($this->mobilePage>1) { - $url = getUrl('mid',$_GET['mid'],'mpage',$this->mobilePage-1); - $text = sprintf('%s (%d/%d)', Context::getLang('cmd_prev'), $this->mobilePage-1, $this->totalPage); - $this->setPrevUrl($url, $text); - } - - if($this->mobilePage<$this->totalPage) { - $url = getUrl('mid',$_GET['mid'],'mpage',$this->mobilePage+1); - $text = sprintf('%s (%d/%d)', Context::getLang('cmd_next'), $this->mobilePage+1, $this->totalPage); - $this->setNextUrl($url, $text); - } - - $this->content = $contents[$this->mobilePage-1]; - $oModuleController->replaceDefinedLangCode($this->content); - $content = str_replace(array('$','\''), array('$$','''), $content); - } - - /** - * @brief cutting the number of byte functions - **/ - function cutStr($string, $cut_size) { - return preg_match('/.{'.$cut_size.'}/su', $string, $arr) ? $arr[0] : $string; - } - - /** - * @brief Return content - **/ - function getContent() { - return $this->content; - } - - /** - * @brief Specifies the home url - **/ - function setHomeUrl($url, $text) { - if(!$url) $url = '#'; - $this->homeUrl->url = $url; - $this->homeUrl->text = $text; - } - - /** - * @brief Specify upper url - **/ - function setUpperUrl($url, $text) { - if(!$url) $url = '#'; - $this->upperUrl->url = $url; - $this->upperUrl->text = $text; - } - - /** - * @brief Specify prev url - **/ - function setPrevUrl($url, $text) { - if(!$url) $url = '#'; - $this->prevUrl->url = $url; - $this->prevUrl->text = $text; - } - - /** - * @brief Specify next url - **/ - function setNextUrl($url, $text) { - if(!$url) $url = '#'; - $this->nextUrl->url = $url; - $this->nextUrl->text = $text; - } - - /** - * @brief Next, Previous, Top button assignments other than - **/ - function setEtcBtn($url, $text) { - if(!$url) $url = '#'; - $etc['url'] = $url; - $etc['text'] = htmlspecialchars($text); - $this->etcBtn[] = $etc; - } - - /** - * @brief display - **/ - function display() { - // Home button assignments - $this->setHomeUrl(getUrl(), Context::getLang('cmd_go_home')); - // Specify the title - if(!$this->title) $this->setTitle(Context::getBrowserTitle()); - - ob_start(); - // Output header - $this->printHeader(); - // Output title - $this->printTitle(); - // Information output - $this->printContent(); - // Button output - $this->printBtn(); - // Footer output - $this->printFooter(); - - $content = ob_get_clean(); - // After conversion output - if(strtolower($this->charset) == 'utf-8') print $content; - else print iconv('UTF-8',$this->charset."//TRANSLIT//IGNORE", $content); - - exit(); - } - - /** - * @brief Move page - **/ - function movepage($url) { - header("location:$url"); - exit(); - } - - /** - * @brief And returns a list of serial numbers in - **/ - function getNo() { - $this->no++; - $str = $this->no; - return $str; - } - - /** - * @brief XE is easy to use Menu module is relieved during the function, value - **/ - function getListedItems($menu, &$listed_items, &$node_list) { - if(!count($menu)) return; - foreach($menu as $node_srl => $item) { - if(preg_match('/^([a-zA-Z0-9\_\-]+)$/', $item['url'])) { - $mid = $item['mid'] = $item['url']; - $node_list[$mid] = $node_srl; - } else { - $mid = $item['mid'] = null; - } - - $listed_items[$node_srl] = $item; - $this->getListedItems($item['list'], $listed_items, $node_list); - } - } - - /** - * @brief XE navigation output - **/ - function displayNavigationContent() { - $childs = array(); - - if($this->cmid) { - $cur_item = $this->listed_items[$this->cmid]; - $upper_srl = $cur_item['parent_srl'];; - $list = $cur_item['list'];; - $this->setUpperUrl(getUrl('cmid',$upper_srl), Context::getLang('cmd_go_upper')); - if(preg_match('/^([a-zA-Z0-9\_\-]+)$/', $cur_item['url'])) { - $obj = null; - $obj['href'] = getUrl('','mid',$cur_item['url']); - $obj['link'] = $obj['text'] = '['.$cur_item['text'].']'; - $childs[] = $obj; - } - - } else { - $list = $this->menu; - $upper_srl = 0; - } - - - if(count($list)) { - foreach($list as $key => $val) { - if(!$val['text']) continue; - $obj = null; - if(!count($val['list'])) { - $obj['href'] = getUrl('','mid',$val['url']); - } else { - $obj['href'] = getUrl('cmid',$val['node_srl']); - } - $obj['link'] = $obj['text'] = $val['text']; - $childs[] = $obj; - } - $this->setChilds($childs); - } - // Output - $this->display(); - } - - /** - * @brief Language Settings menu, the output - **/ - function displayLangSelect() { - $childs = array(); - - $this->lang = FileHandler::readFile('./files/cache/addons/mobile/setLangType/personal_settings/'.md5(trim($_SERVER['HTTP_USER_AGENT']).trim($_SERVER['HTTP_PHONE_NUMBER']).trim($_SERVER['HTTP_HTTP_PHONE_NUMBER'])).'.php'); - if($this->lang) { - $this->lang = str_replace(array(''),array('',''),$this->lang); - Context::setLangType($this->lang); - } - $lang_supported = Context::get('lang_supported'); - $lang_type = Context::getLangType(); - $obj = null; - $obj['link'] = $obj['text'] = Context::getLang('president_lang').' : '.$lang_supported[$lang_type]; - $obj['href'] = getUrl('sel_lang',$lang_type); - $childs[] = $obj; - - if(is_array($lang_supported)) { - foreach($lang_supported as $key => $val) { - $obj = null; - $obj['link'] = $obj['text'] = $val; - $obj['href'] = getUrl('sel_lang',$key); - $childs[] = $obj; - } - } - - $this->setChilds($childs); - - $this->display(); - } - - /** - * @brief Module to create a class object of the WAP WAP ready - **/ - function displayModuleContent() { - // Create WAP class objects of the selected module - $oModule = &getWap($this->module_info->module); - if(!$oModule || !method_exists($oModule, 'procWAP') ) return; - - $vars = get_object_vars($this->oModule); - if(count($vars)) foreach($vars as $key => $val) $oModule->{$key} = $val; - // Run - $oModule->procWAP($this); - // Output - $this->display(); - } - - /** - * @brief WAP content is available as a separate output if the final results - **/ - function displayContent() { - Context::set('layout','none'); - // Compile a template - $oTemplate = new TemplateHandler(); - $oContext = &Context::getInstance(); - - $content = $oTemplate->compile($this->oModule->getTemplatePath(), $this->oModule->getTemplateFile()); - $this->setContent($content); - // Output - $this->display(); - } - } -?> +/** + * Mobile XE Library Class ver 0.1 + * @author NHN (developers@xpressengine.com) / lang_select : misol + * @brief XE library for WAP tag output + */ +class mobileXE +{ + // Base url + var $homeUrl = NULL; + var $upperUrl = NULL; + var $nextUrl = NULL; + var $prevUrl = NULL; + var $etcBtn = NULL; + // Variable for menu navigation + var $childs = null; + // Basic variable + var $title = NULL; + var $content = NULL; + var $mobilePage = 0; + var $totalPage = 1; + var $charset = 'UTF-8'; + var $no = 0; + // Navigation-related variables + var $menu = null; + var $listed_items = null; + var $node_list = null; + var $index_mid = null; + // Navigation On/Off status value + var $navigationMode = 0; + // XE module information currently requested + var $module_info = null; + // Currently running instance of the module + var $oModule = null; + + // Deck size + var $deckSize = 1024; + // Changing the language setting + var $languageMode = 0; + var $lang = null; + /** + * @brief getInstance + */ + function &getInstance() + { + static $instance = null; + + if(!$instance) + { + + $browserType = mobileXE::getBrowserType(); + if(!$browserType) return; + + $class_file = sprintf('%saddons/mobile/classes/%s.class.php', _XE_PATH_, $browserType); + require_once($class_file); + // Download mobile language settings (cookies, not willing to come up when you click create cache file ...- is initialized ..) + $this->lang = FileHandler::readFile('./files/cache/addons/mobile/setLangType/personal_settings/'.md5(trim($_SERVER['HTTP_USER_AGENT']).trim($_SERVER['HTTP_PHONE_NUMBER']).trim($_SERVER['HTTP_HTTP_PHONE_NUMBER'])).'.php'); + if($this->lang) + { + $lang_supported = Context::get('lang_supported'); + $this->lang = str_replace(array(''),array('',''),$this->lang); + if(isset($lang_supported[$this->lang])) Context::setLangType($this->lang); + } + Context::loadLang(_XE_PATH_.'addons/mobile/lang'); + + $instance = new wap(); + + $mobilePage = (int)Context::get('mpage'); + if(!$mobilePage) $mobilePage = 1; + + $instance->setMobilePage($mobilePage); + } + return $instance; + } + + /** + * @brief constructor + */ + function mobileXE() + { + // Check navigation mode + if(Context::get('nm')) + { + $this->navigationMode = 1; + $this->cmid = (int)Context::get('cmid'); + } + + if(Context::get('lcm')) + { + $this->languageMode = 1; + $this->lang = Context::get('sel_lang'); + } + } + + /** + * @brief Check navigation mode + * navigationMode settings and modules of information must be menu_srl return to navigation mode = true + */ + function isNavigationMode() + { + return ($this->navigationMode && $this->module_info->menu_srl)?true:false; + } + + /** + * @brief Check langchange mode + * true return should be set languageMode + */ + function isLangChange() + { + if($this->languageMode) return true; + else return false; + } + + /** + * @brief Language settings + * Cookies Since you set your phone to store language-specific file, file creation + */ + function setLangType() + { + $lang_supported = Context::get('lang_supported'); + // Make sure that the language variables and parameters are valid + if($this->lang && isset($lang_supported[$this->lang])) + { + $langbuff = FileHandler::readFile('./files/cache/addons/mobile/setLangType/personal_settings/'.md5(trim($_SERVER['HTTP_USER_AGENT']).trim($_SERVER['HTTP_PHONE_NUMBER']).trim($_SERVER['HTTP_HTTP_PHONE_NUMBER'])).'.php'); + if($langbuff) FileHandler::removeFile('./files/cache/addons/mobile/setLangType/personal_settings/'.md5(trim($_SERVER['HTTP_USER_AGENT']).trim($_SERVER['HTTP_PHONE_NUMBER']).trim($_SERVER['HTTP_HTTP_PHONE_NUMBER'])).'.php'); + $langbuff = 'lang.'**/ ?>'; + FileHandler::writeFile('./files/cache/addons/mobile/setLangType/personal_settings/'.md5(trim($_SERVER['HTTP_USER_AGENT']).trim($_SERVER['HTTP_PHONE_NUMBER']).trim($_SERVER['HTTP_HTTP_PHONE_NUMBER'])).'.php',$langbuff); + } + } + + /** + * @brief Information currently requested module settings + */ + function setModuleInfo(&$module_info) + { + if($this->module_info) return; + $this->module_info = $module_info; + } + + /** + * @brief Set the module instance is currently running + */ + function setModuleInstance(&$oModule) + { + if($this->oModule) return; + // Save instance + $this->oModule = $oModule; + // Of the current module if there is a menu by menu + $menu_cache_file = sprintf(_XE_PATH_.'files/cache/menu/%d.php', $this->module_info->menu_srl); + if(!file_exists($menu_cache_file)) return; + + include $menu_cache_file; + // One-dimensional arrangement of menu changes + $this->getListedItems($menu->list, $listed_items, $node_list); + + $this->listed_items = $listed_items; + $this->node_list = $node_list; + $this->menu = $menu->list; + + $k = array_keys($node_list); + $v = array_values($node_list); + $this->index_mid = $k[0]; + // The depth of the current menu, the top button to specify if one or more + $cur_menu_item = $listed_items[$node_list[$this->module_info->mid]]; + if($cur_menu_item['parent_srl']) + { + $parent_srl = $cur_menu_item['parent_srl']; + if($parent_srl && $listed_items[$parent_srl]) + { + $parent_item = $listed_items[$parent_srl]; + if($parent_item) $this->setUpperUrl(getUrl('','mid',$parent_item['mid']), Context::getLang('cmd_go_upper')); + } + } + elseif (!$this->isNavigationMode()) + { + $this->setUpperUrl(getUrl('','mid',$this->index_mid,'nm','1','cmid',0), Context::getLang('cmd_view_sitemap')); + } + } + + /** + * @brief Access the browser's header to determine the return type of the browser + * Mobile browser, if not null return + */ + function getBrowserType() + { + if(Context::get('smartphone')) return null; + // Determine the type of browser + $browserAccept = $_SERVER['HTTP_ACCEPT']; + $userAgent = $_SERVER['HTTP_USER_AGENT']; + $wap_sid = $_SERVER['HTTP_X_UP_SUBNO']; + + if(preg_match("/SKT11/i", $userAgent) || preg_match("/skt/i", $browserAccept)) + { + Context::set('mobile_skt',1); + return "wml"; + } + elseif(preg_match("/hdml/i", $browserAccept)) return "hdml"; + elseif(preg_match("/CellPhone/i", $userAgent)) return "mhtml"; + return null; + } + + /** + * @brief Specify charset + */ + function setCharSet($charset = 'UTF-8') + { + if(!$charset) $charset = 'UTF-8'; + // SKT supports the euc-kr + if(Context::get('mobile_skt')==1) $charset = 'euc-kr'; + + $this->charset = $charset; + } + + /** + * @brief Limited capacity of mobile devices, specifying a different virtual page + */ + function setMobilePage($page=1) + { + if(!$page) $page = 1; + $this->mobilePage = $page; + } + + /** + * @brief Mokrokhyeong child menu for specifying the data set + */ + function setChilds($childs) + { + // If more than nine the number of menu paging processing itself + $menu_count = count($childs); + if($menu_count>9) + { + $startNum = ($this->mobilePage-1)*9; + $idx = 0; + $new_childs = array(); + foreach($childs as $k => $v) + { + if($idx >= $startNum && $idx < $startNum+9) + { + $new_childs[$k] = $v; + } + $idx ++; + } + $childs = $new_childs; + + $this->totalPage = (int)(($menu_count-1)/9)+1; + // next/prevUrl specify + if($this->mobilePage>1) + { + $url = getUrl('mid',$_GET['mid'],'mpage',$this->mobilePage-1); + $text = sprintf('%s (%d/%d)', Context::getLang('cmd_prev'), $this->mobilePage-1, $this->totalPage); + $this->setPrevUrl($url, $text); + } + + if($this->mobilePage<$this->totalPage) + { + $url = getUrl('mid',$_GET['mid'],'mpage',$this->mobilePage+1); + $text = sprintf('%s (%d/%d)', Context::getLang('cmd_next'), $this->mobilePage+1, $this->totalPage); + $this->setNextUrl($url, $text); + } + } + $this->childs = $childs; + } + + /** + * @brief Check the menu to be output + */ + function hasChilds() + { + return count($this->childs)?true:0; + } + + /** + * @brief Returns the child menu + */ + function getChilds() + { + return $this->childs; + } + + /** + * @brief Specify title + */ + function setTitle($title) + { + $oModuleController = &getController('module'); + $this->title = $title; + $oModuleController->replaceDefinedLangCode($this->title); + } + + /** + * @brief return title + */ + function getTitle() + { + return $this->title; + } + + /** + * @brief Content Cleanup + * In HTML content, the ability to extract text and links + */ + function setContent($content) + { + $oModuleController = &getController('module'); + $allow_tag_array = array('
','
','

','','','','','','','','','','
'); + // Links/wrap, remove all tags except gangjoman + $content = strip_tags($content, implode($allow_tag_array)); + // Margins tab removed + $content = str_replace("\t", "", $content); + // Repeat two more times the space and remove julnanumeul + $content = preg_replace('/( ){2,}/s', '', $content); + $content = preg_replace("/([\r\n]+)/s", "\r\n", $content); + $content = preg_replace(array("/","
"), array("
","
"), $content); + + while(strpos($content, '

')) + { + $content = str_replace('

','
',$content); + } + // If the required size of a deck of mobile content to write down all the dividing pages + $contents = array(); + while($content) + { + $tmp = $this->cutStr($content, $this->deckSize, ''); + $contents[] = $tmp; + $content = substr($content, strlen($tmp)); + + //$content = str_replace(array('&','<','>','"','&nbsp;'), array('&','<','>','"',' '), $content); + + foreach($allow_tag_array as $tag) + { + if($tag == '
') continue; + $tag_open_pos = strpos($content, str_replace('>','',$tag)); + $tag_close_pos = strpos($content, str_replace('<','totalPage = count($contents); + // next/prevUrl specify + if($this->mobilePage>1) + { + $url = getUrl('mid',$_GET['mid'],'mpage',$this->mobilePage-1); + $text = sprintf('%s (%d/%d)', Context::getLang('cmd_prev'), $this->mobilePage-1, $this->totalPage); + $this->setPrevUrl($url, $text); + } + + if($this->mobilePage<$this->totalPage) + { + $url = getUrl('mid',$_GET['mid'],'mpage',$this->mobilePage+1); + $text = sprintf('%s (%d/%d)', Context::getLang('cmd_next'), $this->mobilePage+1, $this->totalPage); + $this->setNextUrl($url, $text); + } + + $this->content = $contents[$this->mobilePage-1]; + $oModuleController->replaceDefinedLangCode($this->content); + $content = str_replace(array('$','\''), array('$$','''), $content); + } + + /** + * @brief cutting the number of byte functions + */ + function cutStr($string, $cut_size) + { + return preg_match('/.{'.$cut_size.'}/su', $string, $arr) ? $arr[0] : $string; + } + + /** + * @brief Return content + */ + function getContent() + { + return $this->content; + } + + /** + * @brief Specifies the home url + */ + function setHomeUrl($url, $text) + { + if(!$url) $url = '#'; + $this->homeUrl->url = $url; + $this->homeUrl->text = $text; + } + + /** + * @brief Specify upper url + */ + function setUpperUrl($url, $text) + { + if(!$url) $url = '#'; + $this->upperUrl->url = $url; + $this->upperUrl->text = $text; + } + + /** + * @brief Specify prev url + */ + function setPrevUrl($url, $text) + { + if(!$url) $url = '#'; + $this->prevUrl->url = $url; + $this->prevUrl->text = $text; + } + + /** + * @brief Specify next url + */ + function setNextUrl($url, $text) + { + if(!$url) $url = '#'; + $this->nextUrl->url = $url; + $this->nextUrl->text = $text; + } + + /** + * @brief Next, Previous, Top button assignments other than + */ + function setEtcBtn($url, $text) + { + if(!$url) $url = '#'; + $etc['url'] = $url; + $etc['text'] = htmlspecialchars($text); + $this->etcBtn[] = $etc; + } + + /** + * @brief display + */ + function display() + { + // Home button assignments + $this->setHomeUrl(getUrl(), Context::getLang('cmd_go_home')); + // Specify the title + if(!$this->title) $this->setTitle(Context::getBrowserTitle()); + + ob_start(); + // Output header + $this->printHeader(); + // Output title + $this->printTitle(); + // Information output + $this->printContent(); + // Button output + $this->printBtn(); + // Footer output + $this->printFooter(); + + $content = ob_get_clean(); + // After conversion output + if(strtolower($this->charset) == 'utf-8') print $content; + else print iconv('UTF-8',$this->charset."//TRANSLIT//IGNORE", $content); + + exit(); + } + + /** + * @brief Move page + */ + function movepage($url) + { + header("location:$url"); + exit(); + } + + /** + * @brief And returns a list of serial numbers in + */ + function getNo() + { + $this->no++; + $str = $this->no; + return $str; + } + + /** + * @brief XE is easy to use Menu module is relieved during the function, value + */ + function getListedItems($menu, &$listed_items, &$node_list) + { + if(!count($menu)) return; + foreach($menu as $node_srl => $item) + { + if(preg_match('/^([a-zA-Z0-9\_\-]+)$/', $item['url'])) + { + $mid = $item['mid'] = $item['url']; + $node_list[$mid] = $node_srl; + } + else + { + $mid = $item['mid'] = null; + } + + $listed_items[$node_srl] = $item; + $this->getListedItems($item['list'], $listed_items, $node_list); + } + } + + /** + * @brief XE navigation output + */ + function displayNavigationContent() + { + $childs = array(); + + if($this->cmid) + { + $cur_item = $this->listed_items[$this->cmid]; + $upper_srl = $cur_item['parent_srl'];; + $list = $cur_item['list'];; + $this->setUpperUrl(getUrl('cmid',$upper_srl), Context::getLang('cmd_go_upper')); + if(preg_match('/^([a-zA-Z0-9\_\-]+)$/', $cur_item['url'])) + { + $obj = null; + $obj['href'] = getUrl('','mid',$cur_item['url']); + $obj['link'] = $obj['text'] = '['.$cur_item['text'].']'; + $childs[] = $obj; + } + + } + else + { + $list = $this->menu; + $upper_srl = 0; + } + + if(count($list)) + { + foreach($list as $key => $val) + { + if(!$val['text']) continue; + $obj = null; + if(!count($val['list'])) + { + $obj['href'] = getUrl('','mid',$val['url']); + } + else + { + $obj['href'] = getUrl('cmid',$val['node_srl']); + } + $obj['link'] = $obj['text'] = $val['text']; + $childs[] = $obj; + } + $this->setChilds($childs); + } + // Output + $this->display(); + } + + /** + * @brief Language Settings menu, the output + */ + function displayLangSelect() + { + $childs = array(); + + $this->lang = FileHandler::readFile('./files/cache/addons/mobile/setLangType/personal_settings/'.md5(trim($_SERVER['HTTP_USER_AGENT']).trim($_SERVER['HTTP_PHONE_NUMBER']).trim($_SERVER['HTTP_HTTP_PHONE_NUMBER'])).'.php'); + if($this->lang) + { + $this->lang = str_replace(array(''),array('',''),$this->lang); + Context::setLangType($this->lang); + } + $lang_supported = Context::get('lang_supported'); + $lang_type = Context::getLangType(); + $obj = null; + $obj['link'] = $obj['text'] = Context::getLang('president_lang').' : '.$lang_supported[$lang_type]; + $obj['href'] = getUrl('sel_lang',$lang_type); + $childs[] = $obj; + + if(is_array($lang_supported)) + { + foreach($lang_supported as $key => $val) + { + $obj = null; + $obj['link'] = $obj['text'] = $val; + $obj['href'] = getUrl('sel_lang',$key); + $childs[] = $obj; + } + } + + $this->setChilds($childs); + + $this->display(); + } + + /** + * @brief Module to create a class object of the WAP WAP ready + */ + function displayModuleContent() + { + // Create WAP class objects of the selected module + $oModule = &getWap($this->module_info->module); + if(!$oModule || !method_exists($oModule, 'procWAP') ) return; + + $vars = get_object_vars($this->oModule); + if(count($vars)) foreach($vars as $key => $val) $oModule->{$key} = $val; + // Run + $oModule->procWAP($this); + // Output + $this->display(); + } + + /** + * @brief WAP content is available as a separate output if the final results + */ + function displayContent() + { + Context::set('layout','none'); + // Compile a template + $oTemplate = new TemplateHandler(); + $oContext = &Context::getInstance(); + + $content = $oTemplate->compile($this->oModule->getTemplatePath(), $this->oModule->getTemplateFile()); + $this->setContent($content); + // Output + $this->display(); + } +} +/* End of file mobile.class.php */ +/* Location: ./addons/mobile/classes/mobile.class.php */ diff --git a/addons/mobile/classes/wml.class.php b/addons/mobile/classes/wml.class.php index a9a91fb95..c2b77a284 100644 --- a/addons/mobile/classes/wml.class.php +++ b/addons/mobile/classes/wml.class.php @@ -1,104 +1,127 @@ charset); + if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); + print("charset."\"?>\n"); + // Card Title + printf("\n\n

\n",htmlspecialchars($this->title),htmlspecialchars($titlePageStr)); + } - /** - * @brief wml header output - **/ - function printHeader() { - header("Content-Type: text/vnd.wap.wml"); - header("charset: ".$this->charset); - if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); - print("charset."\"?>\n"); - // Card Title - printf("\n\n

\n",htmlspecialchars($this->title),htmlspecialchars($titlePageStr)); - } + /** + * @brief Output title + */ + function printTitle() + { + if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); + printf('<%s%s>
%s', htmlspecialchars($this->title),htmlspecialchars($titlePageStr),"\n"); + } - /** - * @brief Output title - **/ - function printTitle() { - if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); - printf('<%s%s>
%s', htmlspecialchars($this->title),htmlspecialchars($titlePageStr),"\n"); - } + /** + * @brief Output information + * hasChilds() if there is a list of content types, otherwise output + */ + function printContent() + { + if($this->hasChilds()) + { + foreach($this->getChilds() as $key => $val) + { + if(!$val['link']) continue; + printf('%s', $this->getNo(), htmlspecialchars($val['text']), $val['href'], "\n"); + if($val['extra']) printf("%s\n",$val['extra']); + } + } + else + { + printf('%s
%s', str_replace("
","
",$this->getContent()),"\n"); + } + print('
'); + } - /** - * @brief Output information - * hasChilds() if there is a list of content types, otherwise output - **/ - function printContent() { - if($this->hasChilds()) { - foreach($this->getChilds() as $key => $val) { - if(!$val['link']) continue; - printf('%s', $this->getNo(), htmlspecialchars($val['text']), $val['href'], "\n"); - if($val['extra']) printf("%s\n",$val['extra']); - } - } else { - printf('%s
%s', str_replace("
","
",$this->getContent()),"\n"); - } - print('
'); - } - - /** - * @brief Button to output - **/ - function printBtn() { - if($this->nextUrl) { - $url = $this->nextUrl; - printf('%s', $url->text, $url->url, "\n"); - } - if($this->prevUrl) { - $url = $this->prevUrl; - printf('%s', $url->text, $url->url, "\n"); - } - // Others are not applicable in charge of the button output (array passed) type?? - if($this->etcBtn) { - if(is_array($this->etcBtn)) { - foreach($this->etcBtn as $key=>$val) { - printf('%s', $key, $val['text'], $val['url'], "\n"); - } - } - } - // Select Language - if(!parent::isLangChange()){ - $url = getUrl('','lcm','1','sel_lang',Context::getLangType(),'return_uri',Context::get('current_url')); - printf('%s', 'Language : '.Context::getLang('select_lang'), $url, "\n"); - } - else { - printf('%s', Context::getLang('lang_return'), Context::get('return_uri'), "\n"); - } - if($this->homeUrl) { - $url = $this->homeUrl; - printf('%s', $url->text, $url->url, "\n"); - } - if($this->upperUrl) { - $url = $this->upperUrl; - printf('%s', $url->text, $url->url, "\n"); - } - } - // Footer information output - function printFooter() { - print("

\n
\n
"); - } - // And returns a list of serial numbers in - function getNo() { - if(Context::get('mobile_skt')==1) { - return "vnd.skmn".parent::getNo(); - } - else { - return parent::getNo(); - } - return $str; - } - } -?> + /** + * @brief Button to output + */ + function printBtn() + { + if($this->nextUrl) + { + $url = $this->nextUrl; + printf('%s', $url->text, $url->url, "\n"); + } + if($this->prevUrl) + { + $url = $this->prevUrl; + printf('%s', $url->text, $url->url, "\n"); + } + // Others are not applicable in charge of the button output (array passed) type?? + if($this->etcBtn) + { + if(is_array($this->etcBtn)) + { + foreach($this->etcBtn as $key=>$val) + { + printf('%s', $key, $val['text'], $val['url'], "\n"); + } + } + } + // Select Language + if(!parent::isLangChange()) + { + $url = getUrl('','lcm','1','sel_lang',Context::getLangType(),'return_uri',Context::get('current_url')); + printf('%s', 'Language : '.Context::getLang('select_lang'), $url, "\n"); + } + else + { + printf('%s', Context::getLang('lang_return'), Context::get('return_uri'), "\n"); + } + if($this->homeUrl) + { + $url = $this->homeUrl; + printf('%s', $url->text, $url->url, "\n"); + } + if($this->upperUrl) + { + $url = $this->upperUrl; + printf('%s', $url->text, $url->url, "\n"); + } + } + // Footer information output + function printFooter() + { + print("

\n\n"); + } + // And returns a list of serial numbers in + function getNo() + { + if(Context::get('mobile_skt')==1) + { + return "vnd.skmn".parent::getNo(); + } + else + { + return parent::getNo(); + } + return $str; + } +} +/* End of file wml.class.php */ +/* Location: ./addons/mobile/classes/wml.class.php */ diff --git a/addons/mobile/mobile.addon.php b/addons/mobile/mobile.addon.php index 15bde8a8a..5fc41ffc3 100644 --- a/addons/mobile/mobile.addon.php +++ b/addons/mobile/mobile.addon.php @@ -31,10 +31,12 @@ $oMobile->setCharSet($addon_info->charset); $oMobile->setModuleInfo($this->module_info); // Register the current module object $oMobile->setModuleInstance($this); -// Extract content and display/exit if navigate mode is or if WAP class exists -if($called_position == 'before_module_proc') { - if($oMobile->isLangChange()) { +// Extract content and display/exit if navigate mode is or if WAP class exists +if($called_position == 'before_module_proc') +{ + if($oMobile->isLangChange()) + { $oMobile->setLangType(); $oMobile->displayLangSelect(); } @@ -42,9 +44,13 @@ if($called_position == 'before_module_proc') { if($oMobile->isNavigationMode()) $oMobile->displayNavigationContent(); // If you have a WAP class content output via WAP class else $oMobile->displayModuleContent(); -// If neither navigation mode nor WAP class is, display the module's result -} else if($called_position == 'after_module_proc') { + // If neither navigation mode nor WAP class is, display the module's result +} +else if($called_position == 'after_module_proc') +{ // Display $oMobile->displayContent(); } -?> + +/* End of file mobile.addon.php */ +/* Location: ./addons/mobile/mobile.addon.php */ diff --git a/addons/openid_delegation_id/openid_delegation_id.addon.php b/addons/openid_delegation_id/openid_delegation_id.addon.php index db1e90c88..554c8c770 100644 --- a/addons/openid_delegation_id/openid_delegation_id.addon.php +++ b/addons/openid_delegation_id/openid_delegation_id.addon.php @@ -15,13 +15,15 @@ if($called_position != 'before_module_init') return; if(!$addon_info->server||!$addon_info->delegate||!$addon_info->xrds) return; $header_script = sprintf( - ''."\n". - ''."\n". - '', - $addon_info->server, - $addon_info->delegate, - $addon_info->xrds -); + ''."\n". + ''."\n". + '', + $addon_info->server, + $addon_info->delegate, + $addon_info->xrds + ); Context::addHtmlHeader($header_script); -?> + +/* End of file openid_delegation_id.addon.php */ +/* Location: ./addons/openid_delegation_id/openid_delegation_id.addon.php */ diff --git a/addons/point_level_icon/point_level_icon.addon.php b/addons/point_level_icon/point_level_icon.addon.php index 483e15331..846b5a646 100644 --- a/addons/point_level_icon/point_level_icon.addon.php +++ b/addons/point_level_icon/point_level_icon.addon.php @@ -16,4 +16,6 @@ require_once('./addons/point_level_icon/point_level_icon.lib.php'); $temp_output = preg_replace_callback('!<(div|span|a)([^\>]*)member_([0-9\-]+)([^\>]*)>(.*?)\<\/(div|span|a)\>!is', 'pointLevelIconTrans', $output); if($temp_output) $output = $temp_output; unset($temp_output); -?> + +/* End of file point_level_icon.addon.php */ +/* Location: ./addons/point_level_icon/point_level_icon.addon.php */ diff --git a/addons/point_level_icon/point_level_icon.lib.php b/addons/point_level_icon/point_level_icon.lib.php index 23daedd7c..e1289b387 100644 --- a/addons/point_level_icon/point_level_icon.lib.php +++ b/addons/point_level_icon/point_level_icon.lib.php @@ -1,8 +1,9 @@ getGroupImageMark($member_srl)) return $orig_text.$matches[5].''; - if(!isset($GLOBALS['_pointLevelIcon'][$member_srl])) { + if(!isset($GLOBALS['_pointLevelIcon'][$member_srl])) + { // Get point configuration - if(!$GLOBALS['_pointConfig']) { + if(!$GLOBALS['_pointConfig']) + { $oModuleModel = &getModel('module'); $GLOBALS['_pointConfig'] = $oModuleModel->getModuleConfig('point'); } @@ -31,7 +34,8 @@ function pointLevelIconTrans($matches) { // Get a path where level icon is $level_icon = sprintf('%smodules/point/icons/%s/%d.gif', Context::getRequestUri(), $config->level_icon, $level); // Get per to go to the next level if not a top level - if($level < $config->max_level) { + if($level < $config->max_level) + { $next_point = $config->level_step[$level+1]; $present_point = $config->level_step[$level]; if($next_point > 0) { @@ -49,4 +53,6 @@ function pointLevelIconTrans($matches) { return $orig_text.$text.$matches[5].''; } -?> + +/* End of file point_level_icon.lib.php */ +/* Location: ./addons/point_level_icon/point_level_icon.lib.php */ diff --git a/addons/resize_image/resize_image.addon.php b/addons/resize_image/resize_image.addon.php index 5b10d33ec..720b59687 100644 --- a/addons/resize_image/resize_image.addon.php +++ b/addons/resize_image/resize_image.addon.php @@ -5,14 +5,20 @@ if(!defined('__XE__')) exit(); * @file resize_image.addon.php * @author NHN (developers@xpressengine.com) * @brief Add-on to resize images in the body - **/ + */ -if($called_position == 'after_module_proc' && Context::getResponseMethod()=="HTML") { - if(Mobile::isFromMobilePhone()) { +if($called_position == 'after_module_proc' && Context::getResponseMethod()=="HTML") +{ + if(Mobile::isFromMobilePhone()) + { Context::loadFile('./addons/resize_image/css/resize_image.mobile.css', true); - } else { + } + else + { Context::loadJavascriptPlugin('ui'); Context::loadFile(array('./addons/resize_image/js/resize_image.min.js', 'body', '', null), true); } } -?> + +/* End of file resize_image.addon.php */ +/* Location: ./addons/resize_image/resize_image.addon.php */