#18994184 : remove smartphone addon
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7589 201d5d3c-b55e-5fd7-737f-ddc643e51545
|
|
@ -1,139 +0,0 @@
|
|||
<?php
|
||||
class smartphoneXE {
|
||||
var $module_info = null;
|
||||
var $oModule = null;
|
||||
var $output = null;
|
||||
|
||||
var $parent_url = null;
|
||||
var $prev_url = null;
|
||||
var $next_url = null;
|
||||
|
||||
var $content = null;
|
||||
|
||||
function isFromSmartPhone() {
|
||||
if(Context::get('full_browse') || $_COOKIE["FullBrowse"])
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return Context::get('smartphone') || preg_match('/(iPod|iPhone|Android|SCH\-M[0-9]+)/',$_SERVER['HTTP_USER_AGENT']);
|
||||
}
|
||||
|
||||
function haveSmartphoneModule($module) {
|
||||
return $oModule =& getModule($module, 'smartphone') && method_exists($oModule,'procSmartPhone');
|
||||
}
|
||||
|
||||
function smartphoneXE($oModule, $module_info, $output) {
|
||||
|
||||
$this->oModule = $oModule;
|
||||
$this->module_info = $module_info;
|
||||
|
||||
if(!$this->module_info->menu_srl) {
|
||||
$oMenuModel = &getAdminModel('menu');
|
||||
$menus = $oMenuModel->getMenus($this->module_info->site_srl);
|
||||
if($menus[0]) $this->module_info->menu_srl = $menus[0]->menu_srl;
|
||||
}
|
||||
|
||||
if($this->module_info->menu_srl) {
|
||||
$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;
|
||||
Context::addHtmlHeader(sprintf('<script type="text/javascript"> var xeMenus = { %s } </script>', $this->_getAllItems($menu->list)));
|
||||
$this->_setParentUrl($menu->list);
|
||||
}
|
||||
}
|
||||
|
||||
function _setParentUrl($menu_list) {
|
||||
if(!count($menu_list)) return;
|
||||
foreach($menu_list as $key => $val) {
|
||||
if(!$val['text']) continue;
|
||||
if($val['list'] && $this->_setParentUrl($val['list'])) {
|
||||
$href = $val['href'];
|
||||
if(preg_match('/^[a-z0-9_]+$/i',$val['url'])) $href = getUrl('','mid',$val['url'],'smartphone','true');
|
||||
else $href = $val['href'];
|
||||
$this->setParentUrl($href);
|
||||
return false;
|
||||
}
|
||||
if($val['url']==Context::get('mid')) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function _getAllItems($menu_list, $depth=0) {
|
||||
if(!count($menu_list)) return;
|
||||
$output = '';
|
||||
|
||||
foreach($menu_list as $menu_item)
|
||||
{
|
||||
if($output) $output .= ",";
|
||||
$key = $menu_item['text'];
|
||||
$val = $menu_item['url'];
|
||||
if($menu_item['list']) {
|
||||
$childs = '{'.$this->_getAllItems($menu_item['list'], $depth+1).'}';
|
||||
} else {
|
||||
$childs = 'null';
|
||||
}
|
||||
|
||||
$output .= sprintf('"%s" : { "url" : "%s", "childs" : %s } ',str_replace('"','\"',$key), str_replace('"','\"',$val), $childs);
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
function procSmartPhone($msg = null) {
|
||||
if(preg_match('/(iPod|iPhone|Android)/',$_SERVER['HTTP_USER_AGENT'])) {
|
||||
Context::addHtmlHeader('<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>');
|
||||
} else if(preg_match('/SCH\-M[0-9]+/',$_SERVER['HTTP_USER_AGENT'])) {
|
||||
Context::addHtmlHeader('<meta name="viewport" content="width=240; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>');
|
||||
}
|
||||
|
||||
if(is_a($this->output, 'Object') || is_subclass_of($this->output, 'Object') || $msg) {
|
||||
if($msg) $this->setContent(Context::getLang($msg));
|
||||
else $this->setContent($this->output->getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
if($this->haveSmartphoneModule($this->module_info->module)) {
|
||||
$oSmartPhoneModule =& getModule($this->module_info->module, 'smartphone');
|
||||
$vars = get_object_vars($this->oModule);
|
||||
if(count($vars)) foreach($vars as $key => $val) $oSmartPhoneModule->{$key} = $val;
|
||||
$oSmartPhoneModule->procSmartPhone($this);
|
||||
} else {
|
||||
switch(Context::getLangType()) {
|
||||
case 'ko' :
|
||||
$msg = '스마트폰을 지원하지 않는 모듈입니다';
|
||||
break;
|
||||
case 'jp' :
|
||||
$msg = 'このモジュールをサポートしていません。';
|
||||
break;
|
||||
case 'zh-TW' :
|
||||
$msg = '該模塊不支持。';
|
||||
break;
|
||||
case 'zh-CN' :
|
||||
$msg = '该模块不支持。';
|
||||
break;
|
||||
default :
|
||||
$msg = 'This module is not supported.';
|
||||
break;
|
||||
}
|
||||
$this->setContent($msg);
|
||||
}
|
||||
}
|
||||
|
||||
function setContent($content) {
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
function setParentUrl($url) {
|
||||
$this->parent_url = $url;
|
||||
}
|
||||
|
||||
function setPrevUrl($url) {
|
||||
$this->prev_url = $url;
|
||||
}
|
||||
|
||||
function setNextUrl($url) {
|
||||
$this->next_url = $url;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<addon version="0.2">
|
||||
<title xml:lang="ko">SmartPhone XE 애드온</title>
|
||||
<title xml:lang="en">SmartPhone XE</title>
|
||||
<title xml:lang="zh-CN">智能手机XE插件</title>
|
||||
<title xml:lang="vi">SmartPhone XE</title>
|
||||
<title xml:lang="ru">SmartPhone XE</title>
|
||||
<title xml:lang="zh-TW">智慧型手機</title>
|
||||
<title xml:lang="jp">SmartPhone XE アドオン</title>
|
||||
<description xml:lang="ko">
|
||||
IPhone (touch) 등, smartphone 에서 접속시 최적화된 화면을 보여줍니다.
|
||||
</description>
|
||||
<description xml:lang="en">
|
||||
This addon displays the best screen for users who use smartphones like IPhone (touch).
|
||||
</description>
|
||||
<description xml:lang="zh-CN">
|
||||
用于IPhone(touch)等智能手机访问时的界面优化。
|
||||
</description>
|
||||
<description xml:lang="vi">
|
||||
Addon này sẽ hiển thị Website trên màn hình iPhone một cách tốt nhất khi người dùng sử dụng SmartPhone để truy cập (iPhone cảm ứng)
|
||||
</description>
|
||||
<description xml:lang="zh-TW">
|
||||
用iPhone(touch)和智慧型手機瀏覽時會以最適當的畫面顯示。
|
||||
</description>
|
||||
<description xml:lang="ru">
|
||||
This addon displays the best screen for users who use smartphones like IPhone (touch).
|
||||
</description>
|
||||
<description xml:lang="jp">
|
||||
IPhone(touch)など、スマートフォンからアクセスした時、最適化されたインターフェースで表示させます。
|
||||
</description>
|
||||
<version>0.1</version>
|
||||
<date>2009-04-20</date>
|
||||
<author email_address="haneul0318@gmail.com" link="http://seungyeop.kr">
|
||||
<name xml:lang="ko">haneul</name>
|
||||
<name xml:lang="en">haneul</name>
|
||||
<name xml:lang="zh-CN">haneul</name>
|
||||
<name xml:lang="vi">haneul</name>
|
||||
<name xml:lang="zh-TW">haneul</name>
|
||||
<name xml:lang="ru">haneul</name>
|
||||
<name xml:lang="jp">haneul</name>
|
||||
</author>
|
||||
</addon>
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<?PHP
|
||||
if(!defined("__ZBXE__")) exit();
|
||||
|
||||
if(Context::get('module')=='admin') return;
|
||||
require_once(_XE_PATH_.'addons/smartphone/classes/smartphone.class.php');
|
||||
|
||||
if($called_position == "before_module_init")
|
||||
{
|
||||
if(Context::get('full_browse'))
|
||||
{
|
||||
setcookie("FullBrowse", 1);
|
||||
}
|
||||
}
|
||||
|
||||
if(!smartphoneXE::isFromSmartPhone()) return;
|
||||
|
||||
if($called_position == 'after_module_proc' ) {
|
||||
$oSmartphoneXE = new smartphoneXE($this, $this->module_info, $output);
|
||||
$oSmartphoneXE->procSmartPhone();
|
||||
Context::set('layout', 'none');
|
||||
Context::set('smart_content', $oSmartphoneXE->content);
|
||||
Context::set('parent_url', $oSmartphoneXE->parent_url);
|
||||
Context::set('prev_url', $oSmartphoneXE->prev_url);
|
||||
Context::set('next_url', $oSmartphoneXE->next_url);
|
||||
$this->setTemplatePath('addons/smartphone/tpl');
|
||||
$this->setTemplateFile('layout');
|
||||
|
||||
} elseif($called_position == 'before_module_proc' && !$this->grant->access) {
|
||||
$oSmartphoneXE = new smartphoneXE($this, $this->module_info, $output);
|
||||
$oSmartphoneXE->procSmartPhone('msg_not_permitted_act');
|
||||
Context::set('layout', 'none');
|
||||
Context::set('smart_content', $oSmartphoneXE->content);
|
||||
Context::set('parent_url', $oSmartphoneXE->parent_url);
|
||||
Context::set('prev_url', $oSmartphoneXE->prev_url);
|
||||
Context::set('next_url', $oSmartphoneXE->next_url);
|
||||
$this->setTemplatePath('addons/smartphone/tpl');
|
||||
$this->setTemplateFile('layout');
|
||||
}
|
||||
?>
|
||||
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 259 B |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 117 B |
|
Before Width: | Height: | Size: 332 B |
|
|
@ -1,26 +0,0 @@
|
|||
<!--%import("./smartphone.css")-->
|
||||
<!--%import("./smartphone.js")-->
|
||||
|
||||
<div class="smartPhoneTitleBar">
|
||||
<h1><a href="#" onclick="showXEMenu(); return false;">{Context::getBrowserTitle()}</a></h1>
|
||||
</div>
|
||||
|
||||
<div class="smartPhoneContentArea">
|
||||
{$smart_content}
|
||||
</div>
|
||||
|
||||
<div class="smartPhoneToolBar">
|
||||
<div class="buttons">
|
||||
<!--@if($parent_url)-->
|
||||
<a href="{$parent_url}"><img src="./images/btnTop.png" class="smartPhoneBtn" alt="Top" /></a>
|
||||
<!--@end-->
|
||||
|
||||
<!--@if($prev_url)--><a href="{$prev_url}"><img src="./images/btnPrev.png" class="smartPhoneBtn" alt="Prev" /></a><!--@end-->
|
||||
<!--@if($next_url)--><a href="{$next_url}"><img src="./images/btnNext.png" class="smartPhoneBtn" alt="Next" /></a><!--@end-->
|
||||
|
||||
<a href="#" onclick="showXEMenu();"><img src="./images/btnMenu.png" class="smartPhoneBtn" alt="Menu" /></a>
|
||||
</div>
|
||||
<div class="rightbuttons">
|
||||
<a href="#" onclick="setFullBrowse();" class="button blue"><span>PC Version</span></a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,200 +0,0 @@
|
|||
body {
|
||||
margin: 0;
|
||||
padding:0;
|
||||
font-family: Helvetica;
|
||||
background: #E6E6E6 url(./images/pinstripes.png);
|
||||
color: #000000;
|
||||
overflow-x: hidden;
|
||||
-webkit-user-select: none;
|
||||
-webkit-text-size-adjust: none;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.smartPhoneTitleBar {
|
||||
border-bottom: 1px solid #2d3642;
|
||||
border-top: 1px solid #6d84a2;
|
||||
height: 43px;
|
||||
overflow:hidden;
|
||||
background:#485567 url(./images/titlebar.png) repeat-x left top;
|
||||
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
}
|
||||
|
||||
.smartPhoneToolBar .buttons
|
||||
{
|
||||
float: left;
|
||||
}
|
||||
|
||||
.smartPhoneToolBar .rightbuttons
|
||||
{
|
||||
float: right; margin-right:5px; margin-top:5px;
|
||||
}
|
||||
|
||||
.smartPhoneTitleBar h1 {
|
||||
white-space:nowrap;
|
||||
overflow: hidden;
|
||||
color: #FFFFFF;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
padding:8px 10px;
|
||||
margin:0;
|
||||
text-shadow: rgba(0, 0, 0, 0.4) 0px -1px 0;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.smartPhoneTitleBar h1 a {
|
||||
text-decoration:none;
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
.smartPhoneContent {
|
||||
z-index:450;
|
||||
border: 1px solid #999999;
|
||||
padding:10px;
|
||||
background-color:#fff;
|
||||
margin:10px;
|
||||
box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
-webkit-border-radius: 8px;
|
||||
}
|
||||
|
||||
.smartPhoneToolBar {
|
||||
z-index:9999;
|
||||
width:100%;
|
||||
border-bottom: 1px solid #2d3642;
|
||||
border-top: 1px solid #6d84a2;
|
||||
height: 43px;
|
||||
overflow:hidden;
|
||||
background:#485567 url(./images/titlebar.png) repeat-x left top;
|
||||
white-space:nowrap;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
}
|
||||
|
||||
.smartPhoneBtn {
|
||||
width:43px;
|
||||
height:43px;
|
||||
margin-left:8px;
|
||||
border:0;
|
||||
}
|
||||
|
||||
.smartPhoneContent div.info {
|
||||
font-size:13px;
|
||||
padding-bottom:10px;
|
||||
border-bottom:1px solid #444;
|
||||
overflow:hidden;
|
||||
*zoom:1;
|
||||
}
|
||||
|
||||
.smartPhoneContent div.info .author {
|
||||
font-weight:bold;
|
||||
float:left;
|
||||
}
|
||||
|
||||
.smartPhoneContent div.info .date {
|
||||
font-size:11px;
|
||||
float:right;
|
||||
}
|
||||
|
||||
.smartPhoneContent div.link {
|
||||
margin-top:10px;
|
||||
border-top:1px solid #444;
|
||||
}
|
||||
|
||||
.smartPhoneContent div.link a {
|
||||
display:block;
|
||||
padding:10px 0;
|
||||
font-size:15px;
|
||||
text-decoration:underline;
|
||||
font-weight:bold;
|
||||
color:#000;
|
||||
}
|
||||
|
||||
.smartPhoneList {
|
||||
background-color:#fff;
|
||||
z-index:500;
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
|
||||
.smartPhoneList ul {
|
||||
padding:0;
|
||||
margin:0;
|
||||
left:0;
|
||||
right:0;
|
||||
top:43px;
|
||||
}
|
||||
|
||||
.smartPhoneList li {
|
||||
list-style:none;
|
||||
font-size:18px;
|
||||
font-weight:bold;
|
||||
padding:10px 20px 10px 10px;
|
||||
border-bottom:1px solid #ccc;
|
||||
}
|
||||
|
||||
.smartPhoneList li a {
|
||||
text-shadow: rgba(0, 0, 0, 0.4) 0px -1px 0;
|
||||
text-overflow: ellipsis;
|
||||
color:#000;
|
||||
text-decoration:none;
|
||||
display:block;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.smartPhoneList li.title {
|
||||
position: relative;
|
||||
top: -1px;
|
||||
margin-bottom: -2px;
|
||||
border-top: 1px solid #7d7d7d;
|
||||
border-bottom: 1px solid #999999;
|
||||
padding: 5px 10px;
|
||||
background: url(./images/listGroup.png) repeat-x;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
text-shadow: rgba(0, 0, 0, 0.4) 0 1px 0;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.smartPhoneList li.selected {
|
||||
background-color:#ddd;
|
||||
}
|
||||
|
||||
.smartPhoneList li.selected * {
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
|
||||
.smartPhoneList li a {
|
||||
background:transparent url(./images/listArrow.png) no-repeat scroll right center;
|
||||
padding-right:30px;
|
||||
}
|
||||
|
||||
.smartPhoneList li.noArrow a {
|
||||
background:none !important;
|
||||
}
|
||||
|
||||
.smartPhoneList li.item img.thumbnail {
|
||||
margin:0 10px 0 0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.smartPhoneList li.item span.title, .smartPhoneList li.item span.title div {
|
||||
font-size:15px;
|
||||
font-weight:normal;
|
||||
display:block;
|
||||
}
|
||||
|
||||
.smartPhoneList li.item span.info {
|
||||
font-size:10px;
|
||||
font-weight:normal;
|
||||
color:#bbb;
|
||||
display:block;
|
||||
margin-top:2px;
|
||||
letter-spacing:0px;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
var xeSmartMenu = null;
|
||||
var xeSmartUpperMenu = null;
|
||||
function setFullBrowse() {
|
||||
location.href = current_url.setQuery('full_browse',1);
|
||||
}
|
||||
|
||||
function showXEMenu() {
|
||||
if(!xeSmartMenu) {
|
||||
|
||||
xeSmartMenu = jQuery('<div>')
|
||||
.attr("className","smartPhoneList")
|
||||
.css('display','none')
|
||||
.css('backgroundColor','#fff');
|
||||
|
||||
jQuery(document.body).append(xeSmartMenu);
|
||||
|
||||
xeSmartMenu.slideIn = function(step) {
|
||||
var w = this.width() + Math.pow(step,2)*30;
|
||||
|
||||
if(w>jQuery(document).width()) {
|
||||
this.css({left:0,right:0,display:'block'});
|
||||
this.width('');
|
||||
jQuery('.smartPhoneContentArea').css("display","none");
|
||||
} else {
|
||||
this.width(w);
|
||||
var o = parseInt(jQuery(document).width/w,10)/5;
|
||||
if(o>1) o = 1;
|
||||
setTimeout(function() { xeSmartMenu.slideIn(step+1); }, 50);
|
||||
}
|
||||
}
|
||||
|
||||
xeSmartMenu.slideOut = function(step) {
|
||||
var l = parseInt(this.css('left'),10) + Math.pow(step,2)*30;
|
||||
|
||||
if(l>jQuery('.smartPhoneContent').width()) {
|
||||
this.css({display:'none','left':''});
|
||||
jQuery('.smartPhoneContentArea').css("display","block");
|
||||
} else {
|
||||
var o = parseInt(jQuery(document).width/l,10)/5;
|
||||
if(o<0) o = 0;
|
||||
this.css('left',l+'px');
|
||||
setTimeout(function() { xeSmartMenu.slideOut(step+1); }, 50);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(xeSmartMenu.css('display')=='none' && typeof(xeMenus)!='undefined') {
|
||||
xeSmartUpperMenu = null;
|
||||
var menu = findSmartNode(xeMenus);
|
||||
if(!menu) menu = xeMenus;
|
||||
var html = '<ul>';
|
||||
if(location.href.getQuery('mid')) html += '<li><a href="'+current_url.setQuery('mid','')+'">< go Home ></a></li>';
|
||||
if(xeSmartUpperMenu) html += '<li><a href="'+current_url.setQuery('mid',xeSmartUpperMenu.url)+'">< go Upper ></a></li>';
|
||||
for(var text in menu) {
|
||||
if(!text) continue;
|
||||
var url = menu[text].url;
|
||||
var href = '';
|
||||
if(/^[a-z0-9_]+$/i.test(url)) {
|
||||
href = request_uri.setQuery('mid',url);
|
||||
if(href.indexOf('?')>-1) href += '&smartphone=true';
|
||||
else href += '?smartphone=true';
|
||||
}
|
||||
else href = url;
|
||||
if(typeof(xeVid)!='undefined') {
|
||||
if(href.indexOf('?')>-1) href += '&vid='+xeVid;
|
||||
else href += '?vid='+xeVid;
|
||||
}
|
||||
html += '<li><a href="'+href+'">'+text+'</a></li>';
|
||||
}
|
||||
html += '</ul>';
|
||||
|
||||
jQuery(xeSmartMenu).html(html);
|
||||
jQuery(xeSmartMenu).css({
|
||||
width:'1px',
|
||||
right:'0',
|
||||
top:'43px',
|
||||
display:'block',
|
||||
position:'absolute',
|
||||
padding:0
|
||||
});
|
||||
xeSmartMenu.slideIn(0);
|
||||
} else if(location.href.getQuery('mid')||location.href.getQuery('document_srl')) {
|
||||
xeSmartMenu.slideOut(0);
|
||||
}
|
||||
}
|
||||
|
||||
function findSmartNode(nodes) {
|
||||
var mid = current_url.getQuery('mid');
|
||||
if(typeof(mid)=='undefined'||!mid) return nodes;
|
||||
for(var text in nodes) {
|
||||
if(!text) continue;
|
||||
if(nodes[text].childs) {
|
||||
var n = findSmartNode(nodes[text].childs);
|
||||
if(n) {
|
||||
xeSmartUpperMenu = nodes[text];
|
||||
return n;
|
||||
}
|
||||
}
|
||||
if(nodes[text].url == mid) {
|
||||
if(nodes[text].childs) return nodes[text].childs;
|
||||
return nodes;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||