mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-22 04:39:55 +09:00
merge from 1.7.3.5(r13153:r13167)
git-svn-id: http://xe-core.googlecode.com/svn/trunk@13168 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
cc47d2b247
commit
2d3f149b5a
2042 changed files with 129266 additions and 126243 deletions
|
|
@ -1,29 +1,33 @@
|
|||
<?php
|
||||
|
||||
require_once(_XE_PATH_.'modules/page/page.view.php');
|
||||
|
||||
class pageMobile extends pageView {
|
||||
function init() {
|
||||
class pageMobile extends pageView
|
||||
{
|
||||
function init()
|
||||
{
|
||||
// Get a template path (page in the administrative template tpl putting together)
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
|
||||
switch($this->module_info->page_type)
|
||||
{
|
||||
case 'WIDGET' : {
|
||||
$this->cache_file = sprintf("%sfiles/cache/page/%d.%s.%s.m.cache.php", _XE_PATH_, $this->module_info->module_srl, Context::getLangType(), Context::getSslStatus());
|
||||
$this->interval = (int)($this->module_info->page_caching_interval);
|
||||
break;
|
||||
}
|
||||
case 'OUTSIDE' : {
|
||||
$this->cache_file = sprintf("./files/cache/opage/%d.%s.m.cache.php", $this->module_info->module_srl, Context::getSslStatus());
|
||||
$this->interval = (int)($this->module_info->page_caching_interval);
|
||||
$this->path = $this->module_info->mpath;
|
||||
break;
|
||||
}
|
||||
case 'WIDGET' :
|
||||
{
|
||||
$this->cache_file = sprintf("%sfiles/cache/page/%d.%s.%s.m.cache.php", _XE_PATH_, $this->module_info->module_srl, Context::getLangType(), Context::getSslStatus());
|
||||
$this->interval = (int)($this->module_info->page_caching_interval);
|
||||
break;
|
||||
}
|
||||
case 'OUTSIDE' :
|
||||
{
|
||||
$this->cache_file = sprintf("./files/cache/opage/%d.%s.m.cache.php", $this->module_info->module_srl, Context::getSslStatus());
|
||||
$this->interval = (int)($this->module_info->page_caching_interval);
|
||||
$this->path = $this->module_info->mpath;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function dispPageIndex() {
|
||||
function dispPageIndex()
|
||||
{
|
||||
// Variables used in the template Context:: set()
|
||||
if($this->module_srl) Context::set('module_srl',$this->module_srl);
|
||||
|
||||
|
|
@ -31,7 +35,7 @@ class pageMobile extends pageView {
|
|||
$method = '_get' . ucfirst($page_type_name) . 'Content';
|
||||
if (method_exists($this, $method)) $page_content = $this->{$method}();
|
||||
else return new Object(-1, sprintf('%s method is not exists', $method));
|
||||
|
||||
|
||||
Context::set('module_info', $this->module_info);
|
||||
Context::set('page_content', $page_content);
|
||||
|
||||
|
|
@ -43,39 +47,39 @@ class pageMobile extends pageView {
|
|||
// Arrange a widget ryeolro
|
||||
if($this->module_info->mcontent)
|
||||
{
|
||||
$cache_file = sprintf("%sfiles/cache/page/%d.%s.m.cache.php", _XE_PATH_, $this->module_info->module_srl, Context::getLangType());
|
||||
$interval = (int)($this->module_info->page_caching_interval);
|
||||
if($interval>0)
|
||||
$cache_file = sprintf("%sfiles/cache/page/%d.%s.m.cache.php", _XE_PATH_, $this->module_info->module_srl, Context::getLangType());
|
||||
$interval = (int)($this->module_info->page_caching_interval);
|
||||
if($interval>0)
|
||||
{
|
||||
if(!file_exists($cache_file) || filesize($cache_file) < 1)
|
||||
if(!file_exists($cache_file) || filesize($cache_file) < 1)
|
||||
{
|
||||
$mtime = 0;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$mtime = filemtime($cache_file);
|
||||
}
|
||||
|
||||
if($mtime + $interval*60 > time())
|
||||
if($mtime + $interval*60 > time())
|
||||
{
|
||||
$page_content = FileHandler::readFile($cache_file);
|
||||
$page_content = FileHandler::readFile($cache_file);
|
||||
$page_content = preg_replace('@<\!--#Meta:@', '<!--Meta:', $page_content);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$oWidgetController = &getController('widget');
|
||||
$page_content = $oWidgetController->transWidgetCode($this->module_info->mcontent);
|
||||
FileHandler::writeFile($cache_file, $page_content);
|
||||
}
|
||||
}
|
||||
$oWidgetController = &getController('widget');
|
||||
$page_content = $oWidgetController->transWidgetCode($this->module_info->mcontent);
|
||||
FileHandler::writeFile($cache_file, $page_content);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(file_exists($cache_file))
|
||||
if(file_exists($cache_file))
|
||||
{
|
||||
FileHandler::removeFile($cache_file);
|
||||
}
|
||||
$page_content = $this->module_info->mcontent;
|
||||
}
|
||||
$page_content = $this->module_info->mcontent;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -95,18 +99,24 @@ class pageMobile extends pageView {
|
|||
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument(0, true);
|
||||
|
||||
if ($this->module_info->mdocument_srl)
|
||||
|
||||
if($this->module_info->mdocument_srl)
|
||||
{
|
||||
$document_srl = $this->module_info->mdocument_srl;
|
||||
$oDocument->setDocument($document_srl);
|
||||
Context::set('document_srl', $document_srl);
|
||||
}
|
||||
if(!$oDocument->isExists())
|
||||
{
|
||||
$document_srl = $this->module_info->document_srl;
|
||||
$oDocument->setDocument($document_srl);
|
||||
Context::set('document_srl', $document_srl);
|
||||
}
|
||||
Context::set('oDocument', $oDocument);
|
||||
|
||||
if ($this->module_info->mskin)
|
||||
if($this->module_info->mskin)
|
||||
{
|
||||
$templatePath = (sprintf($this->module_path.'m.skins/%s', $this->module_info->skin));
|
||||
$templatePath = (sprintf($this->module_path.'m.skins/%s', $this->module_info->mskin));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -118,15 +128,17 @@ class pageMobile extends pageView {
|
|||
return $page_content;
|
||||
}
|
||||
|
||||
function _getOutsideContent(){
|
||||
function _getOutsideContent()
|
||||
{
|
||||
// check if it is http or internal file
|
||||
if($this->path) {
|
||||
if($this->path)
|
||||
{
|
||||
if(preg_match("/^([a-z]+):\/\//i",$this->path)) $content = $this->getHtmlPage($this->path, $this->interval, $this->cache_file);
|
||||
else $content = $this->executeFile($this->path, $this->interval, $this->cache_file);
|
||||
}
|
||||
|
||||
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
/* End of file page.mobile.php */
|
||||
/* Location: ./modules/page/page.mobile.php */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue