mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 11:44:10 +09:00
Merge messageMobile class with messageView (fix #1450)
This commit is contained in:
parent
8a452f151b
commit
bd14589bd9
2 changed files with 37 additions and 76 deletions
|
|
@ -3,69 +3,7 @@
|
||||||
|
|
||||||
class messageMobile extends messageView
|
class messageMobile extends messageView
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* @brief Initialization
|
|
||||||
**/
|
|
||||||
function init()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Message output
|
|
||||||
**/
|
|
||||||
function dispMessage($detail = null)
|
|
||||||
{
|
|
||||||
// Get configurations (using module model object)
|
|
||||||
$oModuleModel = getModel('module');
|
|
||||||
$config = $oModuleModel->getModuleConfig('message');
|
|
||||||
if(!is_object($config)) $config = new stdClass;
|
|
||||||
if(!$config->mskin) $config->mskin = 'default';
|
|
||||||
|
|
||||||
// Set the template path
|
|
||||||
if($config->mskin === '/USE_RESPONSIVE/')
|
|
||||||
{
|
|
||||||
$template_path = sprintf('%sskins/%s/', $this->module_path, $config->skin);
|
|
||||||
if(!is_dir($template_path) || !$config->skin)
|
|
||||||
{
|
|
||||||
$template_path = sprintf('%sskins/%s/', $this->module_path, 'default');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$template_path = sprintf('%sm.skins/%s/', $this->module_path, $config->mskin);
|
|
||||||
if(!is_dir($template_path) || !$config->mskin)
|
|
||||||
{
|
|
||||||
$template_path = sprintf('%sm.skins/%s/', $this->module_path, 'default');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the member configuration
|
|
||||||
$oModuleModel = getModel('module');
|
|
||||||
$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(strncasecmp('https://', Context::getRequestUri(), 8) === 0) $ssl_mode = true;
|
|
||||||
}
|
|
||||||
Context::set('ssl_mode',$ssl_mode);
|
|
||||||
Context::set('system_message', nl2br($this->getMessage()));
|
|
||||||
Context::set('system_message_detail', nl2br($detail));
|
|
||||||
|
|
||||||
Context::set('act', 'procMemberLogin');
|
|
||||||
Context::set('mid', '');
|
|
||||||
|
|
||||||
$this->setTemplatePath($template_path);
|
|
||||||
$this->setTemplateFile('system_message');
|
|
||||||
|
|
||||||
// Default 403 Error
|
|
||||||
if($this->getHttpStatusCode() === 200)
|
|
||||||
{
|
|
||||||
$this->setHttpStatusCode(403);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/* End of file message.mobile.php */
|
/* End of file message.mobile.php */
|
||||||
/* Location: ./modules/message/message.mobile.php */
|
/* Location: ./modules/message/message.mobile.php */
|
||||||
|
|
|
||||||
|
|
@ -19,29 +19,52 @@ class messageView extends message
|
||||||
*/
|
*/
|
||||||
function dispMessage($detail = null, $location = null)
|
function dispMessage($detail = null, $location = null)
|
||||||
{
|
{
|
||||||
// Get configurations (using module model object)
|
// Get skin configuration
|
||||||
$oModuleModel = getModel('module');
|
$config = ModuleModel::getModuleConfig('message') ?: new stdClass;
|
||||||
$this->module_config = $config = $oModuleModel->getModuleConfig('message', $this->module_info->site_srl);
|
|
||||||
|
|
||||||
if(!$config)
|
|
||||||
{
|
|
||||||
$config = new stdClass();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!$config->skin)
|
if(!$config->skin)
|
||||||
{
|
{
|
||||||
$config->skin = 'xedition';
|
$config->skin = 'xedition';
|
||||||
}
|
}
|
||||||
$template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
|
if(!$config->mskin)
|
||||||
|
{
|
||||||
|
$config->mskin = 'default';
|
||||||
|
}
|
||||||
|
|
||||||
// Template path
|
// Set the template path
|
||||||
|
if (contains('mobile', get_class($this), false))
|
||||||
|
{
|
||||||
|
if($config->mskin === '/USE_RESPONSIVE/')
|
||||||
|
{
|
||||||
|
$template_path = sprintf('%sskins/%s/', $this->module_path, $config->skin);
|
||||||
|
if(!is_dir($template_path))
|
||||||
|
{
|
||||||
|
$template_path = sprintf('%sskins/%s/', $this->module_path, 'default');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$template_path = sprintf('%sm.skins/%s/', $this->module_path, $config->mskin);
|
||||||
|
if(!is_dir($template_path))
|
||||||
|
{
|
||||||
|
$template_path = sprintf('%sm.skins/%s/', $this->module_path, 'default');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
|
||||||
|
if(!is_dir($template_path))
|
||||||
|
{
|
||||||
|
$template_path = sprintf('%sskins/%s/', $this->module_path, 'default');
|
||||||
|
}
|
||||||
|
}
|
||||||
$this->setTemplatePath($template_path);
|
$this->setTemplatePath($template_path);
|
||||||
|
|
||||||
// Get the member configuration
|
// Get the member configuration
|
||||||
$member_config = $oModuleModel->getModuleConfig('member');
|
$member_config = ModuleModel::getModuleConfig('member');
|
||||||
Context::set('member_config', $member_config);
|
Context::set('member_config', $member_config);
|
||||||
|
|
||||||
// Set a flag to check if the https connection is made when using SSL and create https url
|
// Set SSL mode (for backward compatibility only)
|
||||||
$ssl_mode = false;
|
$ssl_mode = false;
|
||||||
if($member_config->enable_ssl == 'Y')
|
if($member_config->enable_ssl == 'Y')
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue