issue 2168 set member skin through theme. And update path of theme skin using for '|@|'.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.3.2@11016 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
devjin 2012-08-09 12:09:18 +00:00
parent b36ed4295b
commit 2b6f473b26
15 changed files with 344 additions and 98 deletions

View file

@ -1,53 +1,63 @@
<?php
/**
* @class messageView
* @author NHN (developers@xpressengine.com)
* @brief view class of the message module
**/
/**
* @class messageView
* @author NHN (developers@xpressengine.com)
* @brief view class of the message module
**/
class messageView extends message {
class messageView extends message {
/**
* @brief Initialization
**/
function init() {
}
/**
* @brief Initialization
**/
function init()
{
}
/**
* @brief Display messages
**/
function dispMessage() {
// Get configurations (using module model object)
$oModuleModel = &getModel('module');
$this->module_config = $config = $oModuleModel->getModuleConfig('message', $this->module_info->site_srl);
if(!$config->skin){
$config->skin = 'default';
$template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
}else{
//check theme
$config_parse = explode('.', $config->skin);
if (count($config_parse) > 1){
$template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]);
}else{
$template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
/**
* @brief Display messages
**/
function dispMessage()
{
// Get configurations (using module model object)
$oModuleModel = &getModel('module');
$this->module_config = $config = $oModuleModel->getModuleConfig('message', $this->module_info->site_srl);
if(!$config->skin)
{
$config->skin = 'default';
$template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
}
}
// Template path
$this->setTemplatePath($template_path);
else
{
//check theme
$config_parse = explode('|@|', $config->skin);
if (count($config_parse) > 1)
{
$template_path = sprintf('./themes/%s/modules/message/', $config_parse[0]);
}
else
{
$template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
}
}
// Template path
$this->setTemplatePath($template_path);
// Get the member configuration
$member_config = $oModuleModel->getModuleConfig('member');
Context::set('member_config', $member_config);
// Set a flag to check if the https connection is made when using SSL and create https url
$ssl_mode = false;
if($member_config->enable_ssl == 'Y') {
if(preg_match('/^https:\/\//i',Context::getRequestUri())) $ssl_mode = true;
}
Context::set('ssl_mode',$ssl_mode);
// Get the member configuration
$member_config = $oModuleModel->getModuleConfig('member');
Context::set('member_config', $member_config);
// Set a flag to check if the https connection is made when using SSL and create https url
$ssl_mode = false;
if($member_config->enable_ssl == 'Y') {
if(preg_match('/^https:\/\//i',Context::getRequestUri())) $ssl_mode = true;
}
Context::set('ssl_mode',$ssl_mode);
Context::set('system_message', nl2br($this->getMessage()));
Context::set('system_message', nl2br($this->getMessage()));
$this->setTemplateFile('system_message');
}
}
$this->setTemplateFile('system_message');
}
}
?>