本文整理汇总了PHP中Mobile::isFromMobilePhone方法的典型用法代码示例。如果您正苦于以下问题:PHP Mobile::isFromMobilePhone方法的具体用法?PHP Mobile::isFromMobilePhone怎么用?PHP Mobile::isFromMobilePhone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mobile
的用法示例。
在下文中一共展示了Mobile::isFromMobilePhone方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printContent
/**
* print either html or xml content given oModule object
* @remark addon execution and the trigger execution are included within this method, which might create inflexibility for the fine grained caching
* @param ModuleObject $oModule the module object
* @return void
*/
function printContent(&$oModule)
{
// Check if the gzip encoding supported
if (defined('__OB_GZHANDLER_ENABLE__') && __OB_GZHANDLER_ENABLE__ == 1 && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE && function_exists('ob_gzhandler') && extension_loaded('zlib') && $oModule->gzhandler_enable) {
$this->gz_enabled = TRUE;
}
// Extract contents to display by the request method
if (Context::get('xeVirtualRequestMethod') == 'xml') {
require_once _XE_PATH_ . "classes/display/VirtualXMLDisplayHandler.php";
$handler = new VirtualXMLDisplayHandler();
} else {
if (Context::getRequestMethod() == 'XMLRPC') {
require_once _XE_PATH_ . "classes/display/XMLDisplayHandler.php";
$handler = new XMLDisplayHandler();
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) {
$this->gz_enabled = FALSE;
}
} else {
if (Context::getRequestMethod() == 'JSON') {
require_once _XE_PATH_ . "classes/display/JSONDisplayHandler.php";
$handler = new JSONDisplayHandler();
} else {
if (Context::getRequestMethod() == 'JS_CALLBACK') {
require_once _XE_PATH_ . "classes/display/JSCallbackDisplayHandler.php";
$handler = new JSCallbackDisplayHandler();
} else {
require_once _XE_PATH_ . "classes/display/HTMLDisplayHandler.php";
$handler = new HTMLDisplayHandler();
}
}
}
}
$output = $handler->toDoc($oModule);
// call a trigger before display
ModuleHandler::triggerCall('display', 'before', $output);
// execute add-on
$called_position = 'before_display_content';
$oAddonController = getController('addon');
$addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? "mobile" : "pc");
if (file_exists($addon_file)) {
include $addon_file;
}
if (method_exists($handler, "prepareToPrint")) {
$handler->prepareToPrint($output);
}
// header output
if ($this->gz_enabled) {
header("Content-Encoding: gzip");
}
$httpStatusCode = $oModule->getHttpStatusCode();
if ($httpStatusCode && $httpStatusCode != 200) {
$this->_printHttpStatusCode($httpStatusCode);
} else {
if (Context::getResponseMethod() == 'JSON' || Context::getResponseMethod() == 'JS_CALLBACK') {
$this->_printJSONHeader();
} else {
if (Context::getResponseMethod() != 'HTML') {
$this->_printXMLHeader();
} else {
$this->_printHTMLHeader();
}
}
}
// debugOutput output
$this->content_size = strlen($output);
$output .= $this->_debugOutput();
// results directly output
if ($this->gz_enabled) {
print ob_gzhandler($output, 5);
} else {
print $output;
}
// call a trigger after display
ModuleHandler::triggerCall('display', 'after', $output);
}
示例2: startAuthentication
/**
* @brief 인증방법에 따른 인증 시작
*/
function startAuthentication(&$oModule)
{
$oAuthenticationModel =& getModel('authentication');
$oLayoutModel =& getModel('layout');
$config = $oAuthenticationModel->getModuleConfig();
$config->agreement = $oAuthenticationModel->_getAgreement();
Context::set('config', $config);
// KCB 본인인증일 경우
if ($config->authentication_type == 'kcb') {
$layout_info = $oLayoutModel->getLayout($config->layout_srl);
if ($layout_info) {
$oModule->setLayoutPath($layout_info->path);
$oModule->setLayoutFile("layout");
}
$result_code = $oAuthenticationModel->getKcbMobileData();
if ($result_code != '000') {
$error_message = $oAuthenticationModel->getKcbMobileError($result_code);
return new Object(-1, $error_message);
}
Context::set('next_act', $oModule->act);
$oModule->setTemplatePath(sprintf($this->module_path . 'skins/%s/', $config->skin));
$oModule->setTemplateFile('kcb_index');
return new Object();
}
// 기존의 휴대폰 인증일경우
$oModule->setTemplatePath(sprintf($this->module_path . 'skins/%s/', $config->skin));
if (Mobile::isFromMobilePhone()) {
$oModule->setTemplatePath(sprintf($this->module_path . 'm.skins/%s/', $config->mskin));
}
if ($config->authcode_time_limit) {
Context::set('time_limit', $config->authcode_time_limit);
}
// 전송지연 현황 보여주기
$status = $oAuthenticationModel->getDelayStatus();
if ($status != NULL) {
$status->sms_sk = $oAuthenticationModel->getDelayStatusString($status->sms_sk_average);
$status->sms_kt = $oAuthenticationModel->getDelayStatusString($status->sms_kt_average);
$status->sms_lg = $oAuthenticationModel->getDelayStatusString($status->sms_lg_average);
Context::set('status', $status);
}
Context::set('number_limit', $config->number_limit);
$oModule->setTemplatePath(sprintf($this->module_path . 'skins/%s/', $config->skin));
$oModule->setTemplateFile('index');
return new Object();
}
示例3: startAuthentication
function startAuthentication(&$oModule)
{
$oAuthenticationModel =& getModel('authentication');
$config = $oAuthenticationModel->getModuleConfig();
$config->agreement = $oAuthenticationModel->_getAgreement();
if (Mobile::isFromMobilePhone()) {
$oModule->setTemplatePath(sprintf($this->module_path . 'm.skins/%s/', $config->mskin));
} else {
$oModule->setTemplatePath(sprintf($this->module_path . 'skins/%s/', $config->skin));
}
if ($config->authcode_time_limit) {
Context::set('time_limit', $config->authcode_time_limit);
}
// 전송지연 현황 보여주기
$status = $oAuthenticationModel->getDelayStatus();
if ($status != NULL) {
$status->sms_sk = $oAuthenticationModel->getDelayStatusString($status->sms_sk_average);
$status->sms_kt = $oAuthenticationModel->getDelayStatusString($status->sms_kt_average);
$status->sms_lg = $oAuthenticationModel->getDelayStatusString($status->sms_lg_average);
Context::set('status', $status);
}
Context::set('number_limit', $config->number_limit);
Context::set('config', $config);
Context::set('target_action', $oModule->act);
$oLayoutModel =& getModel('layout');
$layout_info = $oLayoutModel->getLayout($config->layout_srl);
if ($layout_info) {
$oModule->setLayoutPath($layout_info->path);
$oModule->setLayoutFile("layout");
}
$oModule->setTemplateFile('index');
}
示例4: strpos
// still no act means error
if (!$this->act) {
$this->error = 'msg_module_is_not_exists';
return;
}
// get type, kind
$type = $xml_info->action->{$this->act}->type;
$kind = strpos(strtolower($this->act), 'admin') !== false ? 'admin' : '';
if (!$kind && $this->module == 'admin') {
$kind = 'admin';
}
if ($this->module_info->use_mobile != "Y") {
Mobile::setMobile(false);
}
// if(type == view, and case for using mobilephone)
if ($type == "view" && Mobile::isFromMobilePhone() && Context::isInstalled()) {
$orig_type = "view";
$type = "mobile";
}
//
// ad-hoc 끝!(ModuleHandler procModule())
//
// 텍스타일뷰일 때만 실행...
if (!($this->module == 'textyle' && ($type == 'view' || $type == 'mobile'))) {
return;
}
// 예약 발행해야할 문서를 구한다.
$now = date('YmdHis');
$oTextyleModel =& getModel('textyle');
$args->module_srl = $this->module_info->module_srl;
$args->less_publish_date = $now;
示例5: isLogged
/**
* @brief Check if logged-in
*/
function isLogged()
{
if ($_SESSION['is_logged']) {
if (Mobile::isFromMobilePhone()) {
return true;
} elseif (filter_var($_SESSION['ipaddress'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
// IPv6: require same /48
if (strncmp(inet_pton($_SESSION['ipaddress']), inet_pton($_SERVER['REMOTE_ADDR']), 6) == 0) {
return true;
}
} else {
// IPv4: require same /24
if (ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8) {
return true;
}
}
}
if (Context::getSessionStatus()) {
$_SESSION['is_logged'] = false;
}
return false;
}
示例6: elseif
} elseif ($__Context->listStyle == 'gallery') {
$__Context->mi->default_style = 'gallery';
} elseif ($__Context->listStyle == 'cloud_gall') {
$__Context->mi->default_style = 'cloud_gall';
} elseif ($__Context->listStyle == 'guest') {
$__Context->mi->default_style = 'guest';
} elseif ($__Context->listStyle == 'blog') {
$__Context->mi->default_style = 'blog';
} elseif ($__Context->listStyle == 'faq') {
$__Context->mi->default_style = 'faq';
} elseif ($__Context->listStyle == 'viewer') {
$__Context->mi->default_style = 'viewer';
} elseif (!in_array($__Context->mi->default_style, array('list', 'webzine', 'gallery', 'cloud_gall', 'guest', 'blog', 'faq', 'viewer'))) {
$__Context->mi->default_style = 'list';
}
if (class_exists(Mobile) && Mobile::isFromMobilePhone()) {
?>
<!--#Meta:common/js/jquery.min.js--><?php
$__tmp = array('common/js/jquery.min.js', '', '', '-100006');
Context::loadFile($__tmp);
unset($__tmp);
?>
<!--#Meta:common/js/xe.min.js--><?php
$__tmp = array('common/js/xe.min.js', '', '', '-100006');
Context::loadFile($__tmp);
unset($__tmp);
?>
<!--#Meta:common/js/x.min.js--><?php
$__tmp = array('common/js/x.min.js', '', '', '-100006');
Context::loadFile($__tmp);
unset($__tmp);
示例7: dispSocialxeLogin
function dispSocialxeLogin()
{
// 크롤러면 실행하지 않는다...
// 소셜XE 서버에 쓸데없는 요청이 들어올까봐...
if (isCrawler()) {
Context::close();
exit;
}
// 로그인에 사용되는 세션을 초기화한다.
// js 사용시 최초에만 초기화하기 위해 js2 파라미터를 검사
if (!Context::get('js2')) {
$this->session->clearSession('js');
$this->session->clearSession('mode');
$this->session->clearSession('callback_query');
$this->session->clearSession('widget_skin');
$this->session->clearSession('info');
}
$provider = Context::get('provider');
// 서비스
$use_js = Context::get('js');
// JS 사용 여부
$widget_skin = Context::get('skin');
// 위젯의 스킨명
// 아무 것도 없는 레이아웃 적용
$template_path = sprintf("%stpl/", $this->module_path);
$this->setLayoutPath($template_path);
$this->setLayoutFile("popup_layout");
if ($provider == 'xe') {
return $this->stop('msg_invalid_request');
}
// JS 사용 여부 확인
if (($use_js || Context::get('mode') == 'socialLogin') && !Context::get('js2')) {
// JS 사용 여부를 세션에 저장한다.
$this->session->setSession('js', $use_js);
$this->session->setSession('widget_skin', $widget_skin);
// 로그인 안내 페이지 표시후 진행할 URL
$url = getUrl('js', '', 'skin', '', 'js2', 1);
Context::set('url', $url);
// 로그인 안내 페이지 표시
// 모바일 모드가 아닐때도 모바일 페이지가 정상적으로 표시되도록.
if (class_exists('Mobile')) {
if (!Mobile::isFromMobilePhone()) {
Context::addHtmlHeader('<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=yes, target-densitydpi=medium-dpi" />');
}
}
// jQuery 압축 버전에 로드되는 1.5 이상에서는 min을 항상 로드(모바일 버전 때문)
if (defined('__XE__')) {
Context::addJsFile("./common/js/jquery.min.js", true, '', -100000);
} else {
Context::addJsFile("./common/js/jquery.js", true, '', -100000);
}
$this->setTemplatePath($template_path);
$this->setTemplateFile('login');
return;
}
$callback_query = Context::get('query');
// 인증 후 돌아갈 페이지 쿼리
$this->session->setSession('callback_query', $callback_query);
$mode = Context::get('mode');
// 작동 모드
$this->session->setSession('mode', $mode);
$mid = Context::get('mid');
// 소셜 로그인 처리 중인 mid
$this->session->setSession('mid', $mid);
$vid = Context::get('vid');
// 소셜 로그인 처리 중인 vid
$this->session->setSession('vid', $vid);
$info = Context::get('info');
// SocialXE info 위젯 여부
$this->session->setSession('info', $info);
// 로그인 시도 중인 서비스는 로그아웃 시킨다.
$this->providerManager->doLogout($provider);
$output = $this->communicator->getLoginUrl($provider);
if (!$output->toBool()) {
return $output;
}
$url = $output->get('url');
// 리다이렉트
header('Location: ' . $url);
Context::close();
exit;
}
示例8: triggerBeforeDisplay
function triggerBeforeDisplay(&$output)
{
if (Context::getResponseMethod() == 'HTML') {
$mid = Context::get('mid');
if ($mid) {
$oAjaxboardModel = getModel('ajaxboard');
$plugins_info = $oAjaxboardModel->getPluginsInfoByMid($mid, Mobile::isFromMobilePhone());
if (count($plugins_info)) {
$module_config = $oAjaxboardModel->getConfig();
if ($module_config->type == 1) {
Context::loadFile($this->module_path . 'tpl/js/libs/socket.io.js', 'head');
}
Context::loadFile($this->module_path . 'tpl/js/libs/eventsource.js', 'head');
Context::loadFile($this->module_path . 'tpl/js/client.js', 'head');
$oTemplate = TemplateHandler::getInstance();
Context::set('waiting_message', $module_config->waiting_message);
Context::set('module_config', $oAjaxboardModel->getTemplateConfig());
$compile = $oTemplate->compile($this->module_path . 'tpl', 'templateConfig');
$output .= $compile;
$logged_info = Context::get('logged_info');
$user_info = $oAjaxboardModel->getFilterUserInfo($logged_info->member_srl);
Context::set('user_info', $user_info);
foreach ($plugins_info as $plugin_info) {
Context::set('plugin_info', $plugin_info);
$plugin_name = $plugin_info->plugin_name;
$plugin_path = $this->module_path . 'plugins/' . $plugin_name;
$compile = $oTemplate->compile($plugin_path, 'plugin');
$output .= $compile;
}
}
}
}
return new Object();
}
示例9: triggerApplyLayout
/**
* action forward apply layout
**/
public function triggerApplyLayout(&$oModule) {
if(!$oModule || $oModule->getLayoutFile()=='popup_layout.html') return new Object();
if(Context::get('module')=='admin') return new Object();
if(in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) return new Object();
if($oModule->act == 'dispMemberLogout') return new Object();
$site_module_info = Context::get('site_module_info');
if(!$site_module_info || !$site_module_info->site_srl || $site_module_info->mid != $this->shop_mid) return new Object();
$oModuleModel = getModel('module');
$xml_info = $oModuleModel->getModuleActionXml('shop');
if($oModule->mid == $this->shop_mid && isset($xml_info->action->{$oModule->act})) return new Object();
$oShopView = getView('shop');
Context::set('layout',NULL);
// When shop pages are accessed from other modules (a page, for instance)
// Load the appropriate layout:
// - tool: backend
// - service: frontend
if(strpos($oModule->act, "ShopTool") !== FALSE || in_array($oModule->act, array('dispMenuAdminSiteMap'))) {
$oShopView->initTool($oModule, TRUE);
} else {
if(Mobile::isFromMobilePhone())
{
$oShopView = &getMobile('shop');
}
$oShopView->initService($oModule, TRUE);
}
return new Object();
}
示例10: insertComment
/**
* Enter comments
* @param object $obj
* @param bool $manual_inserted
* @return object
*/
function insertComment($obj, $manual_inserted = FALSE)
{
if (!$manual_inserted && !checkCSRF()) {
return new Object(-1, 'msg_invalid_request');
}
if (!is_object($obj)) {
$obj = new stdClass();
}
// check if comment's module is using comment validation and set the publish status to 0 (false)
// for inserting query, otherwise default is 1 (true - means comment is published)
$using_validation = $this->isModuleUsingPublishValidation($obj->module_srl);
if (Context::get('is_logged')) {
$logged_info = Context::get('logged_info');
if ($logged_info->is_admin == 'Y') {
$is_admin = TRUE;
} else {
$is_admin = FALSE;
}
}
if (!$using_validation) {
$obj->status = 1;
} else {
if ($is_admin) {
$obj->status = 1;
} else {
$obj->status = 0;
}
}
$obj->__isupdate = FALSE;
// call a trigger (before)
$output = ModuleHandler::triggerCall('comment.insertComment', 'before', $obj);
if (!$output->toBool()) {
return $output;
}
// check if a posting of the corresponding document_srl exists
$document_srl = $obj->document_srl;
if (!$document_srl) {
return new Object(-1, 'msg_invalid_document');
}
// get a object of document model
$oDocumentModel = getModel('document');
// even for manual_inserted if password exists, md5 it.
if ($obj->password) {
$obj->password = md5($obj->password);
}
// get the original posting
if (!$manual_inserted) {
$oDocument = $oDocumentModel->getDocument($document_srl);
if ($document_srl != $oDocument->document_srl) {
return new Object(-1, 'msg_invalid_document');
}
if ($oDocument->isLocked()) {
return new Object(-1, 'msg_invalid_request');
}
if ($obj->homepage) {
$obj->homepage = removeHackTag($obj->homepage);
if (!preg_match('/^[a-z]+:\\/\\//i', $obj->homepage)) {
$obj->homepage = 'http://' . $obj->homepage;
}
}
// input the member's information if logged-in
if (Context::get('is_logged')) {
$logged_info = Context::get('logged_info');
$obj->member_srl = $logged_info->member_srl;
// user_id, user_name and nick_name already encoded
$obj->user_id = htmlspecialchars_decode($logged_info->user_id);
$obj->user_name = htmlspecialchars_decode($logged_info->user_name);
$obj->nick_name = htmlspecialchars_decode($logged_info->nick_name);
$obj->email_address = $logged_info->email_address;
$obj->homepage = $logged_info->homepage;
}
}
// error display if neither of log-in info and user name exist.
if (!$logged_info->member_srl && !$obj->nick_name) {
return new Object(-1, 'msg_invalid_request');
}
if (!$obj->comment_srl) {
$obj->comment_srl = getNextSequence();
} elseif (!$is_admin && !$manual_inserted && !checkUserSequence($obj->comment_srl)) {
return new Object(-1, 'msg_not_permitted');
}
// determine the order
$obj->list_order = getNextSequence() * -1;
// remove XE's own tags from the contents
$obj->content = preg_replace('!<\\!--(Before|After)(Document|Comment)\\(([0-9]+),([0-9]+)\\)-->!is', '', $obj->content);
if (Mobile::isFromMobilePhone()) {
if ($obj->use_html != 'Y') {
$obj->content = htmlspecialchars($obj->content, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
}
$obj->content = nl2br($obj->content);
}
if (!$obj->regdate) {
$obj->regdate = date("YmdHis");
}
//.........这里部分代码省略.........
示例11: proc
/**
* excute the member method specified by $act variable
* @return boolean true : success false : fail
**/
function proc()
{
// pass if stop_proc is true
if ($this->stop_proc) {
return false;
}
// trigger call
$triggerOutput = ModuleHandler::triggerCall('moduleObject.proc', 'before', $this);
if (!$triggerOutput->toBool()) {
$this->setError($triggerOutput->getError());
$this->setMessage($triggerOutput->getMessage());
return false;
}
// execute an addon(call called_position as before_module_proc)
$called_position = 'before_module_proc';
$oAddonController =& getController('addon');
$addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? "mobile" : "pc");
@(include $addon_file);
if (isset($this->xml_info->action->{$this->act}) && method_exists($this, $this->act)) {
// Check permissions
if ($this->module_srl && !$this->grant->access) {
$this->stop("msg_not_permitted_act");
return FALSE;
}
// integrate skin information of the module(change to sync skin info with the target module only by seperating its table)
$oModuleModel =& getModel('module');
$oModuleModel->syncSkinInfoToModuleInfo($this->module_info);
Context::set('module_info', $this->module_info);
// Run
$output = $this->{$this->act}();
} else {
return false;
}
// trigger call
$triggerOutput = ModuleHandler::triggerCall('moduleObject.proc', 'after', $this);
if (!$triggerOutput->toBool()) {
$this->setError($triggerOutput->getError());
$this->setMessage($triggerOutput->getMessage());
return false;
}
// execute an addon(call called_position as after_module_proc)
$called_position = 'after_module_proc';
$oAddonController =& getController('addon');
$addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? "mobile" : "pc");
@(include $addon_file);
if (is_a($output, 'Object') || is_subclass_of($output, 'Object')) {
$this->setError($output->getError());
$this->setMessage($output->getMessage());
if (!$output->toBool()) {
return false;
}
}
// execute api methos of the module if view action is and result is XMLRPC or JSON
if ($this->module_info->module_type == 'view') {
if (Context::getResponseMethod() == 'XMLRPC' || Context::getResponseMethod() == 'JSON') {
$oAPI = getAPI($this->module_info->module, 'api');
if (method_exists($oAPI, $this->act)) {
$oAPI->{$this->act}($this);
}
}
}
return true;
}
示例12: getAjaxboardWholeVariables
function getAjaxboardWholeVariables()
{
$mid = Context::get('mid');
$document_srl = Context::get('document_srl');
$logged_info = Context::get('logged_info');
$module_config = $this->getConfig();
$module_info = $this->getLinkedModuleInfoByMid($mid);
if (!$module_info) {
return new Object(-1, 'msg_invalid_request');
}
$oModuleModel = getModel('module');
$origin_module_info = $oModuleModel->getModuleInfoByMid($mid);
$lang = new stdClass();
$lang->msg_delete_comment = Context::getLang('msg_delete_comment');
$lang->msg_password_required = Context::getLang('msg_password_required');
$result = new stdClass();
$result->lang = $lang;
$result->module_path = $this->module_path;
$result->module_srl = $module_info->module_srl;
$result->member_srl = $logged_info->member_srl;
$result->document_srl = $document_srl;
$result->notify_list = array_fill_keys(explode('|@|', $module_info->notify_list), true);
$result->use_wfsr = $module_info->use_wfsr;
$result->timeout = $module_config->timeout;
$result->token = $module_config->token;
$result->server_url = $module_config->server_url;
if (Mobile::isFromMobilePhone() && $origin_module_info->use_mobile == 'Y') {
if ($module_info->use_module_mobile == 'Y') {
$result->skin_info = $this->arrangeSkinVars($this->getMobileSkinVars($module_info->module_srl));
}
} else {
if ($module_info->use_module_pc == 'Y') {
$result->skin_info = $this->arrangeSkinVars($this->getSkinVars($module_info->module_srl));
}
}
$this->adds($result);
}
示例13: procSocialxeInsertComment
function procSocialxeInsertComment()
{
$oCommentController =& getController('comment');
// 로그인 상태인지 확인
if (count($this->providerManager->getLoggedProviderList()) == 0) {
return $this->stop('msg_not_logged');
}
$args->document_srl = Context::get('document_srl');
// 해당 문서의 댓글이 닫혀있는지 확인
$oDocumentModel =& getModel('document');
$oDocument = $oDocumentModel->getDocument($args->document_srl);
if (!$oDocument->allowComment()) {
return new Object(-1, 'msg_invalid_request');
}
// 데이터를 준비
$args->parent_srl = Context::get('comment_srl');
$args->content = trim(Context::get('content'));
$args->nick_name = $this->providerManager->getMasterProviderNickName();
$args->content_link = Context::get('content_link');
$args->content_title = Context::get('content_title');
// 1.5이상이 아니거나 모바일 클래스가 없다면, 줄 바꿈과 특수 문자 변환 실행. - XE Core에서 모바일이면 처리를 해버린다. 1.5 이하에서도 이런 현상이 있는지 몰라서 1.5 이하는 예전처럼 처리
if (!Mobile::isFromMobilePhone() || !defined('__XE__')) {
$args->content = nl2br(htmlspecialchars($args->content));
}
// 해당 문서가 비밀글인지 확인
if ($oDocument->isSecret()) {
$args->is_secret = 'Y';
}
// 댓글의 moduel_srl
$oModuleModel =& getModel('module');
$module_info = $oModuleModel->getModuleInfoByDocumentSrl($args->document_srl);
$args->module_srl = $module_info->module_srl;
// 댓글 삽입
// XE가 대표 계정이면 XE 회원 정보를 이용하여 댓글을 등록
if ($this->providerManager->getMasterProvider() == 'xe') {
$manual_inserted = false;
// 부계정이 없으면 알림 설정
if (!$this->providerManager->getSlaveProvider()) {
$args->notify_message = 'Y';
}
} else {
$manual_inserted = true;
$args->email_address = '';
$args->homepage = '';
}
$result = $oCommentController->insertComment($args, $manual_inserted);
if (!$result->toBool()) {
return $result;
}
// 삽입된 댓글의 번호
$comment_srl = $result->get('comment_srl');
// 텍스타일이면 지지자 처리
if ($module_info->module == 'textyle') {
$oCommentModel =& getModel('comment');
$oComment = $oCommentModel->getComment($comment_srl);
$obj->module_srl = $module_info->module_srl;
$obj->nick_name = $oComment->get('nick_name');
$obj->member_srl = $oComment->get('member_srl');
$obj->homepage = $oComment->get('homepage');
$obj->comment_count = 1;
$oTextyleController =& getController('textyle');
$oTextyleController->updateTextyleSupporter($obj);
}
// 태그 제거 htmlspecialchars 복원
$args->content = $this->htmlEntityDecode(strip_tags($args->content));
// 소셜 서비스로 댓글 전송
$output = $this->sendSocialComment($args, $comment_srl, $msg);
if (!$output->toBool()) {
$oCommentController->deleteComment($comment_srl);
return $output;
}
// 위젯에서 화면 갱신에 사용할 정보 세팅
$this->add('skin', Context::get('skin'));
$this->add('document_srl', Context::get('document_srl'));
$this->add('comment_srl', Context::get('comment_srl'));
$this->add('list_count', Context::get('list_count'));
$this->add('content_link', Context::get('content_link'));
$this->add('msg', $msg);
}
示例14: triggerApplyLayout
/**
* @brief action forward apply layout
**/
function triggerApplyLayout(&$oModule)
{
if (!$oModule || $oModule->getLayoutFile() == 'popup_layout.html') {
return new Object();
}
if (Context::get('module') == 'admin') {
return new Object();
}
if (in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) {
return new Object();
}
if ($oModule->act == 'dispMemberLogout') {
return new Object();
}
$site_module_info = Context::get('site_module_info');
if (!$site_module_info || !$site_module_info->site_srl || $site_module_info->mid != $this->textyle_mid) {
return new Object();
}
$oModuleModel =& getModel('module');
$xml_info = $oModuleModel->getModuleActionXml('textyle');
if ($oModule->mid == $this->textyle_mid && isset($xml_info->action->{$oModule->act})) {
return new Object();
}
$oTextyleModel =& getModel('textyle');
$oTextyleView =& getView('textyle');
Context::set('layout', null);
if ($oTextyleModel->isAttachedMenu($oModule->act)) {
$oTextyleView->initTool($oModule, true);
} else {
if (Mobile::isFromMobilePhone()) {
$oTextyleView =& getMobile('textyle');
}
$oTextyleView->initService($oModule, true);
}
return new Object();
}
示例15: isLogged
/**
* @brief Check if logged-in
*/
function isLogged()
{
if ($_SESSION['is_logged']) {
if (Mobile::isFromMobilePhone()) {
return true;
} else {
if (ip2long($_SESSION['ipaddress']) >> 8 == ip2long($_SERVER['REMOTE_ADDR']) >> 8) {
return true;
}
}
}
$_SESSION['is_logged'] = false;
return false;
}