mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-08 03:22:29 +09:00
#64 서버 내 경로를 절대경로로 변경
This commit is contained in:
parent
bf0dd35f0a
commit
932862be1f
42 changed files with 807 additions and 133 deletions
|
|
@ -26,7 +26,7 @@ class addonAdminModel extends addon
|
|||
*/
|
||||
function getAddonPath($addon_name)
|
||||
{
|
||||
$class_path = sprintf('./addons/%s/', $addon_name);
|
||||
$class_path = sprintf(_XE_PATH_ . 'addons/%s/', $addon_name);
|
||||
if(is_dir($class_path))
|
||||
{
|
||||
return $class_path;
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ class adminAdminController extends admin
|
|||
$buff = '';
|
||||
if(is_readable($siteDesignFile))
|
||||
{
|
||||
@include($siteDesignFile);
|
||||
include($siteDesignFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -294,8 +294,7 @@ class adminAdminController extends admin
|
|||
{
|
||||
if($favorite->type == 'module')
|
||||
{
|
||||
$modulePath = './modules/' . $favorite->module;
|
||||
$modulePath = FileHandler::getRealPath($modulePath);
|
||||
$modulePath = _XE_PATH_ . 'modules/' . $favorite->module;
|
||||
if(!is_dir($modulePath))
|
||||
{
|
||||
$deleteTargets[] = $favorite->admin_favorite_srl;
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class adminAdminModel extends admin
|
|||
*/
|
||||
function getAdminFTPPath()
|
||||
{
|
||||
Context::loadLang('./modules/autoinstall/lang');
|
||||
Context::loadLang(_XE_PATH_ . 'modules/autoinstall/lang');
|
||||
@set_time_limit(5);
|
||||
require_once(_XE_PATH_ . 'libs/ftp.class.php');
|
||||
|
||||
|
|
@ -236,9 +236,11 @@ class adminAdminModel extends admin
|
|||
*/
|
||||
function getAdminFTPList()
|
||||
{
|
||||
Context::loadLang('./modules/autoinstall/lang');
|
||||
Context::loadLang(_XE_PATH_ . 'modules/autoinstall/lang');
|
||||
@set_time_limit(5);
|
||||
|
||||
require_once(_XE_PATH_ . 'libs/ftp.class.php');
|
||||
|
||||
$ftp_info = Context::getRequestVars();
|
||||
if(!$ftp_info->ftp_user || !$ftp_info->ftp_password)
|
||||
{
|
||||
|
|
@ -435,7 +437,7 @@ class adminAdminModel extends admin
|
|||
$theme_info->name = $theme_name;
|
||||
$theme_info->title = $xml_obj->title->body;
|
||||
$thumbnail = './themes/' . $theme_name . '/thumbnail.png';
|
||||
$theme_info->thumbnail = (file_exists($thumbnail)) ? $thumbnail : NULL;
|
||||
$theme_info->thumbnail = (FileHandler::exists($thumbnail)) ? $thumbnail : NULL;
|
||||
$theme_info->version = $xml_obj->version->body;
|
||||
$date_obj = new stdClass();
|
||||
sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
|
|
@ -595,7 +597,7 @@ class adminAdminModel extends admin
|
|||
$oModuleModel = getModel('module');
|
||||
foreach($searched_list as $val)
|
||||
{
|
||||
$skin_list = $oModuleModel->getSkins('./modules/' . $val);
|
||||
$skin_list = $oModuleModel->getSkins(_XE_PATH_ . 'modules/' . $val);
|
||||
|
||||
if(is_array($skin_list) && count($skin_list) > 0 && !in_array($val, $exceptionModule))
|
||||
{
|
||||
|
|
@ -770,7 +772,7 @@ class adminAdminModel extends admin
|
|||
|
||||
foreach($list as $k => $v)
|
||||
{
|
||||
if(!is_dir('./modules/' . $v->module))
|
||||
if(!is_dir(_XE_PATH_ . 'modules/' . $v->module))
|
||||
{
|
||||
unset($list[$k]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,12 +103,11 @@ class autoinstall extends ModuleObject
|
|||
$oDB = DB::getInstance();
|
||||
$oModuleModel = getModel('module');
|
||||
|
||||
if(!file_exists(FileHandler::getRealPath("./modules/autoinstall/schemas/autoinstall_installed_packages.xml"))
|
||||
&& $oDB->isTableExists("autoinstall_installed_packages"))
|
||||
if(!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_installed_packages.xml') && $oDB->isTableExists("autoinstall_installed_packages"))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
if(!file_exists(FileHandler::getRealPath("./modules/autoinstall/schemas/autoinstall_remote_categories.xml"))
|
||||
if(!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_remote_categories.xml')
|
||||
&& $oDB->isTableExists("autoinstall_remote_categories"))
|
||||
{
|
||||
return TRUE;
|
||||
|
|
@ -147,12 +146,12 @@ class autoinstall extends ModuleObject
|
|||
$oModuleModel = getModel('module');
|
||||
$oModuleController = getController('module');
|
||||
|
||||
if(!file_exists(FileHandler::getRealPath("./modules/autoinstall/schemas/autoinstall_installed_packages.xml"))
|
||||
if(!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_installed_packages.xml')
|
||||
&& $oDB->isTableExists("autoinstall_installed_packages"))
|
||||
{
|
||||
$oDB->dropTable("autoinstall_installed_packages");
|
||||
}
|
||||
if(!file_exists(FileHandler::getRealPath("./modules/autoinstall/schemas/autoinstall_remote_categories.xml"))
|
||||
if(!FileHandler::exists('./modules/autoinstall/schemas/autoinstall_remote_categories.xml')
|
||||
&& $oDB->isTableExists("autoinstall_remote_categories"))
|
||||
{
|
||||
$oDB->dropTable("autoinstall_remote_categories");
|
||||
|
|
|
|||
|
|
@ -698,7 +698,7 @@ class documentModel extends document
|
|||
function getCategoryList($module_srl, $columnList = array())
|
||||
{
|
||||
// Category of the target module file swollen
|
||||
$filename = sprintf("./files/cache/document_category/%s.php", $module_srl);
|
||||
$filename = sprintf("%sfiles/cache/document_category/%s.php", _XE_PATH_, $module_srl);
|
||||
// If the target file to the cache file regeneration category
|
||||
if(!file_exists($filename))
|
||||
{
|
||||
|
|
@ -706,7 +706,8 @@ class documentModel extends document
|
|||
if(!$oDocumentController->makeCategoryFile($module_srl)) return array();
|
||||
}
|
||||
|
||||
@include($filename);
|
||||
include($filename);
|
||||
|
||||
// Cleanup of category
|
||||
$document_category = array();
|
||||
$this->_arrangeCategory($document_category, $menu->list, 0);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class poll_maker extends EditorHandler
|
|||
{
|
||||
// Wanted Skins survey
|
||||
$oModuleModel = &getModel('module');
|
||||
$skin_list = $oModuleModel->getSkins("./modules/poll/");
|
||||
$skin_list = $oModuleModel->getSkins(_XE_PATH_ . 'modules/poll/');
|
||||
Context::set('skin_list', $skin_list);
|
||||
// Pre-compiled source code to compile template return to
|
||||
$tpl_path = $this->component_path.'tpl';
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
/**
|
||||
* @class editorModel
|
||||
* @author NAVER (developers@xpressengine.com)
|
||||
* @brief model class of the editor odule
|
||||
* @brief model class of the editor odule
|
||||
*/
|
||||
class editorModel extends editor
|
||||
{
|
||||
|
|
@ -15,7 +15,7 @@ class editorModel extends editor
|
|||
* That means there is a limitation that more than 30 editors cannot be displayed on a single page.
|
||||
*
|
||||
* However, editor_sequence can be value from getNextSequence() in case of the modified or the auto-saved for file upload
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
@ -29,7 +29,7 @@ class editorModel extends editor
|
|||
$oModuleModel = &getModel('module');
|
||||
$GLOBALS['__editor_module_config__'][$module_srl] = $oModuleModel->getModulePartConfig('editor', $module_srl);
|
||||
}
|
||||
$editor_config = $GLOBALS['__editor_module_config__'][$module_srl];
|
||||
$editor_config = $GLOBALS['__editor_module_config__'][$module_srl];
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$editor_default_config = $oModuleModel->getModuleConfig('editor');
|
||||
|
|
@ -64,7 +64,7 @@ class editorModel extends editor
|
|||
|
||||
function loadDrComponents()
|
||||
{
|
||||
$drComponentPath = './modules/editor/skins/dreditor/drcomponents/';
|
||||
$drComponentPath = _XE_PATH_ . 'modules/editor/skins/dreditor/drcomponents/';
|
||||
$drComponentList = FileHandler::readDir($drComponentPath);
|
||||
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
|
|
@ -76,7 +76,7 @@ class editorModel extends editor
|
|||
{
|
||||
unset($obj);
|
||||
$obj = $this->getDrComponentXmlInfo($drComponent);
|
||||
Context::loadLang(sprintf('%s%s/lang/',$drComponentPath,$drComponent));
|
||||
Context::loadLang(sprintf('%s%s/lang/',$drComponentPath,$drComponent));
|
||||
$path = sprintf('%s%s/tpl/',$drComponentPath,$drComponent);
|
||||
$obj->html = $oTemplate->compile($path,$drComponent);
|
||||
$drComponentInfo[$drComponent] = $obj;
|
||||
|
|
@ -250,7 +250,7 @@ class editorModel extends editor
|
|||
|
||||
if($skin=='dreditor')
|
||||
{
|
||||
$this->loadDrComponents();
|
||||
$this->loadDrComponents();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -371,7 +371,7 @@ class editorModel extends editor
|
|||
$editor_config = $this->getEditorConfig($module_srl);
|
||||
|
||||
$config = new stdClass();
|
||||
|
||||
|
||||
// Configurations listed according to a type
|
||||
if($type == 'document')
|
||||
{
|
||||
|
|
@ -602,7 +602,7 @@ class editorModel extends editor
|
|||
if(!file_exists($cache_file)) return;
|
||||
@include($cache_file);
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info && is_array($logged_info->group_list))
|
||||
if($logged_info && is_array($logged_info->group_list))
|
||||
{
|
||||
$group_list = array_keys($logged_info->group_list);
|
||||
}
|
||||
|
|
@ -632,16 +632,16 @@ class editorModel extends editor
|
|||
{
|
||||
if(!$logged_info)
|
||||
{
|
||||
$val->enabled = "N";
|
||||
$val->enabled = "N";
|
||||
}
|
||||
else
|
||||
{
|
||||
$is_granted = false;
|
||||
foreach($group_list as $group_srl)
|
||||
{
|
||||
if(in_array($group_srl, $val->target_group)) $is_granted = true;
|
||||
if(in_array($group_srl, $val->target_group)) $is_granted = true;
|
||||
}
|
||||
if(!$is_granted) $val->enabled = "N";
|
||||
if(!$is_granted) $val->enabled = "N";
|
||||
}
|
||||
}
|
||||
if($val->enabled != "N" && $val->mid_list)
|
||||
|
|
|
|||
|
|
@ -302,7 +302,9 @@ class importerAdminController extends importer
|
|||
$columnList = array('module_srl', 'module');
|
||||
$target_module_info = $oModuleModel->getModuleInfoByModuleSrl($target_module, $columnList);
|
||||
|
||||
require_once('./modules/importer/ttimport.class.php');
|
||||
$ttimporter = FileHandler::exists(_XE_PATH_ . 'modules/importer/ttimport.class.php');
|
||||
if($ttimporter) require_once($ttimporter);
|
||||
|
||||
$oTT = new ttimport();
|
||||
$cur = $oTT->importModule($key, $cur, $index_file, $this->unit_count, $target_module, $guestbook_target_module, $user_id, $target_module_info->module);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ class installAdminController extends install
|
|||
$homeMenuCacheFile = $oMenuAdminController->getHomeMenuCacheFile();
|
||||
if(file_exists($homeMenuCacheFile))
|
||||
{
|
||||
@include($homeMenuCacheFile);
|
||||
include($homeMenuCacheFile);
|
||||
}
|
||||
|
||||
if(!$homeMenuSrl || $homeMenuSrl != $output->menu_srl)
|
||||
|
|
|
|||
|
|
@ -176,13 +176,14 @@ class installController extends install
|
|||
if(!$this->makeConfigFile()) return new Object(-1, 'msg_install_failed');
|
||||
|
||||
// load script
|
||||
$scripts = FileHandler::readDir('./modules/install/script','/(\.php)$/');
|
||||
$scripts = FileHandler::readDir(_XE_PATH_ . 'modules/install/script', '/(\.php)$/');
|
||||
if(count($scripts)>0)
|
||||
{
|
||||
sort($scripts);
|
||||
foreach($scripts as $script)
|
||||
{
|
||||
$output = include(FileHandler::getRealPath('./modules/install/script/'.$script));
|
||||
$script_path = FileHandler::getRealPath('./modules/install/script/');
|
||||
$output = include($script_path . $script));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ $obj->module_srl = $module_srl;
|
|||
Context::set('version', __XE_VERSION__);
|
||||
$obj->title = 'Welcome XE';
|
||||
|
||||
$obj->content = $oTemplateHandler->compile('./modules/install/script/welcome_content', 'welcome_content_'.$lang);
|
||||
$obj->content = $oTemplateHandler->compile(_XE_PATH_ . 'modules/install/script/welcome_content', 'welcome_content_'.$lang);
|
||||
|
||||
$output = $oDocumentController->insertDocument($obj);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
|
|
|||
|
|
@ -184,8 +184,8 @@ class layoutAdminModel extends layout
|
|||
public function getSiteDefaultLayout($viewType = 'P', $siteSrl = 0)
|
||||
{
|
||||
$target = ($viewType == 'M') ? 'mlayout_srl' : 'layout_srl';
|
||||
$designInfoFile = sprintf(_XE_PATH_.'/files/site_design/design_%s.php', $siteSrl);
|
||||
@include($designInfoFile);
|
||||
$designInfoFile = sprintf(_XE_PATH_ . 'files/site_design/design_%s.php', $siteSrl);
|
||||
if(FileHandler::exists($designInfoFile)) include($designInfoFile);
|
||||
|
||||
if(!$designInfo || !$designInfo->{$target})
|
||||
{
|
||||
|
|
|
|||
|
|
@ -319,7 +319,8 @@ class layoutAdminView extends layout
|
|||
{
|
||||
foreach($layout_info->menu as $menu_id => $menu)
|
||||
{
|
||||
if(file_exists($menu->php_file)) @include($menu->php_file);
|
||||
$menu->php_file = FileHandler::getRealPath($menu->php_file);
|
||||
if(FileHandler::exists($menu->php_file)) include($menu->php_file);
|
||||
Context::set($menu_id, $menu);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -760,7 +760,7 @@ class layoutModel extends layout
|
|||
|
||||
$buff = '<?php if(!defined("__XE__")) exit(); '.$buff.' ?>';
|
||||
FileHandler::writeFile($cache_file, $buff);
|
||||
if(file_exists($cache_file)) @include($cache_file);
|
||||
if(FileHandler::exists($cache_file)) include($cache_file);
|
||||
|
||||
if(!$layout_info->title)
|
||||
{
|
||||
|
|
@ -807,7 +807,7 @@ class layoutModel extends layout
|
|||
*/
|
||||
function getUserLayoutPath($layout_srl)
|
||||
{
|
||||
return sprintf("./files/faceOff/%s",getNumberingPath($layout_srl,3));
|
||||
return sprintf("%sfiles/faceOff/%s", _XE_PATH_, getNumberingPath($layout_srl,3));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -942,7 +942,7 @@ class layoutModel extends layout
|
|||
*/
|
||||
function getLayoutCache($layout_name,$lang_type)
|
||||
{
|
||||
return sprintf("./files/cache/layout/%s.%s.cache.php",$layout_name,$lang_type);
|
||||
return sprintf("%sfiles/cache/layout/%s.%s.cache.php", _XE_PATH_, $layout_name,$lang_type);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -87,12 +87,12 @@ class layoutView extends layout
|
|||
|
||||
if ($skinType == 'M')
|
||||
{
|
||||
$templatePath = './modules/page/m.skins/' . $skin;
|
||||
$templatePath = _XE_PATH_ . 'modules/page/m.skins/' . $skin;
|
||||
$templateFile = 'mobile';
|
||||
}
|
||||
else
|
||||
{
|
||||
$templatePath = './modules/page/skins/' . $skin;
|
||||
$templatePath = _XE_PATH_ . 'modules/page/skins/' . $skin;
|
||||
$templateFile = 'content';
|
||||
}
|
||||
|
||||
|
|
@ -113,8 +113,8 @@ class layoutView extends layout
|
|||
if($layoutSrl == -1)
|
||||
{
|
||||
$site_srl = ($oModule) ? $oModule->module_info->site_srl : 0;
|
||||
$designInfoFile = sprintf(_XE_PATH_.'/files/site_design/design_%s.php', $site_srl);
|
||||
@include($designInfoFile);
|
||||
$designInfoFile = sprintf(_XE_PATH_ . 'files/site_design/design_%s.php', $site_srl);
|
||||
include($designInfoFile);
|
||||
|
||||
if($skinType == 'M')
|
||||
{
|
||||
|
|
@ -164,7 +164,7 @@ class layoutView extends layout
|
|||
|
||||
if(file_exists($homeMenuCacheFile))
|
||||
{
|
||||
@include($homeMenuCacheFile);
|
||||
include($homeMenuCacheFile);
|
||||
}
|
||||
|
||||
if(!$menu->menu_srl)
|
||||
|
|
@ -179,9 +179,11 @@ class layoutView extends layout
|
|||
$menu->php_file = str_replace($menu->menu_srl, $homeMenuSrl, $menu->php_file);
|
||||
}
|
||||
}
|
||||
if(file_exists($menu->php_file))
|
||||
|
||||
$menu->php_file = FileHandler::getRealPath($menu->php_file);
|
||||
if(FileHandler::exists($menu->php_file))
|
||||
{
|
||||
@include($menu->php_file);
|
||||
include($menu->php_file);
|
||||
}
|
||||
Context::set($menu_id, $menu);
|
||||
}
|
||||
|
|
@ -304,7 +306,7 @@ class layoutView extends layout
|
|||
}
|
||||
|
||||
// get module html
|
||||
require_once("./classes/display/HTMLDisplayHandler.php");
|
||||
require_once(_XE_PATH_ . "classes/display/HTMLDisplayHandler.php");
|
||||
$handler = new HTMLDisplayHandler();
|
||||
return $handler->toDoc($oModule);
|
||||
}
|
||||
|
|
@ -346,7 +348,9 @@ class layoutView extends layout
|
|||
{
|
||||
foreach($layout_info->menu as $menu_id => $menu)
|
||||
{
|
||||
if(file_exists($menu->php_file)) @include($menu->php_file);
|
||||
$menu->php_file = FileHandler::getRealPath($menu->php_file);
|
||||
if(FileHandler::exists($menu->php_file)) include($menu->php_file);
|
||||
|
||||
Context::set($menu_id, $menu);
|
||||
}
|
||||
}
|
||||
|
|
@ -354,7 +358,7 @@ class layoutView extends layout
|
|||
Context::set('layout_info', $layout_info);
|
||||
Context::set('content', Context::getLang('layout_preview_content'));
|
||||
// Temporary save the codes
|
||||
$edited_layout_file = sprintf('./files/cache/layout/tmp.tpl');
|
||||
$edited_layout_file = _XE_PATH_ . 'files/cache/layout/tmp.tpl';
|
||||
FileHandler::writeFile($edited_layout_file, $code);
|
||||
|
||||
// Compile
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class menuAdminController extends menu
|
|||
* home menu cache file
|
||||
* @var string
|
||||
*/
|
||||
private $homeMenuCacheFile = './files/cache/menu/homeSitemap.php';
|
||||
private $homeMenuCacheFile = 'files/cache/menu/homeSitemap.php';
|
||||
|
||||
/**
|
||||
* Initialization
|
||||
|
|
@ -53,7 +53,10 @@ class menuAdminController extends menu
|
|||
function init()
|
||||
{
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
//$this->homeMenuCacheFile = sprintf('./files/cache/menu/homeSitemap.php');
|
||||
}
|
||||
|
||||
function __construct() {
|
||||
$this->homeMenuCacheFile = _XE_PATH_ . $this->homeMenuCacheFile;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -142,7 +145,7 @@ class menuAdminController extends menu
|
|||
|
||||
if(is_readable(FileHandler::getRealPath($phpFile)))
|
||||
{
|
||||
@include(FileHandler::getRealPath($phpFile));
|
||||
include(FileHandler::getRealPath($phpFile));
|
||||
}
|
||||
|
||||
// check home menu in originMenu
|
||||
|
|
@ -742,7 +745,7 @@ class menuAdminController extends menu
|
|||
|
||||
if(is_readable(FileHandler::getRealPath($phpFile)))
|
||||
{
|
||||
@include(FileHandler::getRealPath($phpFile));
|
||||
include(FileHandler::getRealPath($phpFile));
|
||||
|
||||
if(is_array($menu->list))
|
||||
{
|
||||
|
|
@ -889,12 +892,12 @@ class menuAdminController extends menu
|
|||
}
|
||||
|
||||
// get menu properies with child menu
|
||||
$phpFile = sprintf("./files/cache/menu/%s.php", $originalItemInfo->menu_srl);
|
||||
$phpFile = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $originalItemInfo->menu_srl);
|
||||
$originMenu = NULL;
|
||||
|
||||
if(is_readable(FileHandler::getRealPath($phpFile)))
|
||||
{
|
||||
@include(FileHandler::getRealPath($phpFile));
|
||||
include(FileHandler::getRealPath($phpFile));
|
||||
|
||||
if(is_array($menu->list))
|
||||
{
|
||||
|
|
@ -988,12 +991,12 @@ class menuAdminController extends menu
|
|||
$menuSrl = $itemInfo->menu_srl;
|
||||
|
||||
// get menu properies with child menu
|
||||
$phpFile = sprintf("./files/cache/menu/%s.php", $menuSrl);
|
||||
$phpFile = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $menuSrl);
|
||||
$originMenu = NULL;
|
||||
|
||||
if(is_readable(FileHandler::getRealPath($phpFile)))
|
||||
{
|
||||
@include(FileHandler::getRealPath($phpFile));
|
||||
include(FileHandler::getRealPath($phpFile));
|
||||
|
||||
if(is_array($menu->list))
|
||||
{
|
||||
|
|
@ -1306,7 +1309,7 @@ class menuAdminController extends menu
|
|||
{
|
||||
if(file_exists($this->homeMenuCacheFile))
|
||||
{
|
||||
@include($this->homeMenuCacheFile);
|
||||
include($this->homeMenuCacheFile);
|
||||
}
|
||||
if(!$homeMenuSrl || $homeMenuSrl != $menu_srl)
|
||||
{
|
||||
|
|
@ -1618,8 +1621,8 @@ class menuAdminController extends menu
|
|||
$output = executeQuery('menu.getMenuItems', $args);
|
||||
if(!$output->toBool()) return;
|
||||
// Specify the name of the cache file
|
||||
$xml_file = sprintf("./files/cache/menu/%s.xml.php", $menu_srl);
|
||||
$php_file = sprintf("./files/cache/menu/%s.php", $menu_srl);
|
||||
$xml_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.xml.php", $menu_srl);
|
||||
$php_file = sprintf(_XE_PATH_ . "files/cache/menu/%s.php", $menu_srl);
|
||||
// If no data found, generate an XML file without node data
|
||||
$list = $output->data;
|
||||
if(!$list)
|
||||
|
|
|
|||
|
|
@ -493,12 +493,9 @@ class menuAdminModel extends menu
|
|||
{
|
||||
$isMenuFixed = false;
|
||||
$output = $this->getMenu($menuSrl);
|
||||
$php_file = sprintf('./files/cache/menu/%s.php',$output->menu_srl);
|
||||
if(file_exists($php_file)) @include($php_file);
|
||||
else
|
||||
{
|
||||
$oMenuAdminController->makeXmlFile($menuSrl);
|
||||
}
|
||||
$php_file = sprintf(_XE_PATH_ . 'files/cache/menu/%s.php',$output->menu_srl);
|
||||
if(file_exists($php_file)) include($php_file);
|
||||
else $oMenuAdminController->makeXmlFile($menuSrl);
|
||||
|
||||
if(count($menu->list)>0)
|
||||
{
|
||||
|
|
@ -532,15 +529,18 @@ class menuAdminModel extends menu
|
|||
{
|
||||
unset($menu);
|
||||
unset($menuItems);
|
||||
$value->php_file = sprintf('./files/cache/menu/%s.php',$value->menu_srl);
|
||||
if(file_exists($value->php_file)) @include($value->php_file);
|
||||
$value->php_file = sprintf(_XE_PATH_ . 'files/cache/menu/%s.php',$value->menu_srl);
|
||||
if(file_exists($value->php_file))
|
||||
{
|
||||
include($value->php_file);
|
||||
}
|
||||
else
|
||||
{
|
||||
$oMenuAdminController->makeXmlFile($value->menu_srl);
|
||||
}
|
||||
|
||||
$isMenuFixed = false;
|
||||
if(count($menu->list)>0)
|
||||
if(count($menu->list) > 0)
|
||||
{
|
||||
foreach($menu->list AS $key2=>$value2)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ class menuAdminView extends menu
|
|||
unset($menu);
|
||||
unset($menuItems);
|
||||
//$value->xml_file = sprintf('./files/cache/menu/%s.xml.php',$value->menu_srl);
|
||||
$value->php_file = sprintf('./files/cache/menu/%s.php',$value->menu_srl);
|
||||
if(file_exists($value->php_file)) @include($value->php_file);
|
||||
$value->php_file = sprintf(_XE_PATH_ . 'files/cache/menu/%s.php',$value->menu_srl);
|
||||
if(file_exists($value->php_file)) include($value->php_file);
|
||||
|
||||
if(count($menu->list)>0)
|
||||
{
|
||||
|
|
@ -80,7 +80,7 @@ class menuAdminView extends menu
|
|||
Context::set('menu_list', $menuList);
|
||||
|
||||
// get installed module list
|
||||
$oPageController = &getController('page'); //for lang
|
||||
$oPageController = &getController('page'); //for lang
|
||||
$resultModuleList = $oMenuAdminModel->getModuleListInSitemap($site_srl);
|
||||
Context::set('module_list', $resultModuleList);
|
||||
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@ class moduleAdminController extends module
|
|||
}
|
||||
|
||||
// Get skin information (to check extra_vars)
|
||||
$module_path = './modules/'.$module_info->module;
|
||||
$module_path = _XE_PATH_ . 'modules/'.$module_info->module;
|
||||
|
||||
if($mode === 'M')
|
||||
{
|
||||
|
|
|
|||
|
|
@ -527,7 +527,7 @@ class moduleAdminModel extends module
|
|||
function getModuleAdminMultilingualHtml()
|
||||
{
|
||||
$oTemplate = TemplateHandler::getInstance();
|
||||
$tpl = $oTemplate->compile('./modules/module/tpl', 'multilingual_v17.html');
|
||||
$tpl = $oTemplate->compile(_XE_PATH_ . 'modules/module/tpl', 'multilingual_v17.html');
|
||||
|
||||
$this->add('html', $tpl);
|
||||
}
|
||||
|
|
@ -566,7 +566,7 @@ class moduleAdminModel extends module
|
|||
$oSecurity->encodeHTML('lang_code_list..');
|
||||
|
||||
$oTemplate = TemplateHandler::getInstance();
|
||||
$tpl = $oTemplate->compile('./modules/module/tpl', 'multilingual_v17_list.html');
|
||||
$tpl = $oTemplate->compile(_XE_PATH_ . 'modules/module/tpl', 'multilingual_v17_list.html');
|
||||
|
||||
$this->add('html', $tpl);
|
||||
}
|
||||
|
|
@ -576,9 +576,9 @@ class moduleAdminModel extends module
|
|||
*/
|
||||
function getModuleAdminModuleSearcherHtml()
|
||||
{
|
||||
Context::loadLang('./modules/admin/lang');
|
||||
Context::loadLang(_XE_PATH_ . 'modules/admin/lang');
|
||||
$oTemplate = TemplateHandler::getInstance();
|
||||
$tpl = $oTemplate->compile('./modules/module/tpl', 'module_searcher_v17.html');
|
||||
$tpl = $oTemplate->compile(_XE_PATH_ . 'modules/module/tpl', 'module_searcher_v17.html');
|
||||
|
||||
$this->add('html', $tpl);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ class moduleAdminView extends module
|
|||
$columnList = array('module_srl', 'module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($modules[0], $columnList);
|
||||
// Get a skin list of the module
|
||||
$skin_list = $oModuleModel->getSkins('./modules/'.$module_info->module);
|
||||
$skin_list = $oModuleModel->getSkins(_XE_PATH_ . 'modules/'.$module_info->module);
|
||||
Context::set('skin_list',$skin_list);
|
||||
// Get a layout list
|
||||
$oLayoutMode = &getModel('layout');
|
||||
|
|
|
|||
|
|
@ -82,10 +82,10 @@ class moduleModel extends module
|
|||
function getDefaultMid()
|
||||
{
|
||||
$default_url = Context::getDefaultUrl();
|
||||
if(substr_compare($default_url, '/', -1) === 0) $default_url = substr($default_url, 0, -1);
|
||||
if($default_url && substr_compare($default_url, '/', -1) === 0) $default_url = substr($default_url, 0, -1);
|
||||
|
||||
$request_url = Context::getRequestUri();
|
||||
if(substr_compare($request_url, '/', -1) === 0) $request_url = substr($request_url, 0, -1);
|
||||
if($request_url && substr_compare($request_url, '/', -1) === 0) $request_url = substr($request_url, 0, -1);
|
||||
|
||||
$default_url_parse = parse_url($default_url);
|
||||
$request_url_parse = parse_url($request_url);
|
||||
|
|
@ -747,7 +747,7 @@ class moduleModel extends module
|
|||
$xml_file = sprintf("%sconf/module.xml", $class_path);
|
||||
if(!file_exists($xml_file)) return;
|
||||
// Check if cached file exists
|
||||
$cache_file = sprintf("./files/cache/module_info/%s.%s.%s.php", $module, Context::getLangType(), __XE_VERSION__);
|
||||
$cache_file = sprintf(_XE_PATH_ . "files/cache/module_info/%s.%s.%s.php", $module, Context::getLangType(), __XE_VERSION__);
|
||||
// Update if no cache file exists or it is older than xml file
|
||||
if(!file_exists($cache_file) || filemtime($cache_file)<filemtime($xml_file))
|
||||
{
|
||||
|
|
@ -903,7 +903,7 @@ class moduleModel extends module
|
|||
return $info;
|
||||
}
|
||||
|
||||
@include($cache_file);
|
||||
if(file_exists($cache_file)) include($cache_file);
|
||||
|
||||
return $info;
|
||||
}
|
||||
|
|
@ -1713,7 +1713,7 @@ class moduleModel extends module
|
|||
$designInfoFile = sprintf(_XE_PATH_.'files/site_design/design_%s.php', $site_srl);
|
||||
if(is_readable($designInfoFile))
|
||||
{
|
||||
@include($designInfoFile);
|
||||
include($designInfoFile);
|
||||
|
||||
$skinName = $designInfo->module->{$module_name}->{$target};
|
||||
}
|
||||
|
|
@ -2077,7 +2077,7 @@ class moduleModel extends module
|
|||
$security->encodeHTML('filebox_list..comment', 'filebox_list..attributes.');
|
||||
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
$html = $oTemplate->compile('./modules/module/tpl/', 'filebox_list_html');
|
||||
$html = $oTemplate->compile(_XE_PATH_ . 'modules/module/tpl/', 'filebox_list_html');
|
||||
|
||||
$this->add('html', $html);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class pageView extends page
|
|||
}
|
||||
case 'OUTSIDE' :
|
||||
{
|
||||
$this->cache_file = sprintf("./files/cache/opage/%d.%s.cache.php", $this->module_info->module_srl, Context::getSslStatus());
|
||||
$this->cache_file = sprintf("%sfiles/cache/opage/%d.%s.cache.php", _XE_PATH_, $this->module_info->module_srl, Context::getSslStatus());
|
||||
$this->interval = (int)($this->module_info->page_caching_interval);
|
||||
$this->path = $this->module_info->path;
|
||||
break;
|
||||
|
|
@ -166,24 +166,28 @@ class pageView extends page
|
|||
/**
|
||||
* @brief Create a cache file in order to include if it is an internal file
|
||||
*/
|
||||
function executeFile($path, $caching_interval, $cache_file)
|
||||
function executeFile($target_file, $caching_interval, $cache_file)
|
||||
{
|
||||
// Cancel if the file doesn't exist
|
||||
if(!file_exists($path)) return;
|
||||
if(!file_exists(FileHandler::getRealPath($target_file))) return;
|
||||
|
||||
// Get a path and filename
|
||||
$tmp_path = explode('/',$cache_file);
|
||||
$filename = $tmp_path[count($tmp_path)-1];
|
||||
$filepath = preg_replace('/'.$filename."$/i","",$cache_file);
|
||||
$cache_file = FileHandler::getRealPath($cache_file);
|
||||
|
||||
// Verify cache
|
||||
if($caching_interval <1 || !file_exists($cache_file) || filemtime($cache_file) + $caching_interval*60 <= $_SERVER['REQUEST_TIME'] || filemtime($cache_file)<filemtime($path))
|
||||
if($caching_interval <1 || !file_exists($cache_file) || filemtime($cache_file) + $caching_interval*60 <= $_SERVER['REQUEST_TIME'] || filemtime($cache_file)<filemtime($target_file))
|
||||
{
|
||||
if(file_exists($cache_file)) FileHandler::removeFile($cache_file);
|
||||
|
||||
// Read a target file and get content
|
||||
ob_start();
|
||||
@include($path);
|
||||
include(FileHandler::getRealPath($target_file));
|
||||
$content = ob_get_clean();
|
||||
// Replace relative path to the absolute path
|
||||
$this->path = str_replace('\\', '/', realpath(dirname($path))) . '/';
|
||||
$this->path = str_replace('\\', '/', realpath(dirname($target_file))) . '/';
|
||||
$content = preg_replace_callback('/(target=|src=|href=|url\()("|\')?([^"\'\)]+)("|\'\))?/is',array($this,'_replacePath'),$content);
|
||||
$content = preg_replace_callback('/(<!--%import\()(\")([^"]+)(\")/is',array($this,'_replacePath'),$content);
|
||||
|
||||
|
|
@ -201,7 +205,7 @@ class pageView extends page
|
|||
$__Context->tpl_path = $filepath;
|
||||
|
||||
ob_start();
|
||||
@include($cache_file);
|
||||
include($cache_file);
|
||||
$content = ob_get_clean();
|
||||
|
||||
return $content;
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ class pollController extends poll
|
|||
$oDB->commit();
|
||||
|
||||
$skin = Context::get('skin');
|
||||
if(!$skin || !is_dir('./modules/poll/skins/'.$skin)) $skin = 'default';
|
||||
if(!$skin || !is_dir(_XE_PATH_ . 'modules/poll/skins/'.$skin)) $skin = 'default';
|
||||
// Get tpl
|
||||
$tpl = $oPollModel->getPollHtml($poll_srl, '', $skin);
|
||||
|
||||
|
|
@ -191,7 +191,7 @@ class pollController extends poll
|
|||
$poll_srl = Context::get('poll_srl');
|
||||
|
||||
$skin = Context::get('skin');
|
||||
if(!$skin || !is_dir('./modules/poll/skins/'.$skin)) $skin = 'default';
|
||||
if(!$skin || !is_dir(_XE_PATH_ . 'modules/poll/skins/'.$skin)) $skin = 'default';
|
||||
|
||||
$oPollModel = &getModel('poll');
|
||||
$tpl = $oPollModel->getPollResultHtml($poll_srl, $skin);
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ class widgetModel extends widget
|
|||
$xml_file = sprintf("%sconf/info.xml", $widget_path);
|
||||
if(!file_exists($xml_file)) return;
|
||||
// If the problem by comparing the cache file and include the return variable $widget_info
|
||||
$cache_file = sprintf('./files/cache/widget/%s.%s.cache.php', $widget, Context::getLangType());
|
||||
$cache_file = sprintf(_XE_PATH_ . 'files/cache/widget/%s.%s.cache.php', $widget, Context::getLangType());
|
||||
|
||||
if(file_exists($cache_file)&&filemtime($cache_file)>filemtime($xml_file))
|
||||
{
|
||||
|
|
@ -300,7 +300,7 @@ class widgetModel extends widget
|
|||
$xml_file = sprintf("%sskin.xml", $widgetStyle_path);
|
||||
if(!file_exists($xml_file)) return;
|
||||
// If the problem by comparing the cache file and include the return variable $widgetStyle_info
|
||||
$cache_file = sprintf('./files/cache/widgetstyles/%s.%s.cache.php', $widgetStyle, Context::getLangType());
|
||||
$cache_file = sprintf(_XE_PATH_ . 'files/cache/widgetstyles/%s.%s.cache.php', $widgetStyle, Context::getLangType());
|
||||
|
||||
if(file_exists($cache_file)&&filemtime($cache_file)>filemtime($xml_file))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue