rhymix/modules/message/message.view.php
Kijin Sung 339fd234a5 Show where an Exception was thrown or error object was returned
- 관리자에게만 표시함
  - 오류 화면을 표시하는 방식에 따라서는 표시되지 않을 수 있음
  - 코어 내부에서 발생하는 오류는 표시되지 않을 수 있음
  - message 모듈 스킨에 의존함
2020-03-19 00:58:30 +09:00

72 lines
1.8 KiB
PHP

<?php
/* Copyright (C) NAVER <http://www.navercorp.com> */
/**
* @class messageView
* @author NAVER (developers@xpressengine.com)
* @brief view class of the message module
*/
class messageView extends message
{
/**
* @brief Initialization
*/
function init()
{
}
/**
* @brief Display messages
*/
function dispMessage($detail = null, $location = null)
{
// Get configurations (using module model object)
$oModuleModel = getModel('module');
$this->module_config = $config = $oModuleModel->getModuleConfig('message', $this->module_info->site_srl);
if(!$config)
{
$config = new stdClass();
}
if(!$config->skin)
{
$config->skin = 'xedition';
}
$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(strncasecmp('https://', Context::getRequestUri(), 8) === 0) $ssl_mode = true;
}
// Remove basedir from location (if any)
if ($location && starts_with(\RX_BASEDIR, $location))
{
$location = substr($location, strlen(\RX_BASEDIR));
}
Context::set('ssl_mode', $ssl_mode);
Context::set('system_message', nl2br($this->getMessage()));
Context::set('system_message_detail', nl2br($detail));
Context::set('system_message_location', escape($location));
$this->setTemplateFile('system_message');
// Default 403 Error
if($this->getHttpStatusCode() === 200)
{
$this->setHttpStatusCode(403);
}
}
}
/* End of file message.view.php */
/* Location: ./modules/message/message.view.php */