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

View file

@ -13,6 +13,29 @@
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 코멘트의 권한 부여
* 세션값으로 접속상태에서만 사용 가능
@ -206,27 +229,5 @@
$output = $oDB->executeQuery('comment.deleteModuleComments', $args);
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 목록 출력 (관리자용)
**/
function dispList() {
function dispCommentAdminList() {
// 목록을 구하기 위한 옵션
$args->page = Context::get('page'); ///< 페이지
$args->list_count = 50; ///< 한페이지에 보여줄 글 수

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">comment</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">comment</description>
<description xml:lang="ko">게시판이나 블로그등의 댓글을 관리하는 모듈입니다.</description>
</author>
</module>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,19 +1,19 @@
<table name="comments">
<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="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="is_secret" type="char" size="1" default="N" notnull="notnull" />
<column name="content" type="bigtext" notnull="notnull" />
<column name="password" type="varchar" size="60" />
<column name="user_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="email_address" 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="regdate" type="date" index="idx_regdate" />
<column name="last_update" type="date" index="idx_last_update" />
<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="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="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="is_secret" type="char" size="1" default="N" notnull="notnull" />
<column name="content" type="bigtext" notnull="notnull" />
<column name="password" type="varchar" size="60" />
<column name="user_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="email_address" 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="regdate" type="date" index="idx_regdate" />
<column name="last_update" type="date" index="idx_last_update" />
<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" />
</table>