mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-07 02:53:10 +09:00
Merge branch 'feature/abspath' into develop
This commit is contained in:
commit
bb22239ec4
41 changed files with 157 additions and 133 deletions
|
|
@ -28,7 +28,7 @@ if($_REQUEST['act'] != 'api')
|
|||
}
|
||||
|
||||
// Read func file
|
||||
require_once('./addons/blogapi/blogapi.func.php');
|
||||
require_once(_XE_PATH_ . 'addons/blogapi/blogapi.func.php');
|
||||
|
||||
// xmlprc parsing
|
||||
// Parse the requested xmlrpc
|
||||
|
|
@ -83,8 +83,8 @@ if($called_position == 'before_module_proc')
|
|||
$category_list = $oDocumentModel->getCategoryList($this->module_srl);
|
||||
|
||||
// Specifies a temporary file storage
|
||||
$tmp_uploaded_path = sprintf('./files/cache/blogapi/%s/%s/', $this->mid, $user_id);
|
||||
$uploaded_target_path = sprintf('/files/cache/blogapi/%s/%s/', $this->mid, $user_id);
|
||||
$tmp_uploaded_path = sprintf(_XE_PATH_ . 'files/cache/blogapi/%s/%s/', $this->mid, $user_id);
|
||||
$uploaded_target_path = sprintf(_XE_PATH_ . 'files/cache/blogapi/%s/%s/', $this->mid, $user_id);
|
||||
|
||||
switch($method_name)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ if(!class_exists('AddonCaptcha'))
|
|||
{
|
||||
if(!$this->compareCaptcha())
|
||||
{
|
||||
Context::loadLang('./addons/captcha/lang');
|
||||
Context::loadLang(_XE_PATH_ . 'addons/captcha/lang');
|
||||
$_SESSION['XE_VALIDATOR_ERROR'] = -1;
|
||||
$_SESSION['XE_VALIDATOR_MESSAGE'] = Context::getLang('captcha_denied');
|
||||
$_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = 'error';
|
||||
|
|
@ -85,7 +85,7 @@ if(!class_exists('AddonCaptcha'))
|
|||
// compare session when calling actions such as writing a post or a comment on the board/issue tracker module
|
||||
if(!$_SESSION['captcha_authed'] && in_array(Context::get('act'), $this->target_acts))
|
||||
{
|
||||
Context::loadLang('./addons/captcha/lang');
|
||||
Context::loadLang(_XE_PATH_ . 'addons/captcha/lang');
|
||||
$ModuleHandler->error = "captcha_denied";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ if(!class_exists('AddonMemberCaptcha'))
|
|||
{
|
||||
if(!$this->compareCaptcha())
|
||||
{
|
||||
Context::loadLang('./addons/captcha_member/lang');
|
||||
Context::loadLang(_XE_PATH_ . 'addons/captcha_member/lang');
|
||||
$_SESSION['XE_VALIDATOR_ERROR'] = -1;
|
||||
$_SESSION['XE_VALIDATOR_MESSAGE'] = Context::getLang('captcha_denied');
|
||||
$_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = 'error';
|
||||
|
|
@ -96,7 +96,7 @@ if(!class_exists('AddonMemberCaptcha'))
|
|||
// compare session when calling actions such as writing a post or a comment on the board/issue tracker module
|
||||
if(!$_SESSION['member_captcha_authed'] && in_array(Context::get('act'), $this->target_acts))
|
||||
{
|
||||
Context::loadLang('./addons/captcha_member/lang');
|
||||
Context::loadLang(_XE_PATH_ . 'addons/captcha_member/lang');
|
||||
$ModuleHandler->error = "captcha_denied";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,20 +26,20 @@ if(!$logged_info)
|
|||
if($called_position == 'before_module_init' && $this->module != 'member')
|
||||
{
|
||||
// Load a language file from the communication module
|
||||
Context::loadLang('./modules/communication/lang');
|
||||
Context::loadLang(_XE_PATH_ . 'modules/communication/lang');
|
||||
// Add menus on the member login information
|
||||
$oMemberController = getController('member');
|
||||
$oMemberController->addMemberMenu('dispCommunicationFriend', 'cmd_view_friend');
|
||||
$oMemberController->addMemberMenu('dispCommunicationMessages', 'cmd_view_message_box');
|
||||
// Pop-up to display messages if a flag on new message is set
|
||||
$flag_path = './files/member_extra_info/new_message_flags/' . getNumberingPath($logged_info->member_srl);
|
||||
$flag_path = _XE_PATH_ . 'files/member_extra_info/new_message_flags/' . getNumberingPath($logged_info->member_srl);
|
||||
$flag_file = $flag_path . $logged_info->member_srl;
|
||||
|
||||
if(file_exists($flag_file) && $addon_info->use_alarm != 'N')
|
||||
{
|
||||
$new_message_count = trim(FileHandler::readFile($flag_file));
|
||||
FileHandler::removeFile($flag_file);
|
||||
Context::loadLang('./addons/member_communication/lang');
|
||||
Context::loadLang(_XE_PATH_ . 'addons/member_communication/lang');
|
||||
Context::loadFile(array('./addons/member_communication/tpl/member_communication.js'), true);
|
||||
|
||||
$text = preg_replace('@\r?\n@', '\\n', addslashes(Context::getLang('alert_new_message_arrived')));
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@ function memberTransImageName($matches)
|
|||
$_tmp->cached = true;
|
||||
$image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl);
|
||||
$image_mark_file = sprintf('files/member_extra_info/image_mark/%s%d.gif', getNumberingPath($member_srl), $member_srl);
|
||||
if(file_exists($image_name_file))
|
||||
|
||||
if(file_exists(_XE_PATH_ . $image_name_file))
|
||||
{
|
||||
$_tmp->image_name_file = $image_name_file;
|
||||
}
|
||||
|
|
@ -36,7 +37,8 @@ function memberTransImageName($matches)
|
|||
{
|
||||
$image_name_file = '';
|
||||
}
|
||||
if(file_exists($image_mark_file))
|
||||
|
||||
if(file_exists(_XE_PATH_ . $image_mark_file))
|
||||
{
|
||||
$_tmp->image_mark_file = $image_mark_file;
|
||||
}
|
||||
|
|
@ -55,6 +57,7 @@ function memberTransImageName($matches)
|
|||
$image_name_file = $_tmp->image_name_file;
|
||||
$image_mark_file = $_tmp->image_mark_file;
|
||||
}
|
||||
|
||||
// If image name and mark doesn't exist, set the original information
|
||||
if(!$image_name_file && !$image_mark_file && !$group_image)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ if($called_position != "before_display_content" || Context::getResponseMethod()
|
|||
return;
|
||||
}
|
||||
|
||||
require_once('./addons/point_level_icon/point_level_icon.lib.php');
|
||||
require_once(_XE_PATH_ . 'addons/point_level_icon/point_level_icon.lib.php');
|
||||
|
||||
$temp_output = preg_replace_callback('!<(div|span|a)([^\>]*)member_([0-9\-]+)([^\>]*)>(.*?)\<\/(div|span|a)\>!is', 'pointLevelIconTrans', $output);
|
||||
if($temp_output)
|
||||
|
|
|
|||
|
|
@ -694,12 +694,13 @@ class Context
|
|||
function getFTPInfo()
|
||||
{
|
||||
is_a($this, 'Context') ? $self = $this : $self = self::getInstance();
|
||||
|
||||
if(!$self->isFTPRegisted())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@include($self->getFTPConfigFile());
|
||||
include($self->getFTPConfigFile());
|
||||
|
||||
return $ftp_info;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,12 +76,13 @@ class DisplayHandler extends Handler
|
|||
$called_position = 'before_display_content';
|
||||
$oAddonController = &getController('addon');
|
||||
$addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? "mobile" : "pc");
|
||||
@include($addon_file);
|
||||
if(file_exists($addon_file)) include($addon_file);
|
||||
|
||||
if(method_exists($handler, "prepareToPrint"))
|
||||
{
|
||||
$handler->prepareToPrint($output);
|
||||
}
|
||||
|
||||
// header output
|
||||
if($this->gz_enabled)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class HTMLDisplayHandler
|
|||
// search if the changes CSS exists in the admin layout edit window
|
||||
$edited_layout_css = $oLayoutModel->getUserLayoutCss($layout_srl);
|
||||
|
||||
if(file_exists($edited_layout_css))
|
||||
if(FileHandler::exists($edited_layout_css))
|
||||
{
|
||||
Context::loadFile(array($edited_layout_css, 'all', '', 100));
|
||||
}
|
||||
|
|
@ -278,7 +278,7 @@ class HTMLDisplayHandler
|
|||
case 'number':
|
||||
case 'range':
|
||||
case 'color':
|
||||
$str = preg_replace('@\svalue="[^"]*?"@', ' ', $str) . ' value="' . @htmlspecialchars($INPUT_ERROR[$match[3]], ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '"';
|
||||
$str = preg_replace('@\svalue="[^"]*?"@', ' ', $str) . ' value="' . htmlspecialchars($INPUT_ERROR[$match[3]], ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '"';
|
||||
break;
|
||||
case 'password':
|
||||
$str = preg_replace('@\svalue="[^"]*?"@', ' ', $str);
|
||||
|
|
|
|||
|
|
@ -17,10 +17,11 @@ class FileHandler
|
|||
*/
|
||||
function getRealPath($source)
|
||||
{
|
||||
if(substr_compare($source, './', 0, 2) === 0)
|
||||
if(strlen($source) > 2 && substr_compare($source, './', 0, 2) === 0)
|
||||
{
|
||||
return _XE_PATH_ . substr($source, 2);
|
||||
}
|
||||
|
||||
return $source;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class ModuleHandler extends Handler
|
|||
$called_position = 'before_module_init';
|
||||
$oAddonController = getController('addon');
|
||||
$addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? 'mobile' : 'pc');
|
||||
@include($addon_file);
|
||||
if(file_exists($addon_file)) include($addon_file);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -878,9 +878,9 @@ class ModuleHandler extends Handler
|
|||
$oMenuAdminController = getAdminController('menu');
|
||||
$homeMenuCacheFile = $oMenuAdminController->getHomeMenuCacheFile();
|
||||
|
||||
if(file_exists($homeMenuCacheFile))
|
||||
if(FileHandler::exists($homeMenuCacheFile))
|
||||
{
|
||||
@include($homeMenuCacheFile);
|
||||
include($homeMenuCacheFile);
|
||||
}
|
||||
|
||||
if(!$menu->menu_srl)
|
||||
|
|
@ -895,9 +895,11 @@ class ModuleHandler extends Handler
|
|||
$menu->php_file = str_replace($menu->menu_srl, $homeMenuSrl, $menu->php_file);
|
||||
}
|
||||
}
|
||||
if(file_exists($menu->php_file))
|
||||
|
||||
$php_file = FileHandler::exists($menu->php_file);
|
||||
if($php_file)
|
||||
{
|
||||
@include($menu->php_file);
|
||||
include($php_file);
|
||||
}
|
||||
Context::set($menu_id, $menu);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -391,7 +391,7 @@ class ModuleObject extends Object
|
|||
$called_position = 'before_module_proc';
|
||||
$oAddonController = getController('addon');
|
||||
$addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? "mobile" : "pc");
|
||||
@include($addon_file);
|
||||
if(FileHandler::exists($addon_file)) include($addon_file);
|
||||
|
||||
if(isset($this->xml_info->action->{$this->act}) && method_exists($this, $this->act))
|
||||
{
|
||||
|
|
@ -450,7 +450,7 @@ class ModuleObject extends Object
|
|||
$called_position = 'after_module_proc';
|
||||
$oAddonController = getController('addon');
|
||||
$addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? "mobile" : "pc");
|
||||
@include($addon_file);
|
||||
if(FileHandler::exists($addon_file)) include($addon_file);
|
||||
|
||||
if(is_a($output, 'Object') || is_subclass_of($output, 'Object'))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ class EmbedFilter
|
|||
* @var int
|
||||
*/
|
||||
var $allowscriptaccessKey = 0;
|
||||
var $whiteUrlXmlFile = './classes/security/conf/embedWhiteUrl.xml';
|
||||
var $whiteUrlCacheFile = './files/cache/embedfilter/embedWhiteUrl.php';
|
||||
var $whiteUrlXmlFile = _XE_PATH_ . 'classes/security/conf/embedWhiteUrl.xml';
|
||||
var $whiteUrlCacheFile = _XE_PATH_ . 'files/cache/embedfilter/embedWhiteUrl.php';
|
||||
var $whiteUrlList = array();
|
||||
var $whiteIframeUrlList = array();
|
||||
var $parser = NULL;
|
||||
|
|
|
|||
|
|
@ -3,24 +3,23 @@
|
|||
|
||||
class UploadFileFilter
|
||||
{
|
||||
|
||||
private static $_block_list = array ('exec', 'system', 'passthru', 'show_source', 'phpinfo', 'fopen', 'file_get_contents', 'file_put_contents', 'fwrite', 'proc_open', 'popen');
|
||||
|
||||
|
||||
public function check($file)
|
||||
{
|
||||
// TODO: 기능개선후 enable
|
||||
|
||||
|
||||
return TRUE; // disable
|
||||
if (! $file || ! file_exists ( $file )) return TRUE;
|
||||
if (! $file || ! FileHandler::exists($file)) return TRUE;
|
||||
return self::_check ( $file );
|
||||
}
|
||||
|
||||
|
||||
private function _check($file)
|
||||
{
|
||||
if (! ($fp = fopen ( $file, 'r' ))) return FALSE;
|
||||
|
||||
|
||||
$has_php_tag = FALSE;
|
||||
|
||||
|
||||
while ( ! feof ( $fp ) )
|
||||
{
|
||||
$content = fread ( $fp, 8192 );
|
||||
|
|
@ -34,9 +33,9 @@ class UploadFileFilter
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fclose ( $fp );
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
class TemplateHandler
|
||||
{
|
||||
|
||||
private $compiled_path = './files/cache/template_compiled/'; ///< path of compiled caches files
|
||||
private $compiled_path = 'files/cache/template_compiled/'; ///< path of compiled caches files
|
||||
private $path = NULL; ///< target directory
|
||||
private $filename = NULL; ///< target filename
|
||||
private $file = NULL; ///< target file (fullpath)
|
||||
|
|
@ -30,6 +30,7 @@ class TemplateHandler
|
|||
public function __construct()
|
||||
{
|
||||
$this->xe_path = rtrim(preg_replace('/([^\.^\/]+)\.php$/i', '', $_SERVER['SCRIPT_NAME']), '/');
|
||||
$this->compiled_path = _XE_PATH_ . $this->compiled_path;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class Validator
|
|||
));
|
||||
|
||||
$this->_has_mb_func = is_callable('mb_strlen');
|
||||
$this->setCacheDir('./files/cache');
|
||||
$this->setCacheDir(_XE_PATH_ . 'files/cache');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -175,13 +175,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)
|
||||
{
|
||||
|
|
@ -1620,8 +1623,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