mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-22 20:59:55 +09:00
#17763731 : Added a feature, comment, to wiki
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5842 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
b386bd7c44
commit
173955e8f9
19 changed files with 566 additions and 1 deletions
|
|
@ -24,6 +24,8 @@
|
|||
<action name="dispWikiContent" type="view" index="true" />
|
||||
<action name="dispWikiEditPage" type="view" />
|
||||
<action name="dispWikiTitleIndex" type="view" />
|
||||
<action name="dispWikiReplyComment" type="view" />
|
||||
<action name="dispWikiModifyComment" type="view" />
|
||||
<action name="dispWikiAdminContent" type="view" standalone="true" admin_index="true" />
|
||||
<action name="dispWikiAdminInsertWiki" type="view" standalone="true" />
|
||||
<action name="dispWikiAdminGrantInfo" type="view" standalone="true" />
|
||||
|
|
@ -33,5 +35,7 @@
|
|||
<action name="dispWikiAdminDeleteWiki" type="view" standalone="true" />
|
||||
<action name="procWikiAdminDeleteWiki" type="controller" standalone="true" />
|
||||
<action name="procWikiInsertDocument" type="controller" standalone="true" />
|
||||
<action name="procWikiInsertComment" type="controller" standalone="true" />
|
||||
<action name="procWikiDeleteComment" type="controller" standalone="true" />
|
||||
</actions>
|
||||
</module>
|
||||
|
|
|
|||
|
|
@ -10,4 +10,6 @@
|
|||
$lang->cmd_create = '문서 생성';
|
||||
$lang->cmd_wiki_list = '목록';
|
||||
$lang->cmd_view_info = '위키 정보';
|
||||
$lang->use_comment = '댓글 사용';
|
||||
$lang->about_use_comment = '댓글을 활성화하거나 비활성화할 수 있습니다';
|
||||
?>
|
||||
|
|
|
|||
105
modules/wiki/skins/xe_wiki/comment.html
Normal file
105
modules/wiki/skins/xe_wiki/comment.html
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
<!--@if($oDocument->getCommentCount())-->
|
||||
<div class="replyBox">
|
||||
|
||||
{@ $_comment_list = $oDocument->getComments() }
|
||||
{@ debugPrint($oDocument) }
|
||||
<!--@foreach($_comment_list as $key => $comment)-->
|
||||
|
||||
<div class="replyItem <!--@if($comment->get('depth'))-->reply<!--@end-->">
|
||||
<!--@if($comment->get('depth'))-->
|
||||
<div style="margin-left:{($comment->get('depth')-1)*20}px" class="replyIndent">
|
||||
<!--@end-->
|
||||
|
||||
<a name="comment_{$comment->comment_srl}"></a>
|
||||
|
||||
<div class="replyOption">
|
||||
<!--@if($comment->isGranted() || !$comment->get('member_srl'))-->
|
||||
<a href="{getUrl('act','dispWikiDeleteComment','comment_srl',$comment->comment_srl)}"><img src="./images/common/buttonDeleteX.gif" alt="{$lang->cmd_delete}" width="12" height="13" /></a>
|
||||
<a href="{getUrl('act','dispWikiModifyComment','comment_srl',$comment->comment_srl)}"><img src="./images/{$module_info->colorset}/buttonModifyE.gif" alt="{$lang->cmd_modify}" width="20" height="17" /></a>
|
||||
<!--@end-->
|
||||
<a href="{getUrl('act','dispWikiReplyComment','comment_srl',$comment->comment_srl)}"><img src="./images/{$module_info->colorset}/buttonReply.gif" alt="{$lang->cmd_reply}" width="20" height="17" /></a>
|
||||
</div>
|
||||
|
||||
<div class="date">
|
||||
|
||||
<strong>{$comment->getRegdate('Y.m.d')}</strong> {$comment->getRegdate('H:i:s')}
|
||||
<!--@if($grant->manager|| $module_info->display_ip_address!='N')-->({$comment->getIpaddress()})<!--@end-->
|
||||
</div>
|
||||
|
||||
<div class="author">
|
||||
<!--@if(!$comment->member_srl)-->
|
||||
<!--@if($comment->homepage)-->
|
||||
<a href="{$comment->homepage}" onclick="window.open(this.href);return false;">{$comment->getNickName()}</a>
|
||||
<!--@else-->
|
||||
{$comment->getNickName()}
|
||||
<!--@end-->
|
||||
<!--@else-->
|
||||
<div class="member_{$comment->member_srl}">{$comment->getNickName()}</div>
|
||||
<!--@end-->
|
||||
</div>
|
||||
|
||||
<!--@if($comment->get('voted_count')!=0 || $comment->get('blamed_count') != 0)-->
|
||||
<div class="voted">
|
||||
({$lang->voted_count}:
|
||||
<strong>{$comment->get('voted_count')?$comment->get('voted_count'):0}</strong> / <strong>{$comment->get('blamed_count')?$comment->get('blamed_count'):0}</strong>)
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="replyContent">
|
||||
<!--@if(!$comment->isAccessible())-->
|
||||
<div class="secretContent">
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, input_password)">
|
||||
<input type="hidden" name="mid" value="{$mid}" />
|
||||
<input type="hidden" name="page" value="{$page}" />
|
||||
<input type="hidden" name="document_srl" value="{$comment->get('document_srl')}" />
|
||||
<input type="hidden" name="comment_srl" value="{$comment->get('comment_srl')}" />
|
||||
<div class="title">{$lang->msg_is_secret}</div>
|
||||
<div class="content"><input type="password" name="password" class="inputTypeText" /><span class="button {$btn_class}"><input type="submit" value="{$lang->cmd_input}" accesskey="s" /></span></div>
|
||||
</form>
|
||||
</div>
|
||||
<!--@else-->
|
||||
<!--@if($comment->getProfileImage())-->
|
||||
<img src="{$comment->getProfileImage()}" alt="profile" class="commentProfileImage" />
|
||||
<!--@end-->
|
||||
{$comment->getContent(true)}
|
||||
<!--@end-->
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<!--@if($comment->hasUploadedFIles())-->
|
||||
<div class="fileAttached">
|
||||
<ul>
|
||||
{@ $_uploaded_files = $comment->getUploadedFiles() }
|
||||
<!--@foreach($_uploaded_files as $key => $file)-->
|
||||
<li><a href="{getUrl('')}{$file->download_url}">{$file->source_filename} ({FileHandler::filesize($file->file_size)})({number_format($file->download_count)})</a></li>
|
||||
<!--@end-->
|
||||
</ul>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
||||
<!--@if($comment->get('depth'))-->
|
||||
</div>
|
||||
<!--@end-->
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
||||
<!-- 댓글 페이지 네비게이션 -->
|
||||
<!--@if($oDocument->comment_page_navigation)-->
|
||||
<div class="pagination a1">
|
||||
<a href="{getUrl('cpage',1)}#comment" class="prevEnd">{$lang->first_page}</a>
|
||||
<!--@while($page_no = $oDocument->comment_page_navigation->getNextPage())-->
|
||||
<!--@if($cpage == $page_no)-->
|
||||
<strong>{$page_no}</strong>
|
||||
<!--@else-->
|
||||
<a href="{getUrl('cpage',$page_no)}#comment">{$page_no}</a>
|
||||
<!--@end-->
|
||||
<!--@end-->
|
||||
<a href="{getUrl('cpage',$oDocument->comment_page_navigation->last_page)}#comment" class="nextEnd">{$lang->last_page}</a>
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
||||
</div>
|
||||
<!--@end-->
|
||||
66
modules/wiki/skins/xe_wiki/comment_form.html
Normal file
66
modules/wiki/skins/xe_wiki/comment_form.html
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<!--#include("header.html")-->
|
||||
|
||||
<!--// 만약 댓글의 답을 다는 것이라면 원문 보여줌 -->
|
||||
<!--@if($oSourceComment->isExists())-->
|
||||
<div class="replyBox">
|
||||
<div class="replyItem">
|
||||
<div class="author"><div class="member_{$oSourceComment->getMemberSrl()}">{$oSourceComment->getNickName()}</div></div>
|
||||
<div class="date">
|
||||
{$oSourceComment->getRegdate("Y.m.d H:i")}
|
||||
<!--@if($grant->manager)-->
|
||||
({$oSourceComment->get('ipaddress')})
|
||||
<!--@end-->
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="replyContent gap1">
|
||||
{$oSourceComment->getContent(false)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
||||
<!-- 글쓰기 폼 -->
|
||||
<form action="./" method="post" onsubmit="return procFilter(this, insert_comment)" class="boardEditor" >
|
||||
<input type="hidden" name="mid" value="{$mid}" />
|
||||
<input type="hidden" name="document_srl" value="{$oComment->get('document_srl')}" />
|
||||
<input type="hidden" name="comment_srl" value="{$oComment->get('comment_srl')}" />
|
||||
<input type="hidden" name="content" value="{htmlspecialchars($oComment->get('content'))}" />
|
||||
<input type="hidden" name="parent_srl" value="{$oComment->get('parent_srl')}" />
|
||||
|
||||
<div class="boardWrite commentEditor">
|
||||
|
||||
<div class="userNameAndPw">
|
||||
<!--@if(!$is_logged)-->
|
||||
<label for="userName">{$lang->writer}</label>
|
||||
<input type="text" name="nick_name" value="{$oComment->get('nick_name')}" class="userName inputTypeText" id="userName"/>
|
||||
|
||||
<label for="userPw">{$lang->password}</label>
|
||||
<input type="password" name="password" value="" id="userPw" class="userPw inputTypeText" />
|
||||
|
||||
<label for="emailAddress">{$lang->email_address}</label>
|
||||
<input type="text" name="email_address" value="{htmlspecialchars($oComment->get('email_address'))}" id="emailAddress" class="emailAddress inputTypeText"/>
|
||||
|
||||
<label for="homePage">{$lang->homepage}</label>
|
||||
<input type="text" name="homepage" value="{htmlspecialchars($oComment->get('homepage'))}" id="homePage" class="homePage inputTypeText"/>
|
||||
<!--@else-->
|
||||
<input type="checkbox" name="notify_message" value="Y" <!--@if($oComment->useNotify())-->checked="checked"<!--@end--> id="notify_message" />
|
||||
<label for="notify_message">{$lang->notify}</label>
|
||||
<!--@end-->
|
||||
<!--@if($module_info->secret=="Y")-->
|
||||
<input type="checkbox" name="is_secret" value="Y" <!--@if($oComment->isSecret())-->checked="checked"<!--@end--> id="is_secret" />
|
||||
<label for="is_secret">{$lang->secret}</label>
|
||||
<!--@end-->
|
||||
</div>
|
||||
|
||||
<div class="editor">{$oComment->getEditor()}</div>
|
||||
</div>
|
||||
|
||||
<div class="commentButton tRight">
|
||||
<span class="button {$btn_class}"><input type="button" value="{$lang->cmd_back}" onclick="location.href='{getUrl('act','')}'"/></span>
|
||||
<span class="button {$btn_class}"><input type="submit" value="{$lang->cmd_comment_registration}" accesskey="s" /></span>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<!--#include("footer.html")-->
|
||||
23
modules/wiki/skins/xe_wiki/delete_comment_form.html
Normal file
23
modules/wiki/skins/xe_wiki/delete_comment_form.html
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<!--#include("header.html")-->
|
||||
|
||||
<div class="smallBox w268">
|
||||
|
||||
<div class="header">
|
||||
<h3>{$lang->confirm_delete}</h3>
|
||||
</div>
|
||||
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, delete_comment)">
|
||||
<input type="hidden" name="mid" value="{$mid}" />
|
||||
<input type="hidden" name="page" value="{$page}" />
|
||||
<input type="hidden" name="document_srl" value="{$oComment->get('document_srl')}" />
|
||||
<input type="hidden" name="comment_srl" value="{$oComment->get('comment_srl')}" />
|
||||
|
||||
<div class="inputPassword tCenter">
|
||||
<span class="button {$btn_class}"><input type="submit" value="{$lang->cmd_delete}" accesskey="s" /></span>
|
||||
<a href="{getUrl('act','','comment_srl','')}" class="button {$btn_class}"><span>{$lang->cmd_cancel}</span></a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!--#include("footer.html")-->
|
||||
|
|
@ -1,4 +1,7 @@
|
|||
<!--%import("css/wiki.css")-->
|
||||
<!--@if(!$module_info->colorset)-->
|
||||
{@$module_info->colorset = "white"}
|
||||
<!--@end-->
|
||||
<div class="wikimain">
|
||||
<div class="header">
|
||||
<!--@if($oDocument)-->
|
||||
|
|
|
|||
BIN
modules/wiki/skins/xe_wiki/images/white/buttonModifyE.gif
Normal file
BIN
modules/wiki/skins/xe_wiki/images/white/buttonModifyE.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 407 B |
BIN
modules/wiki/skins/xe_wiki/images/white/buttonReply.gif
Normal file
BIN
modules/wiki/skins/xe_wiki/images/white/buttonReply.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 400 B |
16
modules/wiki/skins/xe_wiki/message.html
Normal file
16
modules/wiki/skins/xe_wiki/message.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<!--#include("header.html")-->
|
||||
|
||||
<div class="smallBox w268">
|
||||
|
||||
<div class="tCenter messageBox">{$message}</div>
|
||||
|
||||
<div class="gap1 tCenter">
|
||||
<!--@if(!$is_logged)-->
|
||||
<a href="{getUrl('act','dispMemberLoginForm')}" class="button {$btn_class}"><span>{$lang->cmd_login}</span></a>
|
||||
<!--@end-->
|
||||
<a href="#" onclick="history.back(); return false;" class="button {$btn_class}"><span>{$lang->cmd_back}</span></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!--#include("footer.html")-->
|
||||
26
modules/wiki/skins/xe_wiki/trackback.html
Normal file
26
modules/wiki/skins/xe_wiki/trackback.html
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<!-- 엮인글 목록 -->
|
||||
|
||||
<div class="trackbackBox">
|
||||
|
||||
<div class="trackbackUrl"><a name="trackback" href="{$oDocument->getTrackbackUrl()}" onclick="return false;">{$lang->trackback_url} : {$oDocument->getTrackbackUrl()}</a><div class="clear"></div></div>
|
||||
|
||||
<!--@if($oDocument->getTrackbackCount())-->
|
||||
<!--@foreach($oDocument->getTrackbacks() as $key => $val)-->
|
||||
<div class="trackbackItem">
|
||||
<a name="trackback_{$val->trackback_srl}"></a>
|
||||
<address>
|
||||
<a href="{$val->url}" onclick="winopen(this.href);return false;">{htmlspecialchars($val->title)} - {htmlspecialchars($val->blog_name)}</a>
|
||||
<a href="{getUrl('act','dispBoardDeleteTrackback','trackback_srl',$val->trackback_srl)}"><img src="./images/common/buttonDeleteX.gif" border="0" alt="delete" width="12" height="13" /></a>
|
||||
<span class="date">
|
||||
{zdate($val->regdate, "Y.m.d H:i")}
|
||||
({$val->ipaddress})
|
||||
</span>
|
||||
</address>
|
||||
<div>
|
||||
<a href="{$val->url}" onclick="winopen(this.href);return false;">{$val->excerpt}</a>
|
||||
</div>
|
||||
</div>
|
||||
<!--@end-->
|
||||
<!--@end-->
|
||||
|
||||
</div>
|
||||
|
|
@ -53,4 +53,55 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 엮인글 -->
|
||||
<!--@if($oDocument->allowTrackback())-->
|
||||
<!--#include("./trackback.html")-->
|
||||
<!--@end-->
|
||||
|
||||
|
||||
<!--@if($module_info->use_comment != 'N')-->
|
||||
<!-- 댓글 -->
|
||||
<a name="comment"></a>
|
||||
<!--#include("./comment.html")-->
|
||||
<!-- 댓글 입력 폼 -->
|
||||
<!--@if($grant->write_comment && $oDocument->isEnableComment() )-->
|
||||
<form action="./" method="post" onsubmit="return procFilter(this, insert_comment)" class="boardEditor" >
|
||||
<input type="hidden" name="mid" value="{$mid}" />
|
||||
<input type="hidden" name="document_srl" value="{$oDocument->document_srl}" />
|
||||
<input type="hidden" name="comment_srl" value="" />
|
||||
<input type="hidden" name="content" value="" />
|
||||
<div class="boardWrite commentEditor">
|
||||
<div class="userNameAndPw">
|
||||
<!--@if(!$is_logged)-->
|
||||
<label for="userName">{$lang->writer}</label>
|
||||
<input type="text" name="nick_name" value="" class="userName inputTypeText" id="userName"/>
|
||||
|
||||
<label for="userPw">{$lang->password}</label>
|
||||
<input type="password" name="password" value="" id="userPw" class="userPw inputTypeText" />
|
||||
|
||||
<label for="emailAddress">{$lang->email_address}</label>
|
||||
<input type="text" name="email_address" value="" id="emailAddress" class="emailAddress inputTypeText"/>
|
||||
|
||||
<label for="homePage">{$lang->homepage}</label>
|
||||
<input type="text" name="homepage" value="" id="homePage" class="homePage inputTypeText"/>
|
||||
<!--@else-->
|
||||
<input type="checkbox" name="notify_message" value="Y" id="notify_message" />
|
||||
<label for="notify_message">{$lang->notify}</label>
|
||||
<!--@end-->
|
||||
<!--@if($module_info->secret=="Y")-->
|
||||
<input type="checkbox" name="is_secret" value="Y" id="is_secret" />
|
||||
<label for="is_secret">{$lang->secret}</label>
|
||||
<!--@end-->
|
||||
</div>
|
||||
|
||||
<div class="editor">{$oDocument->getCommentEditor()}</div>
|
||||
</div>
|
||||
|
||||
<div class="commentButton tRight">
|
||||
<span class="button {$btn_class}"><input type="submit" value="{$lang->cmd_comment_registration}" accesskey="s" /></span>
|
||||
</div>
|
||||
</form>
|
||||
<!--@end-->
|
||||
<!--@end-->
|
||||
<!--#include("footer.html")-->
|
||||
|
|
|
|||
18
modules/wiki/tpl/filter/delete_comment.xml
Normal file
18
modules/wiki/tpl/filter/delete_comment.xml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<filter name="delete_comment" module="wiki" act="procWikiDeleteComment">
|
||||
<form>
|
||||
<node target="comment_srl" required="true" />
|
||||
</form>
|
||||
<parameter>
|
||||
<param name="mid" target="mid" />
|
||||
<param name="page" target="page" />
|
||||
<param name="document_srl" target="document_srl" />
|
||||
<param name="comment_srl" target="comment_srl" />
|
||||
</parameter>
|
||||
<response callback_func="completeDeleteComment">
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
<tag name="mid" />
|
||||
<tag name="document_srl" />
|
||||
<tag name="page" />
|
||||
</response>
|
||||
</filter>
|
||||
30
modules/wiki/tpl/filter/insert_comment.xml
Normal file
30
modules/wiki/tpl/filter/insert_comment.xml
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<filter name="insert_comment" module="wiki" act="procWikiInsertComment" confirm_msg_code="confirm_submit">
|
||||
<form>
|
||||
<node target="document_srl" required="true" />
|
||||
<node target="nick_name" required="true" />
|
||||
<node target="password" required="true" />
|
||||
<node target="email_address" maxlength="250" />
|
||||
<node target="homepage" maxlength="250"/>
|
||||
<node target="content" required="true" minlength="1" />
|
||||
</form>
|
||||
<parameter>
|
||||
<param name="mid" target="mid" />
|
||||
<param name="document_srl" target="document_srl" />
|
||||
<param name="comment_srl" target="comment_srl" />
|
||||
<param name="parent_srl" target="parent_srl" />
|
||||
<param name="nick_name" target="nick_name" />
|
||||
<param name="password" target="password" />
|
||||
<param name="email_address" target="email_address" />
|
||||
<param name="homepage" target="homepage" />
|
||||
<param name="content" target="content" />
|
||||
<param name="is_secret" target="is_secret" />
|
||||
<param name="notify_message" target="notify_message" />
|
||||
</parameter>
|
||||
<response callback_func="completeInsertComment">
|
||||
<tag name="error" />
|
||||
<tag name="message" />
|
||||
<tag name="mid" />
|
||||
<tag name="document_srl" />
|
||||
<tag name="comment_srl" />
|
||||
</response>
|
||||
</filter>
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
<param name="description" target="description" />
|
||||
<param name="header_text" target="header_text" />
|
||||
<param name="footer_text" target="footer_text" />
|
||||
<param name="use_comment" target="use_comment" />
|
||||
</parameter>
|
||||
<response callback_func="completeInsertWiki">
|
||||
<tag name="error" />
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<!--@else-->
|
||||
<li><a href="{getUrl('act','')}">{$lang->cmd_back}</a></li>
|
||||
<!--@end-->
|
||||
<li <!--@if($act=='dispWikiAdminWikiInfo'||$act=='dispWikiAdminInsertWiki')-->class="on"<!--@end-->><a href="{getUrl('act','dispWikiAdminWikiInfo')}">{$lang->cmd_view_info}</a></li>
|
||||
<li <!--@if($act=='dispWikiAdminWikiInfo'||$act=='dispWikiAdminInsertWiki')-->class="on"<!--@end-->><a href="{getUrl('act','dispWikiAdminInsertWiki')}">{$lang->cmd_view_info}</a></li>
|
||||
<li <!--@if($act=='dispWikiAdminGrantInfo')-->class="on"<!--@end-->><a href="{getUrl('act','dispWikiAdminGrantInfo')}">{$lang->cmd_manage_grant}</a></li>
|
||||
<li <!--@if($act=='dispWikiAdminWikiAdditionSetup')-->class="on"<!--@end-->><a href="{getUrl('act','dispWikiAdminWikiAdditionSetup')}">{$lang->cmd_addition_setup}</a></li>
|
||||
<li <!--@if($act=='dispWikiAdminSkinInfo')-->class="on"<!--@end-->><a href="{getUrl('act','dispWikiAdminSkinInfo')}">{$lang->cmd_manage_skin}</a></li>
|
||||
|
|
|
|||
|
|
@ -38,6 +38,16 @@
|
|||
<p>{$lang->about_module_category}</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->use_comment}</div></th>
|
||||
<td>
|
||||
<select name="use_comment">
|
||||
<option value="N" <!--@if($module_info->use_comment=='N')-->selected="selected"<!--@end--> >{$lang->notuse}</option>
|
||||
<option value="Y" <!--@if($module_info->use_comment!='N')-->selected="selected"<!--@end--> >{$lang->use}</option>
|
||||
</select>
|
||||
<p>{$lang->about_use_comment}</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->browser_title}</div></th>
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@
|
|||
$args = Context::getRequestVars();
|
||||
$args->module = 'wiki';
|
||||
$args->mid = $args->wiki_name;
|
||||
if($args->use_comment!='N') $args->use_comment = 'Y';
|
||||
|
||||
unset($args->wiki_name);
|
||||
if($args->module_srl) {
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl);
|
||||
|
|
|
|||
|
|
@ -13,6 +13,15 @@
|
|||
// 글작성시 필요한 변수를 세팅
|
||||
$obj = Context::getRequestVars();
|
||||
$obj->module_srl = $this->module_srl;
|
||||
if($this->module_info->use_comment != 'N')
|
||||
{
|
||||
$obj->allow_comment = 'Y';
|
||||
}
|
||||
else
|
||||
{
|
||||
$obj->allow_comment = 'N';
|
||||
}
|
||||
|
||||
if(!$obj->nick_name) $obj->nick_name = "anonymous";
|
||||
if($obj->is_notice!='Y'||!$this->grant->manager) $obj->is_notice = 'N';
|
||||
|
||||
|
|
@ -53,6 +62,98 @@
|
|||
// 성공 메세지 등록
|
||||
$this->setMessage($msg_code);
|
||||
}
|
||||
|
||||
function procWikiInsertComment() {
|
||||
// 권한 체크
|
||||
if(!$this->grant->write_comment) return new Object(-1, 'msg_not_permitted');
|
||||
|
||||
// 댓글 입력에 필요한 데이터 추출
|
||||
$obj = Context::gets('document_srl','comment_srl','parent_srl','content','password','nick_name','nick_name','member_srl','email_address','homepage','is_secret','notify_message');
|
||||
$obj->module_srl = $this->module_srl;
|
||||
|
||||
// 원글이 존재하는지 체크
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($obj->document_srl);
|
||||
if(!$oDocument->isExists()) return new Object(-1,'msg_not_permitted');
|
||||
|
||||
// comment 모듈의 model 객체 생성
|
||||
$oCommentModel = &getModel('comment');
|
||||
|
||||
// comment 모듈의 controller 객체 생성
|
||||
$oCommentController = &getController('comment');
|
||||
|
||||
// comment_srl이 존재하는지 체크
|
||||
// 만일 comment_srl이 n/a라면 getNextSequence()로 값을 얻어온다.
|
||||
if(!$obj->comment_srl) {
|
||||
$obj->comment_srl = getNextSequence();
|
||||
} else {
|
||||
$comment = $oCommentModel->getComment($obj->comment_srl, $this->grant->manager);
|
||||
}
|
||||
|
||||
// comment_srl이 없을 경우 신규 입력
|
||||
if($comment->comment_srl != $obj->comment_srl) {
|
||||
|
||||
// parent_srl이 있으면 답변으로
|
||||
if($obj->parent_srl) {
|
||||
$parent_comment = $oCommentModel->getComment($obj->parent_srl);
|
||||
if(!$parent_comment->comment_srl) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
$output = $oCommentController->insertComment($obj);
|
||||
|
||||
// 없으면 신규
|
||||
} else {
|
||||
$output = $oCommentController->insertComment($obj);
|
||||
}
|
||||
|
||||
// 문제가 없고 모듈 설정에 관리자 메일이 등록되어 있으면 메일 발송
|
||||
if($output->toBool() && $this->module_info->admin_mail) {
|
||||
$oMail = new Mail();
|
||||
$oMail->setTitle($oDocument->getTitleText());
|
||||
$oMail->setContent( sprintf("From : <a href=\"%s#comment_%d\">%s#comment_%d</a><br/>\r\n%s", $oDocument->getPermanentUrl(), $obj->comment_srl, $oDocument->getPermanentUrl(), $obj->comment_srl, $obj->content));
|
||||
$oMail->setSender($obj->user_name, $obj->email_address);
|
||||
|
||||
$target_mail = explode(',',$this->module_info->admin_mail);
|
||||
for($i=0;$i<count($target_mail);$i++) {
|
||||
$email_address = trim($target_mail[$i]);
|
||||
if(!$email_address) continue;
|
||||
$oMail->setReceiptor($email_address, $email_address);
|
||||
$oMail->send();
|
||||
}
|
||||
}
|
||||
|
||||
// comment_srl이 있으면 수정으로
|
||||
} else {
|
||||
$obj->parent_srl = $comment->parent_srl;
|
||||
$output = $oCommentController->updateComment($obj, $this->grant->manager);
|
||||
$comment_srl = $obj->comment_srl;
|
||||
}
|
||||
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->setMessage('success_registed');
|
||||
$this->add('mid', Context::get('mid'));
|
||||
$this->add('document_srl', $obj->document_srl);
|
||||
$this->add('comment_srl', $obj->comment_srl);
|
||||
}
|
||||
|
||||
function procWikiDeleteComment() {
|
||||
// check the comment's sequence number
|
||||
debugPrint('here');
|
||||
$comment_srl = Context::get('comment_srl');
|
||||
if(!$comment_srl) return $this->doError('msg_invalid_request');
|
||||
|
||||
// create controller object of comment module
|
||||
$oCommentController = &getController('comment');
|
||||
|
||||
$output = $oCommentController->deleteComment($comment_srl, $this->grant->manager);
|
||||
debugPrint($output);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->add('mid', Context::get('mid'));
|
||||
$this->add('page', Context::get('page'));
|
||||
$this->add('document_srl', $output->get('document_srl'));
|
||||
$this->setMessage('success_deleted');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -172,5 +172,112 @@
|
|||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 댓글의 답글 화면 출력
|
||||
**/
|
||||
function dispWikiReplyComment() {
|
||||
// 권한 체크
|
||||
if(!$this->grant->write_comment) return $this->dispWikiMessage('msg_not_permitted');
|
||||
|
||||
// 목록 구현에 필요한 변수들을 가져온다
|
||||
$parent_srl = Context::get('comment_srl');
|
||||
|
||||
// 지정된 원 댓글이 없다면 오류
|
||||
if(!$parent_srl) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
// 해당 댓글를 찾아본다
|
||||
$oCommentModel = &getModel('comment');
|
||||
$oSourceComment = $oCommentModel->getComment($parent_srl, $this->grant->manager);
|
||||
|
||||
// 댓글이 없다면 오류
|
||||
if(!$oSourceComment->isExists()) return $this->dispWikiMessage('msg_invalid_request');
|
||||
if(Context::get('document_srl') && $oSourceComment->get('document_srl') != Context::get('document_srl')) return $this->dispWikiMessage('msg_invalid_request');
|
||||
|
||||
// 대상 댓글을 생성
|
||||
$oComment = $oCommentModel->getComment();
|
||||
$oComment->add('parent_srl', $parent_srl);
|
||||
$oComment->add('document_srl', $oSourceComment->get('document_srl'));
|
||||
|
||||
// 필요한 정보들 세팅
|
||||
Context::set('oSourceComment',$oSourceComment);
|
||||
Context::set('oComment',$oComment);
|
||||
|
||||
/**
|
||||
* 사용되는 javascript 필터 추가
|
||||
**/
|
||||
Context::addJsFilter($this->module_path.'tpl/filter', 'insert_comment.xml');
|
||||
|
||||
$this->setTemplateFile('comment_form');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 댓글 수정 폼 출력
|
||||
**/
|
||||
function dispWikiModifyComment() {
|
||||
// 권한 체크
|
||||
if(!$this->grant->write_comment) return $this->dispWikiMessage('msg_not_permitted');
|
||||
|
||||
// 목록 구현에 필요한 변수들을 가져온다
|
||||
$document_srl = Context::get('document_srl');
|
||||
$comment_srl = Context::get('comment_srl');
|
||||
|
||||
// 지정된 댓글이 없다면 오류
|
||||
if(!$comment_srl) return new Object(-1, 'msg_invalid_request');
|
||||
|
||||
// 해당 댓글를 찾아본다
|
||||
$oCommentModel = &getModel('comment');
|
||||
$oComment = $oCommentModel->getComment($comment_srl, $this->grant->manager);
|
||||
|
||||
// 댓글이 없다면 오류
|
||||
if(!$oComment->isExists()) return $this->dispWikiMessage('msg_invalid_request');
|
||||
|
||||
// 글을 수정하려고 할 경우 권한이 없는 경우 비밀번호 입력화면으로
|
||||
if(!$oComment->isGranted()) return $this->setTemplateFile('input_password_form');
|
||||
|
||||
// 필요한 정보들 세팅
|
||||
Context::set('oSourceComment', $oCommentModel->getComment());
|
||||
Context::set('oComment', $oComment);
|
||||
|
||||
/**
|
||||
* 사용되는 javascript 필터 추가
|
||||
**/
|
||||
Context::addJsFilter($this->module_path.'tpl/filter', 'insert_comment.xml');
|
||||
|
||||
$this->setTemplateFile('comment_form');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 댓글 삭제 화면 출력
|
||||
**/
|
||||
function dispWikiDeleteComment() {
|
||||
// 권한 체크
|
||||
if(!$this->grant->write_comment) return $this->dispWikiMessage('msg_not_permitted');
|
||||
|
||||
// 삭제할 댓글번호를 가져온다
|
||||
$comment_srl = Context::get('comment_srl');
|
||||
|
||||
// 삭제하려는 댓글이 있는지 확인
|
||||
if($comment_srl) {
|
||||
$oCommentModel = &getModel('comment');
|
||||
$oComment = $oCommentModel->getComment($comment_srl, $this->grant->manager);
|
||||
}
|
||||
|
||||
// 삭제하려는 글이 없으면 에러
|
||||
if(!$oComment->isExists() ) return $this->dispWikiContent();
|
||||
|
||||
// 권한이 없는 경우 비밀번호 입력화면으로
|
||||
if(!$oComment->isGranted()) return $this->setTemplateFile('input_password_form');
|
||||
|
||||
Context::set('oComment',$oComment);
|
||||
|
||||
/**
|
||||
* 필요한 필터 추가
|
||||
**/
|
||||
Context::addJsFilter($this->module_path.'tpl/filter', 'delete_comment.xml');
|
||||
|
||||
$this->setTemplateFile('delete_comment_form');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue