git-svn-id: http://xe-core.googlecode.com/svn/trunk@798 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-03-30 04:45:50 +00:00
parent a11ddec974
commit a5528e0099
41 changed files with 298 additions and 478 deletions

View file

@ -7,12 +7,6 @@
class admin extends ModuleObject {
/**
* @brief MVC 에서 공통으로 사용되는 설정등을 모아 놓은것..
**/
function init() {
}
/**
* @brief 설치시 추가 작업이 필요할시 구현
**/

View file

@ -12,55 +12,12 @@
function init() {
}
/**
* @brief admin 모듈내에서 다른 모듈을 실행하는 부분
**/
function procOtherModule($module, $act) {
$oModuleHandler = new ModuleHandler($module, $act);
$oModule = &$oModuleHandler->procModule();
return $oModule;
}
/**
* @brief 로그인 시킴
**/
function procLogin() {
// 아이디, 비밀번호를 받음
$user_id = Context::get('user_id');
$password = Context::get('password');
// member controller 객체 생성
$oMemberController = &getController('member');
return $oMemberController->procLogin($user_id, $password);
}
/**
* @brief 로그아웃 시킴
**/
function procLogout() {
// member controller 객체 생성
$oMemberController = &getController('member');
$output = $oMemberController->procLogout();
if(!$output->toBool()) return $output;
$this->setRedirectUrl('./?module=admin');
}
/**
* @brief 숏컷 추가
**/
function procInsertShortCut() {
function procAdminInsertShortCut() {
$module = Context::get('selected_module');
$output = $this->insertShortCut($module);
if(!$output->toBool()) return $output;
$this->setMessage('success_registed');
}
/**
* @brief 숏컷을 추가하는 method
**/
function insertShortCut($module) {
// 선택된 모듈의 정보중에서 admin_index act를 구함
$oModuleModel = &getModel('module');
$module_info = $oModuleModel->getModuleInfoXml($module);
@ -72,14 +29,15 @@
$oDB = &DB::getInstance();
$output = $oDB->executeQuery('admin.insertShortCut', $args);
return $output;
if(!$output->toBool()) return $output;
$this->setMessage('success_registed');
}
/**
* @brief 숏컷의 내용 수정
* @brief 숏컷의 삭제
**/
function procDeleteShortCut() {
function procAdminDeleteShortCut() {
$oDB = &DB::getInstance();

View file

@ -32,75 +32,20 @@
$oAdminModel = &getModel('admin');
$shortcut_list = $oAdminModel->getShortCuts();
Context::set('shortcut_list', $shortcut_list);
}
/**
* @brief 관리자 메인 페이지 출력
**/
function dispIndex() {
// mo(module), act 변수값이 넘어오면 해당 모듈을 실행
$mo = Context::get('mo');
$act = Context::get('act');
if($mo && $mo != 'admin' && $act) {
$oAdminController = &getController('admin');
$oModule = &$oAdminController->procOtherModule($mo, $act);
}
// 만약 oModule이 없으면 관리자 초기 페이지 출력
if(!$oModule || !is_object($oModule)) {
$this->setTemplateFile('index');
// oModule이 정상이라면
} else {
// 모듈의 타이틀 값을 구해옴
$oModuleModel = &getModel('module');
$module_info = $oModuleModel->getModuleInfoXml($mo);
Context::set('selected_module_info', $module_info);
// 해당 모듈의 template path, file을 가로챔
$this->setTemplatePath($oModule->getTemplatePath());
$this->setTemplateFile($oModule->getTemplateFile());
}
function dispAdminIndex() {
$this->setTemplateFile('index');
}
/**
* @brief 관리자 메뉴 숏컷 출력
**/
function dispShortCut() {
function dispAdminShortCut() {
$this->setTemplateFile('shortcut_list');
}
/**
* @brief 관리자 로그인 페이지 출력
**/
function dispLogin() {
// 로그인 되어 있으면 메인 페이지 표시
if(Context::get('is_logged')) return $this->dispIndex();
// member모듈의 로그인 act를 이용
$oMemberView = &getView('member');
$oMemberView->dispLoginForm();
$this->setTemplatePath($oMemberView->getTemplatePath());
$this->setTemplateFile($oMemberView->getTemplateFile());
}
/**
* @brief 관리자 로그아웃 페이지 출력
**/
function dispLogout() {
// 로그인 되어 있지 않으면 메인 페이지 표시
if(!Context::get('is_logged')) return $this->dispIndex();
// member모듈의 로그아웃 act를 이용
$oMemberView = &getView('member');
$oMemberView->dispLogout();
$this->setTemplatePath($oMemberView->getTemplatePath());
$this->setTemplateFile($oMemberView->getTemplateFile());
}
}
?>

View file

@ -1,11 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<module version="0.1">
<title xml:lang="ko">관리자 모듈</title>
<title xml:lang="en">admin module</title>
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
<name xml:lang="ko">제로</name>
<name xml:lang="en">zero</name>
<description xml:lang="ko">관리자 모듈</description>
<description xml:lang="en">admin module</description>
</author>
<title xml:lang="ko">관리자 모듈</title>
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
<name xml:lang="ko">제로</name>
<description xml:lang="ko">각 모듈들의 기능을 나열하고 관리자용 레이아웃을 적용하여 관리 기능을 사용할 수 있도록 하는 모듈입니다.</description>
</author>
</module>

View file

@ -1,15 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<module>
<actions>
<action name="dispIndex" type="view" standalone="true" index="true"/>
<action name="dispShortCut" type="view" standalone="true" />
<action name="dispAdminIndex" type="view" standalone="true" index="true"/>
<action name="dispAdminShortCut" type="view" standalone="true" />
<action name="dispLogin" type="view" standalone="true" />
<action name="dispLogout" type="view" standalone="true" />
<action name="procLogin" type="controller" standalone="true" />
<action name="procLogout" type="controller" standalone="true" />
<action name="procInsertShortCut" type="controller" standalone="true" />
<action name="procDeleteShortCut" type="controller" standalone="true" />
<action name="procAdminInsertShortCut" type="controller" standalone="true" />
<action name="procAdminDeleteShortCut" type="controller" standalone="true" />
</actions>
</module>

View file

@ -1,8 +1,8 @@
<query id="deleteShortCut" action="delete">
<tables>
<table name="admin_shortcut" />
</tables>
<conditions>
<condition operation="equal" column="module" var="module" notnull="notnull" />
</conditions>
<tables>
<table name="admin_shortcut" />
</tables>
<conditions>
<condition operation="equal" column="module" var="module" notnull="notnull" />
</conditions>
</query>

View file

@ -1,13 +1,13 @@
<query id="insertShortCut" action="insert">
<tables>
<table name="admin_shortcut" />
</tables>
<columns>
<column name="shortcut_srl" var="shortcut_srl" default="sequence()" filter="number" notnull="notnull" />
<column name="title" var="title" notnull="notnull" minlength="2" maxlength="250" />
<column name="module" var="module" notnull="notnull" minlength="2" maxlength="250" />
<column name="default_act" var="default_act" notnull="notnull" minlength="2" maxlength="250" />
<column name="regdate" var="regdate" default="curdate()" />
<column name="list_order" var="list_order" default="sequence()" />
</columns>
<tables>
<table name="admin_shortcut" />
</tables>
<columns>
<column name="shortcut_srl" var="shortcut_srl" default="sequence()" filter="number" notnull="notnull" />
<column name="title" var="title" notnull="notnull" minlength="2" maxlength="250" />
<column name="module" var="module" notnull="notnull" minlength="2" maxlength="250" />
<column name="default_act" var="default_act" notnull="notnull" minlength="2" maxlength="250" />
<column name="regdate" var="regdate" default="curdate()" />
<column name="list_order" var="list_order" default="sequence()" />
</columns>
</query>

View file

@ -1,8 +1,8 @@
<table name="admin_shortcut">
<column name="shortcut_srl" type="number" size="11" notnull="notnull" primary_key="primary_key" />
<column name="module" type="varchar" size="250" notnull="notnull" unique="uni_module" />
<column name="title" type="varchar" size="250" notnull="notnull" />
<column name="default_act" type="varchar" size="250" notnull="notnull" />
<column name="list_order" type="number" size="11" notnull="notnull" index="idx_list_order" />
<column name="regdate" type="date" />
<column name="shortcut_srl" type="number" size="11" notnull="notnull" primary_key="primary_key" />
<column name="module" type="varchar" size="250" notnull="notnull" unique="uni_module" />
<column name="title" type="varchar" size="250" notnull="notnull" />
<column name="default_act" type="varchar" size="250" notnull="notnull" />
<column name="list_order" type="number" size="11" notnull="notnull" index="idx_list_order" />
<column name="regdate" type="date" />
</table>

View file

@ -1,37 +1,39 @@
@charset "utf-8";
#admin_title {
font-size:20pt;
font-weight:bold;
float:left;
height:30px;
font-size:20pt;
font-weight:bold;
float:left;
height:30px;
}
#admin_sub_menu{
float:right;
height:30px;
float:right;
height:30px;
}
#admin_main_menu {
clear:both;
text-align:right;
margin-bottom:10px;
clear:both;
text-align:right;
margin-bottom:10px;
}
#admin_main_menu .selected {
font-weight:bold;
font-weight:bold;
}
#admin_module_info {
border:1px solid #EEEEEE;
padding:5px;
margin-bottom:20px;
border:1px solid #EEEEEE;
padding:5px;
margin-bottom:20px;
}
#admin_module_info a {
color:#000000;
font-weight:bold;
text-decoration:none;
color:#000000;
font-weight:bold;
text-decoration:none;
}
#admin_content {
clear:both;
clear:both;
}

View file

@ -1,9 +1,9 @@
<filter name="delete_shortcut" module="admin" act="procDeleteShortCut" confirm_msg_code="confirm_delete">
<form>
<node target="selected_module" required="true" />
</form>
<response>
<tag name="error" />
<tag name="message" />
</response>
<filter name="delete_shortcut" module="admin" act="procAdminDeleteShortCut" confirm_msg_code="confirm_delete">
<form>
<node target="selected_module" required="true" />
</form>
<response>
<tag name="error" />
<tag name="message" />
</response>
</filter>

View file

@ -1 +1 @@
haha
관리자 페이지..

View file

@ -1,12 +1,12 @@
/**
* @file : modules/admin/js/admin.js
* @author : zero <zero@nzeo.com>
* @desc : admin 모듈의 javascript
* @file admin.js
* @author zero (zero@nzeo.com)
* @desc admin 모듈의 javascript
**/
// 숏컷 삭제
function doDeleteShortCut(selected_module) {
var fo_obj = xGetElementById('fo_shortcut_info');
fo_obj.selected_module.value = selected_module;
procFilter(fo_obj, delete_shortcut);
var fo_obj = xGetElementById('fo_shortcut_info');
fo_obj.selected_module.value = selected_module;
procFilter(fo_obj, delete_shortcut);
}

View file

@ -2,31 +2,31 @@
<!--%import("js/admin.js")-->
<div id="admin_title">
<a href="./?module=admin">zeroboard XE</a>
<a href="./?module=admin">zeroboard XE</a>
</div>
<div id="admin_sub_menu">
<a href="{getUrl('act','dispLogout')}">{$lang->cmd_logout}</a>
<a href="{getUrl('act','dispLogout')}">{$lang->cmd_logout}</a>
</div>
<div id="admin_main_menu">
<!-- 자주 쓰이는 모듈의 경우 별도 등록을 함 -->
<div>
<!--@foreach($shortcut_list as $key => $val)-->
<span <!--@if($mo==$val->module)-->class="selected"<!--@end-->>
<a href="#" onclick="location.href='{getUrl('','module', $module, 'act',$val->default_act,'mo',$val->module)}';return false;">{$val->title}</a>
</span>
<!--@end-->
[<a href="#" onclick="location.href='{getUrl('','module','admin','act','dispShortCut')}';return false;">{$lang->cmd_management}</a>]
</div>
<!-- 자주 쓰이는 모듈의 경우 별도 등록을 함 -->
<div>
<!--@foreach($shortcut_list as $key => $val)-->
<span <!--@if($mo==$val->module)-->class="selected"<!--@end-->>
<a href="#" onclick="location.href='{getUrl('','module', $module, 'act',$val->default_act,'mo',$val->module)}';return false;">{$val->title}</a>
</span>
<!--@end-->
[<a href="#" onclick="location.href='{getUrl('','module','admin','act','dispAdminShortCut')}';return false;">{$lang->cmd_management}</a>]
</div>
</div>
<!--@if($selected_module_info)-->
<div id="admin_module_info">
<a href="#" onclick="location.href='{getUrl('','module', $module, 'mo', $mo, 'act', $selected_module_info->admin_index_act)}';return false;">{$selected_module_info->title}</a> (ver {$selected_module_info->version})
<a href="#" onclick="location.href='{getUrl('','module', $module, 'mo', $mo, 'act', $selected_module_info->admin_index_act)}';return false;">{$selected_module_info->title}</a> (ver {$selected_module_info->version})
</div>
<!--@end-->
<div id="admin_content">
{$content}
{$content}
</div>

View file

@ -5,31 +5,29 @@
<!-- 숏컷의 위/아래, 삭제와 관련된 form -->
<form id="fo_shortcut_info" action="./" method="get">
<input type="hidden" name="selected_module" value="" />
<input type="hidden" name="selected_module" value="" />
</form>
<div>
<table>
<tr>
<th>{$lang->title}</th>
<th>{$lang->module}</th>
<th>{$lang->regdate}</th>
<th>{$lang->cmd_delete}</th>
</tr>
<!--@if(!count($shortcut_list))-->
<tr>
<td colspan="4">{$lang->msg_shortcut_is_null}</td>
</tr>
<!--@end-->
<!--@foreach($shortcut_list as $shortcut_info)-->
<tr>
<td>{$shortcut_info->title}</td>
<td>{$shortcut_info->module}</td>
<td>{zdate($shortcut_info->last_update,"Y-m-d H:i:s")}</td>
<td><a href="#" onclick="doDeleteShortCut('{$shortcut_info->module}');return false;">{$lang->cmd_delete}</a></td>
</tr>
<!--@end-->
</table>
<table>
<tr>
<th>{$lang->title}</th>
<th>{$lang->module}</th>
<th>{$lang->regdate}</th>
<th>{$lang->cmd_delete}</th>
</tr>
<!--@if(!count($shortcut_list))-->
<tr>
<td colspan="4">{$lang->msg_shortcut_is_null}</td>
</tr>
<!--@end-->
<!--@foreach($shortcut_list as $shortcut_info)-->
<tr>
<td>{$shortcut_info->title}</td>
<td>{$shortcut_info->module}</td>
<td>{zdate($shortcut_info->last_update,"Y-m-d H:i:s")}</td>
<td><a href="#" onclick="doDeleteShortCut('{$shortcut_info->module}');return false;">{$lang->cmd_delete}</a></td>
</tr>
<!--@end-->
</table>
</div>
</form>