diff --git a/modules/page/m.skins/default/mobile.html b/modules/page/m.skins/default/mobile.html
new file mode 100644
index 000000000..92940b223
--- /dev/null
+++ b/modules/page/m.skins/default/mobile.html
@@ -0,0 +1,12 @@
+
제목 : {$oDocument->getTitle()}
+내용 : {$oDocument->getContent()}
+태그 : {implode(',', $oDocument->get('tag_list'))}
+
+
+
+
diff --git a/modules/page/page.admin.controller.php b/modules/page/page.admin.controller.php
index 79ab9d0a1..8f5d3e28f 100644
--- a/modules/page/page.admin.controller.php
+++ b/modules/page/page.admin.controller.php
@@ -48,14 +48,14 @@
case 'WIDGET' : {
unset($args->skin);
unset($args->mskin);
- unset($args->opage_path);
- unset($args->opage_mpath);
+ unset($args->path);
+ unset($args->mpath);
break;
}
case 'ARTICLE' : {
unset($args->page_caching_interval);
- unset($args->opage_path);
- unset($args->opage_mpath);
+ unset($args->path);
+ unset($args->mpath);
break;
}
case 'OUTSIDE' : {
diff --git a/modules/page/page.class.php b/modules/page/page.class.php
index 6d458b009..7f4ffb74a 100644
--- a/modules/page/page.class.php
+++ b/modules/page/page.class.php
@@ -44,6 +44,7 @@
$in_out = executeQuery('page.insertPageType', $args);
}
$output = executeQuery('page.updateAllOpage');
+ if(!$output->toBool()) return $output;
}
// old page module instance update
diff --git a/modules/page/page.mobile.php b/modules/page/page.mobile.php
index bb5a79c09..f1e374b35 100644
--- a/modules/page/page.mobile.php
+++ b/modules/page/page.mobile.php
@@ -1,12 +1,43 @@
setTemplatePath($this->module_path.'tpl');
+
+ switch($this->module_info->page_type)
+ {
+ case 'WIDGET' : {
+ $this->cache_file = sprintf("%sfiles/cache/page/%d.%s.cache.php", _XE_PATH_, $this->module_info->module_srl, Context::getLangType());
+ $this->interval = (int)($this->module_info->page_caching_interval);
+ break;
+ }
+ case 'OUTSIDE' : {
+ $this->cache_file = sprintf("./files/cache/opage/%d.cache.php", $this->module_info->module_srl);
+ $this->interval = (int)($this->module_info->page_caching_interval);
+ $this->path = $this->module_info->mpath;
+ break;
+ }
+ }
}
function dispPageIndex() {
+ // Variables used in the template Context:: set()
+ if($this->module_srl) Context::set('module_srl',$this->module_srl);
+
+ $page_type_name = strtolower($this->module_info->page_type);
+ $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);
+
+ $this->setTemplateFile('mobile');
+ }
+ function _getWidgetContent(){
// Arrange a widget ryeolro
if($this->module_info->mcontent)
{
@@ -28,18 +59,39 @@ class pageMobile extends ModuleObject {
if(file_exists($cache_file)) FileHandler::removeFile($cache_file);
$page_content = $this->module_info->mcontent;
}
- Context::set('content', $page_content);
}
else
{
preg_match_all('!(
]*)(widget=)([^\>]*?)(\>)!is', $this->module_info->content, $matches);
- $content = '';
+ $page_content = '';
for($i=0,$c=count($matches[0]);$i<$c;$i++) {
- $content .= preg_replace('/ style\=\"([^\"]+)\" /i',' style="overflow:hidden;clear:both;margin:0 0 20px 0; _margin-right:10px;" ',$matches[0][$i])."\n\n";
+ $page_content .= preg_replace('/ style\=\"([^\"]+)\" /i',' style="overflow:hidden;clear:both;margin:0 0 20px 0; _margin-right:10px;" ',$matches[0][$i])."\n\n";
}
- Context::set('content', $content);
}
- $this->setTemplateFile('mobile');
+ return $page_content;
+ }
+
+ function _getArticleContent(){
+ $oDocumentModel = &getModel('document');
+ $oDocument = $oDocumentModel->getDocument(0, true);
+
+ if ($this->module_info->document_srl){
+ $document_srl = $this->module_info->document_srl;
+ $oDocument->setDocument($document_srl);
+ Context::set('document_srl', $document_srl);
+ }
+ Context::set('oDocument', $oDocument);
+ $this->setTemplatePath(sprintf($this->module_path.'m.skins/%s', $this->module_info->skin));
+ }
+
+ function _getOutsideContent(){
+ // check if it is http or internal file
+ 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;
}
}
diff --git a/modules/page/page.view.php b/modules/page/page.view.php
index 6a01300a6..e8a9fc9e9 100644
--- a/modules/page/page.view.php
+++ b/modules/page/page.view.php
@@ -12,7 +12,7 @@
var $page_count = 10;
var $cache_file;
var $interval;
- var $opage_path;
+ var $path;
/**
* @brief Initialization
@@ -31,7 +31,7 @@
case 'OUTSIDE' : {
$this->cache_file = sprintf("./files/cache/opage/%d.cache.php", $this->module_info->module_srl);
$this->interval = (int)($this->module_info->page_caching_interval);
- $this->opage_path = $this->module_info->opage_path;
+ $this->path = $this->module_info->path;
break;
}
}
@@ -90,9 +90,9 @@
function _getOutsideContent(){
// check if it is http or internal file
- if($this->opage_path) {
- if(preg_match("/^([a-z]+):\/\//i",$this->opage_path)) $content = $this->getHtmlPage($this->opage_path, $this->interval, $this->cache_file);
- else $content = $this->executeFile($this->opage_path, $this->interval, $this->cache_file);
+ 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;
@@ -153,7 +153,7 @@
$content = ob_get_clean();
// Replace relative path to the absolute path
$path_info = pathinfo($path);
- $this->opage_path = str_replace('\\', '/', realpath($path_info['dirname'])).'/';
+ $this->path = str_replace('\\', '/', realpath($path_info['dirname'])).'/';
$content = preg_replace_callback('/(target=|src=|href=|url\()("|\')?([^"\'\)]+)("|\'\))?/is',array($this,'_replacePath'),$content);
$content = preg_replace_callback('/(
-{$content}
+{$page_content}
diff --git a/modules/page/tpl/page_info.html b/modules/page/tpl/page_info.html
index d40a608c7..86c82b628 100644
--- a/modules/page/tpl/page_info.html
+++ b/modules/page/tpl/page_info.html
@@ -86,14 +86,14 @@
{$lang->opage_path} |
-
+
{$lang->about_opage_path}{realpath("./")}
|
{$lang->opage_mobile_path} |
-
+
{$lang->about_opage_mobile_path}{realpath("./")}
|
diff --git a/modules/page/tpl/page_insert.html b/modules/page/tpl/page_insert.html
index ea046d51d..7e7877b11 100644
--- a/modules/page/tpl/page_insert.html
+++ b/modules/page/tpl/page_insert.html
@@ -122,14 +122,14 @@
{$lang->opage_path} |
-
+
{$lang->about_opage_path}{realpath("./")}
|
{$lang->opage_mobile_path} |
-
+
{$lang->about_opage_mobile_path}{realpath("./")}
|