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

This commit is contained in:
zero 2007-03-30 05:11:53 +00:00
parent 166e3249e7
commit 11b83459b0
18 changed files with 154 additions and 151 deletions

View file

@ -11,6 +11,11 @@
* @brief 설치시 추가 작업이 필요할시 구현 * @brief 설치시 추가 작업이 필요할시 구현
**/ **/
function moduleInstall() { function moduleInstall() {
// action forward에 등록 (관리자 모드에서 사용하기 위함)
$oModuleController = &getController('module');
$oModuleController->insertActionFoward('comment', 'view', 'dispCommentAdminList');
$oModuleController->insertActionFoward('comment', 'controller', 'procCommentAdminDeleteChecked');
return new Object(); return new Object();
} }

View file

@ -13,6 +13,29 @@
function init() { function init() {
} }
/**
* @brief 관리자 페이지에서 선택된 댓글들을 삭제
**/
function procCommentAdminDeleteChecked() {
// 선택된 글이 없으면 오류 표시
$cart = Context::get('cart');
if(!$cart) return $this->stop('msg_cart_is_null');
$comment_srl_list= explode('|@|', $cart);
$comment_count = count($comment_srl_list);
if(!$comment_count) return $this->stop('msg_cart_is_null');
// 글삭제
for($i=0;$i<$comment_count;$i++) {
$comment_srl = trim($comment_srl_list[$i]);
if(!$comment_srl) continue;
$this->deleteComment($comment_srl, true);
}
$this->setMessage( sprintf(Context::getLang('msg_checked_comment_is_deleted'), $comment_count) );
}
/** /**
* @brief 코멘트의 권한 부여 * @brief 코멘트의 권한 부여
* 세션값으로 접속상태에서만 사용 가능 * 세션값으로 접속상태에서만 사용 가능
@ -206,27 +229,5 @@
$output = $oDB->executeQuery('comment.deleteModuleComments', $args); $output = $oDB->executeQuery('comment.deleteModuleComments', $args);
return $output; return $output;
} }
/**
* @brief 관리자 페이지에서 선택된 댓글들을 삭제
**/
function procDeleteChecked() {
// 선택된 글이 없으면 오류 표시
$cart = Context::get('cart');
if(!$cart) return $this->stop('msg_cart_is_null');
$comment_srl_list= explode('|@|', $cart);
$comment_count = count($comment_srl_list);
if(!$comment_count) return $this->stop('msg_cart_is_null');
// 글삭제
for($i=0;$i<$comment_count;$i++) {
$comment_srl = trim($comment_srl_list[$i]);
if(!$comment_srl) continue;
$this->deleteComment($comment_srl, true);
}
$this->setMessage( sprintf(Context::getLang('msg_checked_comment_is_deleted'), $comment_count) );
}
} }
?> ?>

View file

@ -16,7 +16,7 @@
/** /**
* @brief 목록 출력 (관리자용) * @brief 목록 출력 (관리자용)
**/ **/
function dispList() { function dispCommentAdminList() {
// 목록을 구하기 위한 옵션 // 목록을 구하기 위한 옵션
$args->page = Context::get('page'); ///< 페이지 $args->page = Context::get('page'); ///< 페이지
$args->list_count = 50; ///< 한페이지에 보여줄 글 수 $args->list_count = 50; ///< 한페이지에 보여줄 글 수

View file

@ -1,11 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<module version="0.1"> <module version="0.1">
<title xml:lang="ko">댓글</title> <title xml:lang="ko">댓글</title>
<title xml:lang="en">comment</title>
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28"> <author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
<name xml:lang="ko">제로</name> <name xml:lang="ko">제로</name>
<name xml:lang="en">zero</name> <description xml:lang="ko">게시판이나 블로그등의 댓글을 관리하는 모듈입니다.</description>
<description xml:lang="ko">댓글 모듈</description>
<description xml:lang="en">comment</description>
</author> </author>
</module> </module>

View file

@ -2,7 +2,7 @@
<module> <module>
<grants /> <grants />
<actions> <actions>
<action name="dispList" type="view" admin_index="true" standalone="true" /> <action name="dispCommentAdminList" type="view" admin_index="true" standalone="true" />
<action name="procDeleteChecked" type="controller" standalone="true" /> <action name="procCommentAdminDeleteChecked" type="controller" standalone="true" />
</actions> </actions>
</module> </module>

View file

@ -1,8 +1,8 @@
<query id="deleteComment" action="delete"> <query id="deleteComment" action="delete">
<tables> <tables>
<table name="comments" /> <table name="comments" />
</tables> </tables>
<conditions> <conditions>
<condition operation="equal" column="comment_srl" var="comment_srl" filter="number" notnull="notnull" /> <condition operation="equal" column="comment_srl" var="comment_srl" filter="number" notnull="notnull" />
</conditions> </conditions>
</query> </query>

View file

@ -1,8 +1,8 @@
<query id="deleteComments" action="delete"> <query id="deleteComments" action="delete">
<tables> <tables>
<table name="comments" /> <table name="comments" />
</tables> </tables>
<conditions> <conditions>
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" /> <condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
</conditions> </conditions>
</query> </query>

View file

@ -1,8 +1,8 @@
<query id="deleteComments" action="delete"> <query id="deleteComments" action="delete">
<tables> <tables>
<table name="comments" /> <table name="comments" />
</tables> </tables>
<conditions> <conditions>
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull" /> <condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull" />
</conditions> </conditions>
</query> </query>

View file

@ -1,11 +1,11 @@
<query id="getChildCommentCount" action="select"> <query id="getChildCommentCount" action="select">
<tables> <tables>
<table name="comments" /> <table name="comments" />
</tables> </tables>
<columns> <columns>
<column name="count(*)" alias="count" /> <column name="count(*)" alias="count" />
</columns> </columns>
<conditions> <conditions>
<condition operation="equal" column="parent_srl" var="comment_srl" filter="number" notnull="notnull" /> <condition operation="equal" column="parent_srl" var="comment_srl" filter="number" notnull="notnull" />
</conditions> </conditions>
</query> </query>

View file

@ -1,11 +1,11 @@
<query id="getComment" action="select"> <query id="getComment" action="select">
<tables> <tables>
<table name="comments" /> <table name="comments" />
</tables> </tables>
<columns> <columns>
<column name="*" /> <column name="*" />
</columns> </columns>
<conditions> <conditions>
<condition operation="equal" column="comment_srl" var="comment_srl" filter="number" notnull="notnull" /> <condition operation="equal" column="comment_srl" var="comment_srl" filter="number" notnull="notnull" />
</conditions> </conditions>
</query> </query>

View file

@ -1,11 +1,11 @@
<query id="getCommentCount" action="select"> <query id="getCommentCount" action="select">
<tables> <tables>
<table name="comments" /> <table name="comments" />
</tables> </tables>
<columns> <columns>
<column name="count(*)" alias="count" /> <column name="count(*)" alias="count" />
</columns> </columns>
<conditions> <conditions>
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" /> <condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
</conditions> </conditions>
</query> </query>

View file

@ -1,14 +1,14 @@
<query id="getCommentList" action="select"> <query id="getCommentList" action="select">
<tables> <tables>
<table name="comments" /> <table name="comments" />
</tables> </tables>
<columns> <columns>
<column name="*" /> <column name="*" />
</columns> </columns>
<conditions> <conditions>
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" /> <condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
</conditions> </conditions>
<navigation> <navigation>
<index var="list_order" order="asc" /> <index var="list_order" order="asc" />
</navigation> </navigation>
</query> </query>

View file

@ -1,11 +1,11 @@
<query id="getComments" action="select"> <query id="getComments" action="select">
<tables> <tables>
<table name="comments" /> <table name="comments" />
</tables> </tables>
<columns> <columns>
<column name="*" /> <column name="*" />
</columns> </columns>
<conditions> <conditions>
<condition operation="in" column="comment_srl" var="comment_srls" notnull="notnull" /> <condition operation="in" column="comment_srl" var="comment_srls" notnull="notnull" />
</conditions> </conditions>
</query> </query>

View file

@ -1,22 +1,22 @@
<query id="insertComment" action="insert"> <query id="insertComment" action="insert">
<tables> <tables>
<table name="comments" /> <table name="comments" />
</tables> </tables>
<columns> <columns>
<column name="comment_srl" var="comment_srl" notnull="notnull" /> <column name="comment_srl" var="comment_srl" notnull="notnull" />
<column name="module_srl" var="module_srl" filter="number" notnull="notnull" /> <column name="module_srl" var="module_srl" filter="number" notnull="notnull" />
<column name="parent_srl" var="parent_srl" filter="number" default="0" /> <column name="parent_srl" var="parent_srl" filter="number" default="0" />
<column name="document_srl" var="document_srl" filter="number" notnull="notnull" /> <column name="document_srl" var="document_srl" filter="number" notnull="notnull" />
<column name="content" var="content" notnull="notnull" minlength="2" maxlength="250" /> <column name="content" var="content" notnull="notnull" minlength="2" maxlength="250" />
<column name="password" var="password" minlength="2" maxlength="60" /> <column name="password" var="password" minlength="2" maxlength="60" />
<column name="nick_name" var="nick_name" notnull="notnull" minlength="1" maxlength="40" /> <column name="nick_name" var="nick_name" notnull="notnull" minlength="1" maxlength="40" />
<column name="user_name" var="user_name" default="" /> <column name="user_name" var="user_name" default="" />
<column name="member_srl" var="member_srl" default="0" filter="number" /> <column name="member_srl" var="member_srl" default="0" filter="number" />
<column name="email_address" var="email_address" filter="email" maxlength="250" /> <column name="email_address" var="email_address" filter="email" maxlength="250" />
<column name="homepage" var="homepage" filter="homepage" maxlength="250" /> <column name="homepage" var="homepage" filter="homepage" maxlength="250" />
<column name="uploaded_count" var="uploaded_count" default="0" /> <column name="uploaded_count" var="uploaded_count" default="0" />
<column name="regdate" var="regdate" default="curdate()" /> <column name="regdate" var="regdate" default="curdate()" />
<column name="ipaddress" var="ipaddress" default="ipaddress()" /> <column name="ipaddress" var="ipaddress" default="ipaddress()" />
<column name="list_order" var="list_order" default="0" /> <column name="list_order" var="list_order" default="0" />
</columns> </columns>
</query> </query>

View file

@ -1,21 +1,21 @@
<query id="updateComment" action="update"> <query id="updateComment" action="update">
<tables> <tables>
<table name="comments" /> <table name="comments" />
</tables> </tables>
<columns> <columns>
<column name="module_srl" var="module_srl" filter="number" default="0" /> <column name="module_srl" var="module_srl" filter="number" default="0" />
<column name="parent_srl" var="parent_srl" filter="number" default="0" /> <column name="parent_srl" var="parent_srl" filter="number" default="0" />
<column name="content" var="content" notnull="notnull" minlength="2" maxlength="250" /> <column name="content" var="content" notnull="notnull" minlength="2" maxlength="250" />
<column name="password" var="password" minlength="2" maxlength="60" /> <column name="password" var="password" minlength="2" maxlength="60" />
<column name="user_name" var="user_name" default="" /> <column name="user_name" var="user_name" default="" />
<column name="nick_name" var="nick_name" notnull="notnull" minlength="1" maxlength="40" /> <column name="nick_name" var="nick_name" notnull="notnull" minlength="1" maxlength="40" />
<column name="email_address" var="email_address" filter="email" maxlength="250" /> <column name="email_address" var="email_address" filter="email" maxlength="250" />
<column name="homepage" var="homepage" filter="homepage" maxlength="250" /> <column name="homepage" var="homepage" filter="homepage" maxlength="250" />
<column name="uploaded_count" var="uploaded_count" default="0" /> <column name="uploaded_count" var="uploaded_count" default="0" />
<column name="last_update" var="last_update" default="curdate()" /> <column name="last_update" var="last_update" default="curdate()" />
<column name="ipaddress" var="ipaddress" default="ipaddress()" /> <column name="ipaddress" var="ipaddress" default="ipaddress()" />
</columns> </columns>
<conditions> <conditions>
<condition operation="equal" column="comment_srl" var="comment_srl" filter="number" notnull="notnull" /> <condition operation="equal" column="comment_srl" var="comment_srl" filter="number" notnull="notnull" />
</conditions> </conditions>
</query> </query>

View file

@ -1,19 +1,19 @@
<table name="comments"> <table name="comments">
<column name="comment_srl" type="number" size="11" notnull="notnull" primary_key="primary_key" /> <column name="comment_srl" type="number" size="11" notnull="notnull" primary_key="primary_key" />
<column name="module_srl" type="number" size="11" default="0" notnull="notnull" index="idx_module_srl" /> <column name="module_srl" type="number" size="11" default="0" notnull="notnull" index="idx_module_srl" />
<column name="document_srl" type="number" size="11" default="0" notnull="notnull" index="idx_document_srl" /> <column name="document_srl" type="number" size="11" default="0" notnull="notnull" index="idx_document_srl" />
<column name="parent_srl" type="number" size="11" default="0" notnull="notnull" /> <column name="parent_srl" type="number" size="11" default="0" notnull="notnull" />
<column name="is_secret" type="char" size="1" default="N" notnull="notnull" /> <column name="is_secret" type="char" size="1" default="N" notnull="notnull" />
<column name="content" type="bigtext" notnull="notnull" /> <column name="content" type="bigtext" notnull="notnull" />
<column name="password" type="varchar" size="60" /> <column name="password" type="varchar" size="60" />
<column name="user_name" type="varchar" size="80" notnull="notnull" /> <column name="user_name" type="varchar" size="80" notnull="notnull" />
<column name="nick_name" type="varchar" size="80" notnull="notnull" /> <column name="nick_name" type="varchar" size="80" notnull="notnull" />
<column name="member_srl" type="number" size="11" notnull="notnull" index="idx_member_srl" /> <column name="member_srl" type="number" size="11" notnull="notnull" index="idx_member_srl" />
<column name="email_address" type="varchar" size="250" notnull="notnull" /> <column name="email_address" type="varchar" size="250" notnull="notnull" />
<column name="homepage" type="varchar" size="250" notnull="notnull" /> <column name="homepage" type="varchar" size="250" notnull="notnull" />
<column name="uploaded_count" type="number" size="11" default="0" notnull="notnull" index="idx_uploaded_count" /> <column name="uploaded_count" type="number" size="11" default="0" notnull="notnull" index="idx_uploaded_count" />
<column name="regdate" type="date" index="idx_regdate" /> <column name="regdate" type="date" index="idx_regdate" />
<column name="last_update" type="date" index="idx_last_update" /> <column name="last_update" type="date" index="idx_last_update" />
<column name="ipaddress" type="varchar" size="128" notnull="notnull" index="idx_ipaddress"/> <column name="ipaddress" type="varchar" size="128" notnull="notnull" index="idx_ipaddress"/>
<column name="list_order" type="number" size="11" notnull="notnull" index="idx_list_order" /> <column name="list_order" type="number" size="11" notnull="notnull" index="idx_list_order" />
</table> </table>