mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 18:21:39 +09:00
- 트리거 등 반환값이 필요하지 않은 곳에서 new BaseObject()를 반환하는 것 삭제 - 모듈 설치, 업데이트 후 무의미한 new BaseObject()를 반환하는 것 삭제 - 사용자에게 에러 메시지를 돌려주는 용도로 new BaseObject(-1, '에러메시지')를 사용하는 경우는 대부분 $this->setError()로 변경함. 언어 변환과 sprintf() 처리까지 한 번에 이루어지므로 이쪽이 더 편리함.
74 lines
2.1 KiB
PHP
74 lines
2.1 KiB
PHP
<?php
|
|
|
|
class ncenterliteView extends ncenterlite
|
|
{
|
|
function init()
|
|
{
|
|
$oNcenterliteModel = getModel('ncenterlite');
|
|
$config = $oNcenterliteModel->getConfig();
|
|
$template_path = sprintf("%sskins/%s/",$this->module_path, $config->skin);
|
|
if(!is_dir($template_path)||!$config->skin)
|
|
{
|
|
$config->skin = 'default';
|
|
$template_path = sprintf("%sskins/%s/",$this->module_path, $config->skin);
|
|
}
|
|
$this->setTemplatePath($template_path);
|
|
|
|
$oLayoutModel = getModel('layout');
|
|
$layout_info = $oLayoutModel->getLayout($config->layout_srl);
|
|
|
|
if($layout_info)
|
|
{
|
|
$this->module_info->layout_srl = $config->layout_srl;
|
|
$this->setLayoutPath($layout_info->path);
|
|
}
|
|
}
|
|
|
|
function dispNcenterliteNotifyList()
|
|
{
|
|
$oNcenterliteModel = getModel('ncenterlite');
|
|
|
|
$output = $oNcenterliteModel->getMyNotifyList();
|
|
|
|
Context::set('total_count', $output->page_navigation->total_count);
|
|
Context::set('total_page', $output->page_navigation->total_page);
|
|
Context::set('page', $output->page);
|
|
Context::set('ncenterlite_list', $output->data);
|
|
Context::set('page_navigation', $output->page_navigation);
|
|
|
|
$this->setTemplateFile('NotifyList');
|
|
}
|
|
|
|
function dispNcenterliteUserConfig()
|
|
{
|
|
$oNcenterliteModel = getModel('ncenterlite');
|
|
$config = $oNcenterliteModel->getConfig();
|
|
if($config->user_notify_setting != 'Y')
|
|
{
|
|
return $this->setError('msg_not_use_user_setting');
|
|
}
|
|
|
|
$oMemberModel = getModel('member');
|
|
$member_srl = Context::get('member_srl');
|
|
$logged_info = Context::get('logged_info');
|
|
if(!Context::get('is_logged')) return $this->setError('ncenterlite_stop_login_required');
|
|
|
|
if($logged_info->is_admin == 'Y')
|
|
{
|
|
$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
|
|
}
|
|
|
|
if($logged_info->is_admin != 'Y' && $member_srl)
|
|
{
|
|
if($member_srl != $logged_info->member_srl)
|
|
{
|
|
return $this->setError('ncenterlite_stop_no_permission_other_user');
|
|
}
|
|
}
|
|
$output = $oNcenterliteModel->getUserConfig($member_srl);
|
|
|
|
Context::set('member_info', $member_info);
|
|
Context::set('user_config', $output->data);
|
|
$this->setTemplateFile('userconfig');
|
|
}
|
|
}
|