mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-21 04:09:55 +09:00
이름 변경
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6168 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
946c14cc4f
commit
9913ffca17
4 changed files with 36 additions and 32 deletions
|
|
@ -1,106 +0,0 @@
|
|||
<?php
|
||||
class iphoneXE {
|
||||
var $module_info = null;
|
||||
var $content = null;
|
||||
var $oModule = null;
|
||||
var $menuList = null;
|
||||
|
||||
function isFromIPhone()
|
||||
{
|
||||
$userAgent = $_SERVER['HTTP_USER_AGENT'];
|
||||
$iphoneForce = Context::get('iphone');
|
||||
return $iphoneForce || $userAgent && (strpos($userAgent, 'iPod') || strpos($userAgent, 'iPhone') || strpos($userAgent, 'PPC')) ;
|
||||
}
|
||||
|
||||
function &getInstance()
|
||||
{
|
||||
static $instance = null;
|
||||
if($instnace == null)
|
||||
{
|
||||
$instance = new iphoneXE();
|
||||
return $instance;
|
||||
}
|
||||
}
|
||||
|
||||
function setModuleInstance(&$oModule) {
|
||||
if($this->oModule) return;
|
||||
$this->oModule = $oModule;
|
||||
}
|
||||
|
||||
function setContent($content) {
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
function setModuleInfo(&$module_info)
|
||||
{
|
||||
if($this->module_info) return;
|
||||
$this->module_info = $module_info;
|
||||
}
|
||||
|
||||
function procIPhone()
|
||||
{
|
||||
if(!$this->module_info) return;
|
||||
$oModule =& getModule($this->module_info->module, 'iphone');
|
||||
if(!$oModule || !method_exists($oModule, 'procIPhone') ) return;
|
||||
$vars = get_object_vars($this->oModule);
|
||||
if(count($vars)) foreach($vars as $key => $val) $oModule->{$key} = $val;
|
||||
return $oModule->procIPhone($this);
|
||||
}
|
||||
|
||||
function getAllItems(&$menu_list, $node_srl = 0, $node_text= "Main Menu")
|
||||
{
|
||||
if($node_srl == 0) $this->menuList = array();
|
||||
|
||||
$obj = null;
|
||||
$obj->text = $node_text;
|
||||
$obj->list = array();
|
||||
foreach($menu_list as $menu_node_srl => $menu_item)
|
||||
{
|
||||
$it = null;
|
||||
if(!preg_match('/^([a-zA-Z0-9\_\-]+)$/', $menu_item['url'])) { continue; }
|
||||
if($menu_item["list"] && count($menu_item["list"]) > 0)
|
||||
{
|
||||
$this->getAllItems($menu_item["list"], $menu_node_srl, $menu_item["text"]);
|
||||
}
|
||||
$it->text = $menu_item["text"];
|
||||
$it->url = $menu_item["url"];
|
||||
$obj->list[$menu_node_srl] = $it;
|
||||
}
|
||||
$this->menuList[$node_srl] = $obj;
|
||||
}
|
||||
|
||||
function setMenu()
|
||||
{
|
||||
$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;
|
||||
|
||||
$this->getAllItems($menu->list);
|
||||
Context::set('menus', $this->menuList);
|
||||
}
|
||||
|
||||
function display()
|
||||
{
|
||||
Context::set('layout', 'none');
|
||||
$act = Context::get('act');
|
||||
if($act)
|
||||
{
|
||||
$content = $this->procIPhone();
|
||||
}
|
||||
else
|
||||
{
|
||||
Context::set('module_info', $this->module_info);
|
||||
$this->setMenu();
|
||||
$oModule =& getModule($this->module_info->module, 'iphone');
|
||||
if($oModule && method_exists($oModule, 'procIPhone') ) Context::set('bHavePhoneMethod', true);
|
||||
$oTemplate = new TemplateHandler();
|
||||
$oContext = &Context::getInstance();
|
||||
$content = $oTemplate->compile(_XE_PATH_."addons/iphone/tpl", "layout");
|
||||
}
|
||||
print $content;
|
||||
|
||||
exit();
|
||||
}
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue