mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-17 10:19:55 +09:00
merge from 1.7.3.5(r13153:r13167)
git-svn-id: http://xe-core.googlecode.com/svn/trunk@13168 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
cc47d2b247
commit
2d3f149b5a
2042 changed files with 129266 additions and 126243 deletions
|
|
@ -1,47 +1,52 @@
|
|||
<?php
|
||||
/**
|
||||
* commentAdminController class
|
||||
* admin controller class of the comment module
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/comment
|
||||
* @version 0.1
|
||||
*/
|
||||
class commentAdminController extends comment {
|
||||
|
||||
/**
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* commentAdminController class
|
||||
* admin controller class of the comment module
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/comment
|
||||
* @version 0.1
|
||||
*/
|
||||
class commentAdminController extends comment
|
||||
{
|
||||
|
||||
/**
|
||||
* Modify comment(s) status to publish/unpublish if calling module is using Comment Approval System
|
||||
* @return void
|
||||
*/
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify comment(s) status to publish/unpublish if calling module is using Comment Approval System
|
||||
* @return void
|
||||
*/
|
||||
function procCommentAdminChangePublishedStatusChecked()
|
||||
{ // Error display if none is selected
|
||||
{
|
||||
// Error display if none is selected
|
||||
$cart = Context::get('cart');
|
||||
if(!is_array($cart))
|
||||
{
|
||||
$comment_srl_list= explode('|@|', $cart);
|
||||
$comment_srl_list = explode('|@|', $cart);
|
||||
}
|
||||
else
|
||||
{
|
||||
$comment_srl_list = $cart;
|
||||
}
|
||||
|
||||
|
||||
$this->procCommentAdminChangeStatus();
|
||||
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_keyword', '');
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Change comment status
|
||||
* @return void|object
|
||||
*/
|
||||
* Change comment status
|
||||
* @return void|object
|
||||
*/
|
||||
function procCommentAdminChangeStatus()
|
||||
{
|
||||
$will_publish = Context::get('will_publish');
|
||||
|
|
@ -54,13 +59,14 @@
|
|||
}
|
||||
if(!is_array($cart))
|
||||
{
|
||||
$comment_srl_list= explode('|@|', $cart);
|
||||
$comment_srl_list = explode('|@|', $cart);
|
||||
}
|
||||
else
|
||||
{
|
||||
$comment_srl_list = $cart;
|
||||
}
|
||||
|
||||
$args = new stdClass();
|
||||
$args->status = $will_publish;
|
||||
$args->comment_srls_list = $comment_srl_list;
|
||||
$output = executeQuery('comment.updatePublishedStatus', $args);
|
||||
|
|
@ -68,75 +74,83 @@
|
|||
{
|
||||
return $output;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
//update comment count for document
|
||||
$updated_documents_arr = array();
|
||||
// create the controller object of the document
|
||||
$oDocumentController = &getController('document');
|
||||
$oDocumentController = getController('document');
|
||||
// create the model object of the document
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocumentModel = getModel('document');
|
||||
// create the comment model object
|
||||
$oCommentModel = &getModel('comment');
|
||||
$oCommentModel = getModel('comment');
|
||||
//get admin info
|
||||
$logged_info = Context::get('logged_info');
|
||||
//$oMemberModule = &getModel("member");
|
||||
//$oMemberModule = getModel("member");
|
||||
//$logged_info = $oMemberModule->getMemberInfoByMemberSrl($logged_member_srl);
|
||||
$new_status = ($will_publish) ? "published" : "unpublished";
|
||||
foreach($comment_srl_list as $comment_srl)
|
||||
{
|
||||
// check if comment already exists
|
||||
$comment = $oCommentModel->getComment($comment_srl);
|
||||
if($comment->comment_srl != $comment_srl) return new Object(-1, 'msg_invalid_request');
|
||||
if($comment->comment_srl != $comment_srl)
|
||||
{
|
||||
return new Object(-1, 'msg_invalid_request');
|
||||
}
|
||||
$document_srl = $comment->document_srl;
|
||||
if (!in_array($document_srl,$updated_documents_arr))
|
||||
if(!in_array($document_srl, $updated_documents_arr))
|
||||
{
|
||||
$updated_documents_arr[] = $document_srl;
|
||||
// update the number of comments
|
||||
$comment_count = $oCommentModel->getCommentCount($document_srl);
|
||||
// update comment count of the article posting
|
||||
$output = $oDocumentController->updateCommentCount($document_srl, $comment_count, null, false);
|
||||
$output = $oDocumentController->updateCommentCount($document_srl, $comment_count, NULL, FALSE);
|
||||
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
$author_email=$oDocument->variables['email_address'];
|
||||
$author_email = $oDocument->variables['email_address'];
|
||||
|
||||
$oModuleModel = &getModel("module");
|
||||
$oModuleModel = getModel("module");
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($comment->module_srl);
|
||||
$already_sent = array();
|
||||
|
||||
// send email to comment's author, all admins and thread(document) subscribers - START
|
||||
// -------------------------------------------------------
|
||||
$oMail = new Mail();
|
||||
$mail_title = "[XE - ".$module_info->mid."] comment(s) status changed to ".$new_status." on document: \"".$oDocument->getTitleText()."\"";
|
||||
$mail_title = "[XE - " . $module_info->mid . "] comment(s) status changed to " . $new_status . " on document: \"" . $oDocument->getTitleText() . "\"";
|
||||
$oMail->setTitle($mail_title);
|
||||
$mail_content = "
|
||||
The comment #".$comment_srl." on document \"".$oDocument->getTitleText()."\" has been ".$new_status." by admin of <strong><i>". strtoupper($module_info->mid)."</i></strong> module.
|
||||
The comment #" . $comment_srl . " on document \"" . $oDocument->getTitleText() . "\" has been " . $new_status . " by admin of <strong><i>" . strtoupper($module_info->mid) . "</i></strong> module.
|
||||
<br />
|
||||
<br />Comment content:
|
||||
".$comment->content."
|
||||
" . $comment->content . "
|
||||
<br />
|
||||
";
|
||||
";
|
||||
$oMail->setContent($mail_content);
|
||||
$oMail->setSender($logged_info->user_name, $logged_info->email_address);
|
||||
|
||||
$document_author_email = $oDocument->variables['email_address'];
|
||||
|
||||
//mail to author of thread - START
|
||||
if($document_author_email != $comment->email_address && $logged_info->email_address != $document_author_email) {
|
||||
$oMail->setReceiptor($document_author_email, $document_author_email);
|
||||
$oMail->send();
|
||||
$already_sent[] = $document_author_email;
|
||||
if($document_author_email != $comment->email_address && $logged_info->email_address != $document_author_email)
|
||||
{
|
||||
$oMail->setReceiptor($document_author_email, $document_author_email);
|
||||
$oMail->send();
|
||||
$already_sent[] = $document_author_email;
|
||||
}
|
||||
//mail to author of thread - STOP
|
||||
|
||||
//mail to all emails set for administrators - START
|
||||
if($module_info->admin_mail)
|
||||
{
|
||||
$target_mail = explode(',',$module_info->admin_mail);
|
||||
for($i=0;$i<count($target_mail);$i++) {
|
||||
$target_mail = explode(',', $module_info->admin_mail);
|
||||
for($i = 0; $i < count($target_mail); $i++)
|
||||
{
|
||||
$email_address = trim($target_mail[$i]);
|
||||
if(!$email_address) continue;
|
||||
if($author_email != $email_address) {
|
||||
if(!$email_address)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if($author_email != $email_address)
|
||||
{
|
||||
$oMail->setReceiptor($email_address, $email_address);
|
||||
$oMail->send();
|
||||
}
|
||||
|
|
@ -148,229 +162,308 @@
|
|||
// send email to comment's author, all admins and thread(document) subscribers - STOP
|
||||
}
|
||||
// call a trigger for calling "send mail to subscribers" (for moment just for forum)
|
||||
ModuleHandler::triggerCall("comment.procCommentAdminChangeStatus","after",$comment_srl_list);
|
||||
ModuleHandler::triggerCall("comment.procCommentAdminChangeStatus", "after", $comment_srl_list);
|
||||
}
|
||||
|
||||
|
||||
// for message send - start
|
||||
$message_content = Context::get('message_content');
|
||||
if($message_content)
|
||||
{
|
||||
$message_content = nl2br($message_content);
|
||||
}
|
||||
|
||||
if($message_content)
|
||||
{
|
||||
$this->_sendMessageForComment($message_content, $comment_srl_list);
|
||||
}
|
||||
// for message send - end
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the selected comment from the administrator page
|
||||
* @return void
|
||||
*/
|
||||
function procCommentAdminDeleteChecked() {
|
||||
$isTrash = Context::get('is_trash');
|
||||
|
||||
// Error display if none is selected
|
||||
$cart = Context::get('cart');
|
||||
if(!$cart) return $this->stop('msg_cart_is_null');
|
||||
if(!is_array($cart)) $comment_srl_list= explode('|@|', $cart);
|
||||
else $comment_srl_list = $cart;
|
||||
$comment_count = count($comment_srl_list);
|
||||
if(!$comment_count) return $this->stop('msg_cart_is_null');
|
||||
/**
|
||||
* Delete the selected comment from the administrator page
|
||||
* @return void
|
||||
*/
|
||||
function procCommentAdminDeleteChecked()
|
||||
{
|
||||
$isTrash = Context::get('is_trash');
|
||||
|
||||
$oCommentController = &getController('comment');
|
||||
// begin transaction
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
// Error display if none is selected
|
||||
$cart = Context::get('cart');
|
||||
if(!$cart)
|
||||
{
|
||||
return $this->stop('msg_cart_is_null');
|
||||
}
|
||||
if(!is_array($cart))
|
||||
{
|
||||
$comment_srl_list = explode('|@|', $cart);
|
||||
}
|
||||
else
|
||||
{
|
||||
$comment_srl_list = $cart;
|
||||
}
|
||||
$comment_count = count($comment_srl_list);
|
||||
if(!$comment_count)
|
||||
{
|
||||
return $this->stop('msg_cart_is_null');
|
||||
}
|
||||
|
||||
// for message send - start
|
||||
$message_content = Context::get('message_content');
|
||||
if($message_content) $message_content = nl2br($message_content);
|
||||
$oCommentController = getController('comment');
|
||||
// begin transaction
|
||||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
if($message_content) {
|
||||
$oCommunicationController = &getController('communication');
|
||||
$oCommentModel = &getModel('comment');
|
||||
// for message send - start
|
||||
$message_content = Context::get('message_content');
|
||||
if($message_content)
|
||||
{
|
||||
$message_content = nl2br($message_content);
|
||||
}
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($message_content)
|
||||
{
|
||||
$this->_sendMessageForComment($message_content, $comment_srl_list);
|
||||
}
|
||||
// for message send - end
|
||||
// comment into trash
|
||||
if($isTrash == 'true')
|
||||
{
|
||||
$this->_moveCommentToTrash($comment_srl_list, $oCommentController, $oDB, $message_content);
|
||||
}
|
||||
|
||||
$title = cut_str($message_content,10,'...');
|
||||
$sender_member_srl = $logged_info->member_srl;
|
||||
|
||||
for($i=0;$i<$comment_count;$i++) {
|
||||
$comment_srl = $comment_srl_list[$i];
|
||||
$oComment = $oCommentModel->getComment($comment_srl, true);
|
||||
|
||||
if(!$oComment->get('member_srl') || $oComment->get('member_srl')==$sender_member_srl) continue;
|
||||
|
||||
$content = sprintf("<div>%s</div><hr /><div style=\"font-weight:bold\">%s</div>",$message_content, $oComment->getContentText(20));
|
||||
|
||||
$oCommunicationController->sendMessage($sender_member_srl, $oComment->get('member_srl'), $title, $content, false);
|
||||
}
|
||||
$deleted_count = 0;
|
||||
// Delete the comment posting
|
||||
for($i = 0; $i < $comment_count; $i++)
|
||||
{
|
||||
$comment_srl = trim($comment_srl_list[$i]);
|
||||
if(!$comment_srl)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// for message send - end
|
||||
|
||||
// comment into trash
|
||||
if($isTrash == 'true') $this->_moveCommentToTrash($comment_srl_list, $oCommentController, $oDB);
|
||||
$output = $oCommentController->deleteComment($comment_srl, TRUE, $isTrash);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$deleted_count = 0;
|
||||
// Delete the comment posting
|
||||
for($i=0;$i<$comment_count;$i++) {
|
||||
$comment_srl = trim($comment_srl_list[$i]);
|
||||
if(!$comment_srl) continue;
|
||||
$deleted_count++;
|
||||
}
|
||||
|
||||
$output = $oCommentController->deleteComment($comment_srl, true, $isTrash);
|
||||
$oDB->commit();
|
||||
|
||||
$msgCode = '';
|
||||
if($isTrash == 'true')
|
||||
{
|
||||
$msgCode = 'success_trashed';
|
||||
}
|
||||
else
|
||||
{
|
||||
$msgCode = 'success_deleted';
|
||||
}
|
||||
//$this->setMessage( sprintf(Context::getLang('msg_checked_comment_is_deleted'), $deleted_count) );
|
||||
$this->setMessage($msgCode, 'info');
|
||||
|
||||
//set url params
|
||||
$search_keyword = Context::get('search_keyword');
|
||||
$search_target = Context::get('search_target');
|
||||
$page = Context::get('page');
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_keyword', $search_keyword, 'search_target', $search_target, 'page', $page);
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
private function _sendMessageForComment($message_content, $comment_srl_list)
|
||||
{
|
||||
$oCommunicationController = getController('communication');
|
||||
$oCommentModel = getModel('comment');
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
$title = cut_str($message_content, 10, '...');
|
||||
$sender_member_srl = $logged_info->member_srl;
|
||||
|
||||
$comment_count = count($comment_srl_list);
|
||||
for($i = 0; $i < $comment_count; $i++)
|
||||
{
|
||||
$comment_srl = $comment_srl_list[$i];
|
||||
$oComment = $oCommentModel->getComment($comment_srl, TRUE);
|
||||
|
||||
if(!$oComment->get('member_srl') || $oComment->get('member_srl') == $sender_member_srl)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$content = sprintf("<div>%s</div><hr /><div style=\"font-weight:bold\">%s</div>", $message_content, $oComment->getContentText(20));
|
||||
|
||||
$oCommunicationController->sendMessage($sender_member_srl, $oComment->get('member_srl'), $title, $content, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* comment move to trash
|
||||
* @return void|object
|
||||
*/
|
||||
function _moveCommentToTrash($commentSrlList, &$oCommentController, &$oDB, $message_content = NULL)
|
||||
{
|
||||
require_once(_XE_PATH_ . 'modules/trash/model/TrashVO.php');
|
||||
|
||||
if(is_array($commentSrlList))
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
$oCommentModel = getModel('comment');
|
||||
$commentItemList = $oCommentModel->getComments($commentSrlList);
|
||||
$oTrashAdminController = getAdminController('trash');
|
||||
|
||||
foreach($commentItemList AS $key => $oComment)
|
||||
{
|
||||
$oTrashVO = new TrashVO();
|
||||
$oTrashVO->setTrashSrl(getNextSequence());
|
||||
$oTrashVO->setTitle(trim(strip_tags($oComment->variables['content'])));
|
||||
$oTrashVO->setOriginModule('comment');
|
||||
$oTrashVO->setSerializedObject(serialize($oComment->variables));
|
||||
$oTrashVO->setDescription($message_content);
|
||||
|
||||
$output = $oTrashAdminController->insertTrash($oTrashVO);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$deleted_count ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$oDB->commit();
|
||||
/**
|
||||
* Cancel the blacklist of abused comments reported by other users
|
||||
* @return void|object
|
||||
*/
|
||||
function procCommentAdminCancelDeclare()
|
||||
{
|
||||
$comment_srl = trim(Context::get('comment_srl'));
|
||||
|
||||
$msgCode = '';
|
||||
if($isTrash == 'true') $msgCode = 'success_trashed';
|
||||
else $msgCode = 'success_deleted';
|
||||
//$this->setMessage( sprintf(Context::getLang('msg_checked_comment_is_deleted'), $deleted_count) );
|
||||
$this->setMessage($msgCode, 'info');
|
||||
|
||||
//set url params
|
||||
$search_keyword = Context::get('search_keyword');
|
||||
$search_target = Context::get('search_target');
|
||||
$page = Context::get('page');
|
||||
|
||||
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispCommentAdminList', 'search_keyword', $search_keyword, 'search_target', $search_target,'page',$page);
|
||||
$this->setRedirectUrl($returnUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* comment move to trash
|
||||
* @return void|object
|
||||
*/
|
||||
function _moveCommentToTrash($commentSrlList, &$oCommentController, &$oDB)
|
||||
if($comment_srl)
|
||||
{
|
||||
require_once(_XE_PATH_.'modules/trash/model/TrashVO.php');
|
||||
|
||||
if(is_array($commentSrlList))
|
||||
$args = new stdClass();
|
||||
$args->comment_srl = $comment_srl;
|
||||
$output = executeQuery('comment.deleteDeclaredComments', $args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$logged_info = Context::get('logged_info');
|
||||
$oCommentModel = &getModel('comment');
|
||||
$commentItemList = $oCommentModel->getComments($commentSrlList);
|
||||
$oTrashAdminController = &getAdminController('trash');
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach($commentItemList AS $key=>$oComment)
|
||||
/**
|
||||
* Comment add to _SESSION
|
||||
* @return void
|
||||
*/
|
||||
function procCommentAdminAddCart()
|
||||
{
|
||||
$comment_srl = (int) Context::get('comment_srl');
|
||||
|
||||
$oCommentModel = getModel('comment');
|
||||
$columnList = array('comment_srl');
|
||||
$commentSrlList = array($comment_srl);
|
||||
|
||||
$output = $oCommentModel->getComments($commentSrlList);
|
||||
|
||||
if(is_array($output))
|
||||
{
|
||||
foreach($output AS $key => $value)
|
||||
{
|
||||
if($_SESSION['comment_management'][$key])
|
||||
{
|
||||
$oTrashVO = new TrashVO();
|
||||
$oTrashVO->setTrashSrl(getNextSequence());
|
||||
$oTrashVO->setTitle(trim(strip_tags($oComment->variables['content'])));
|
||||
$oTrashVO->setOriginModule('comment');
|
||||
$oTrashVO->setSerializedObject(serialize($oComment->variables));
|
||||
|
||||
$output = $oTrashAdminController->insertTrash($oTrashVO);
|
||||
if (!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
unset($_SESSION['comment_management'][$key]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$_SESSION['comment_management'][$key] = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel the blacklist of abused comments reported by other users
|
||||
* @return void|object
|
||||
*/
|
||||
function procCommentAdminCancelDeclare() {
|
||||
$comment_srl = trim(Context::get('comment_srl'));
|
||||
|
||||
if($comment_srl) {
|
||||
$args->comment_srl = $comment_srl;
|
||||
$output = executeQuery('comment.deleteDeclaredComments', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Comment add to _SESSION
|
||||
* @return void
|
||||
*/
|
||||
function procCommentAdminAddCart()
|
||||
/**
|
||||
* Delete all comments of the specific module
|
||||
* @return object
|
||||
*/
|
||||
function deleteModuleComments($module_srl)
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQuery('comment.deleteModuleComments', $args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$comment_srl = (int)Context::get('comment_srl');
|
||||
|
||||
$oCommentModel = &getModel('comment');
|
||||
$columnList = array('comment_srl');
|
||||
$commentSrlList = array($comment_srl);
|
||||
|
||||
$output = $oCommentModel->getComments($commentSrlList);
|
||||
|
||||
if(is_array($output))
|
||||
{
|
||||
foreach($output AS $key=>$value)
|
||||
{
|
||||
if($_SESSION['comment_management'][$key]) unset($_SESSION['comment_management'][$key]);
|
||||
else $_SESSION['comment_management'][$key] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all comments of the specific module
|
||||
* @return object
|
||||
*/
|
||||
function deleteModuleComments($module_srl) {
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQuery('comment.deleteModuleComments', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$output = executeQuery('comment.deleteModuleCommentsList', $args);
|
||||
|
||||
//remove from cache
|
||||
$oCacheHandler = &CacheHandler::getInstance('object');
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
// Invalidate newest comments. Per document cache is invalidated inside document admin controller.
|
||||
$oCacheHandler->invalidateGroupKey('newestCommentsList');
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore comment from trash module, called by trash module
|
||||
* this method is passived
|
||||
* @return object
|
||||
*/
|
||||
function restoreTrash($originObject)
|
||||
{
|
||||
if(is_array($originObject)) $originObject = (object)$originObject;
|
||||
|
||||
$obj->document_srl = $originObject->document_srl;
|
||||
$obj->comment_srl = $originObject->comment_srl;
|
||||
$obj->parent_srl = $originObject->parent_srl;
|
||||
$obj->content = $originObject->content;
|
||||
$obj->password = $originObject->password;
|
||||
$obj->nick_name = $originObject->nick_name;
|
||||
$obj->member_srl = $originObject->member_srl;
|
||||
$obj->email_address = $originObject->email_address;
|
||||
$obj->homepage = $originObject->homepage;
|
||||
$obj->is_secret = $originObject->is_secret;
|
||||
$obj->notify_message = $originObject->notify_message;
|
||||
$obj->module_srl = $originObject->module_srl;
|
||||
|
||||
$oCommentController = &getController('comment');
|
||||
$output = $oCommentController->insertComment($obj);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Empty comment in trash, called by trash module
|
||||
* this method is passived
|
||||
* @return object
|
||||
*/
|
||||
function emptyTrash($originObject)
|
||||
$output = executeQuery('comment.deleteModuleCommentsList', $args);
|
||||
|
||||
//remove from cache
|
||||
$oCacheHandler = CacheHandler::getInstance('object');
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$originObject = unserialize($originObject);
|
||||
if(is_array($originObject)) $originObject = (object) $originObject;
|
||||
|
||||
$oComment = new commentItem();
|
||||
$oComment->setAttribute($originObject);
|
||||
|
||||
//already comment deleted, therefore only comment log delete
|
||||
$oCommentController = &getController('comment');
|
||||
$output = $oCommentController->deleteCommentLog($oComment->get('comment_srl'));
|
||||
return $output;
|
||||
// Invalidate newest comments. Per document cache is invalidated inside document admin controller.
|
||||
$oCacheHandler->invalidateGroupKey('newestCommentsList');
|
||||
}
|
||||
}
|
||||
?>
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore comment from trash module, called by trash module
|
||||
* this method is passived
|
||||
* @return object
|
||||
*/
|
||||
function restoreTrash($originObject)
|
||||
{
|
||||
if(is_array($originObject))
|
||||
{
|
||||
$originObject = (object) $originObject;
|
||||
}
|
||||
|
||||
$obj = new stdClass();
|
||||
$obj->document_srl = $originObject->document_srl;
|
||||
$obj->comment_srl = $originObject->comment_srl;
|
||||
$obj->parent_srl = $originObject->parent_srl;
|
||||
$obj->content = $originObject->content;
|
||||
$obj->password = $originObject->password;
|
||||
$obj->nick_name = $originObject->nick_name;
|
||||
$obj->member_srl = $originObject->member_srl;
|
||||
$obj->email_address = $originObject->email_address;
|
||||
$obj->homepage = $originObject->homepage;
|
||||
$obj->is_secret = $originObject->is_secret;
|
||||
$obj->notify_message = $originObject->notify_message;
|
||||
$obj->module_srl = $originObject->module_srl;
|
||||
|
||||
$oCommentController = getController('comment');
|
||||
$output = $oCommentController->insertComment($obj);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Empty comment in trash, called by trash module
|
||||
* this method is passived
|
||||
* @return object
|
||||
*/
|
||||
function emptyTrash($originObject)
|
||||
{
|
||||
$originObject = unserialize($originObject);
|
||||
if(is_array($originObject))
|
||||
{
|
||||
$originObject = (object) $originObject;
|
||||
}
|
||||
|
||||
$oComment = new commentItem();
|
||||
$oComment->setAttribute($originObject);
|
||||
|
||||
//already comment deleted, therefore only comment log delete
|
||||
$oCommentController = getController('comment');
|
||||
$output = $oCommentController->deleteCommentLog($oComment->get('comment_srl'));
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
/* End of file comment.admin.controller.php */
|
||||
/* Location: ./modules/comment/comment.admin.controller.php */
|
||||
|
|
|
|||
|
|
@ -1,105 +1,120 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* commentAdminView class
|
||||
* admin view class of the comment module
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/comment
|
||||
* @version 0.1
|
||||
*/
|
||||
class commentAdminView extends comment
|
||||
{
|
||||
|
||||
/**
|
||||
* commentAdminView class
|
||||
* admin view class of the comment module
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/comment
|
||||
* @version 0.1
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
class commentAdminView extends comment {
|
||||
/**
|
||||
* Initialization
|
||||
* @return void
|
||||
function init()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the list(for administrators)
|
||||
* @return void
|
||||
*/
|
||||
function dispCommentAdminList()
|
||||
{
|
||||
// option to get a list
|
||||
$args = new stdClass();
|
||||
$args->page = Context::get('page'); // /< Page
|
||||
$args->list_count = 30; // / the number of postings to appear on a single page
|
||||
$args->page_count = 5; // / the number of pages to appear on the page navigation
|
||||
|
||||
$args->sort_index = 'list_order'; // /< Sorting values
|
||||
|
||||
$args->module_srl = Context::get('module_srl');
|
||||
/*
|
||||
$search_target = Context::get('search_target');
|
||||
$search_keyword = Context::get('search_keyword');
|
||||
if ($search_target == 'is_published' && $search_keyword == 'Y')
|
||||
{
|
||||
$args->status = 1;
|
||||
}
|
||||
if ($search_target == 'is_published' && $search_keyword == 'N')
|
||||
{
|
||||
$args->status = 0;
|
||||
}
|
||||
*/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the list(for administrators)
|
||||
* @return void
|
||||
*/
|
||||
function dispCommentAdminList() {
|
||||
// option to get a list
|
||||
$args->page = Context::get('page'); // /< Page
|
||||
$args->list_count = 30; // / the number of postings to appear on a single page
|
||||
$args->page_count = 5; // / the number of pages to appear on the page navigation
|
||||
// get a list by using comment->getCommentList.
|
||||
$oCommentModel = getModel('comment');
|
||||
$secretNameList = $oCommentModel->getSecretNameList();
|
||||
$columnList = array('comment_srl', 'document_srl', 'is_secret', 'status', 'content', 'comments.member_srl', 'comments.nick_name', 'comments.regdate', 'ipaddress', 'voted_count', 'blamed_count');
|
||||
$output = $oCommentModel->getTotalCommentList($args, $columnList);
|
||||
|
||||
$args->sort_index = 'list_order'; // /< Sorting values
|
||||
$oCommentModel = getModel("comment");
|
||||
$modules = $oCommentModel->getDistinctModules();
|
||||
$modules_list = $modules;
|
||||
|
||||
$args->module_srl = Context::get('module_srl');
|
||||
/*
|
||||
$search_target = Context::get('search_target');
|
||||
$search_keyword = Context::get('search_keyword');
|
||||
if ($search_target == 'is_published' && $search_keyword == 'Y')
|
||||
// set values in the return object of comment_model:: getTotalCommentList() in order to use a template.
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('comment_list', $output->data);
|
||||
Context::set('modules_list', $modules_list);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
Context::set('secret_name_list', $secretNameList);
|
||||
// set the template
|
||||
$this->setTemplatePath($this->module_path . 'tpl');
|
||||
$this->setTemplateFile('comment_list');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the blacklist of comments in the admin page
|
||||
* @return void
|
||||
*/
|
||||
function dispCommentAdminDeclared()
|
||||
{
|
||||
// option to get a blacklist
|
||||
$args = new stdClass();
|
||||
$args->page = Context::get('page'); // /< Page
|
||||
$args->list_count = 30; // /< the number of comment postings to appear on a single page
|
||||
$args->page_count = 10; // /< the number of pages to appear on the page navigation
|
||||
|
||||
$args->sort_index = 'comment_declared.declared_count'; // /< sorting values
|
||||
$args->order_type = 'desc'; // /< sorted value
|
||||
// get a list
|
||||
$declared_output = executeQuery('comment.getDeclaredList', $args);
|
||||
$oCommentModel = getModel('comment');
|
||||
|
||||
if($declared_output->data && count($declared_output->data))
|
||||
{
|
||||
$comment_list = array();
|
||||
|
||||
foreach($declared_output->data as $key => $comment)
|
||||
{
|
||||
$args->status = 1;
|
||||
$comment_list[$key] = new commentItem();
|
||||
$comment_list[$key]->setAttribute($comment);
|
||||
}
|
||||
if ($search_target == 'is_published' && $search_keyword == 'N')
|
||||
{
|
||||
$args->status = 0;
|
||||
}
|
||||
*/
|
||||
|
||||
// get a list by using comment->getCommentList.
|
||||
$oCommentModel = &getModel('comment');
|
||||
$secretNameList = $oCommentModel->getSecretNameList();
|
||||
$columnList = array('comment_srl', 'document_srl', 'is_secret', 'status', 'content', 'comments.member_srl', 'comments.nick_name', 'comments.regdate', 'ipaddress', 'voted_count', 'blamed_count');
|
||||
$output = $oCommentModel->getTotalCommentList($args, $columnList);
|
||||
|
||||
$oCommentModel = &getModel("comment");
|
||||
$modules = $oCommentModel->getDistinctModules();
|
||||
$modules_list = $modules;
|
||||
|
||||
// set values in the return object of comment_model:: getTotalCommentList() in order to use a template.
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('comment_list', $output->data);
|
||||
Context::set('modules_list', $modules_list);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
Context::set('secret_name_list', $secretNameList);
|
||||
// set the template
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('comment_list');
|
||||
}
|
||||
$declared_output->data = $comment_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the blacklist of comments in the admin page
|
||||
* @return void
|
||||
*/
|
||||
function dispCommentAdminDeclared() {
|
||||
// option to get a blacklist
|
||||
$args->page = Context::get('page'); // /< Page
|
||||
$args->list_count = 30; // /< the number of comment postings to appear on a single page
|
||||
$args->page_count = 10; // /< the number of pages to appear on the page navigation
|
||||
$secretNameList = $oCommentModel->getSecretNameList();
|
||||
|
||||
$args->sort_index = 'comment_declared.declared_count'; // /< sorting values
|
||||
$args->order_type = 'desc'; // /< sorted value
|
||||
// set values in the return object of comment_model:: getCommentList() in order to use a template.
|
||||
Context::set('total_count', $declared_output->total_count);
|
||||
Context::set('total_page', $declared_output->total_page);
|
||||
Context::set('page', $declared_output->page);
|
||||
Context::set('comment_list', $declared_output->data);
|
||||
Context::set('page_navigation', $declared_output->page_navigation);
|
||||
Context::set('secret_name_list', $secretNameList);
|
||||
// set the template
|
||||
$this->setTemplatePath($this->module_path . 'tpl');
|
||||
$this->setTemplateFile('declared_list');
|
||||
}
|
||||
|
||||
// get a list
|
||||
$declared_output = executeQuery('comment.getDeclaredList', $args);
|
||||
|
||||
if($declared_output->data && count($declared_output->data)) {
|
||||
$comment_list = array();
|
||||
|
||||
$oCommentModel = &getModel('comment');
|
||||
foreach($declared_output->data as $key => $comment) {
|
||||
$comment_list[$key] = new commentItem();
|
||||
$comment_list[$key]->setAttribute($comment);
|
||||
}
|
||||
$declared_output->data = $comment_list;
|
||||
}
|
||||
|
||||
// set values in the return object of comment_model:: getCommentList() in order to use a template.
|
||||
Context::set('total_count', $declared_output->total_count);
|
||||
Context::set('total_page', $declared_output->total_page);
|
||||
Context::set('page', $declared_output->page);
|
||||
Context::set('comment_list', $declared_output->data);
|
||||
Context::set('page_navigation', $declared_output->page_navigation);
|
||||
// set the template
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('declared_list');
|
||||
}
|
||||
}
|
||||
?>
|
||||
}
|
||||
/* End of file comment.admin.view.php */
|
||||
/* Location: ./modules/comment/comment.admin.view.php */
|
||||
|
|
|
|||
|
|
@ -1,151 +1,191 @@
|
|||
<?php
|
||||
require_once(_XE_PATH_.'modules/comment/comment.item.php');
|
||||
|
||||
require_once(_XE_PATH_ . 'modules/comment/comment.item.php');
|
||||
|
||||
/**
|
||||
* comment
|
||||
* comment module's high class
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/comment
|
||||
* @version 0.1
|
||||
*/
|
||||
class comment extends ModuleObject
|
||||
{
|
||||
|
||||
/**
|
||||
* comment
|
||||
* comment module's high class
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/comment
|
||||
* @version 0.1
|
||||
* Implemented if additional tasks are required when installing
|
||||
* @return Object
|
||||
*/
|
||||
class comment extends ModuleObject {
|
||||
/**
|
||||
* Implemented if additional tasks are required when installing
|
||||
* @return Object
|
||||
*/
|
||||
function moduleInstall() {
|
||||
$oDB = &DB::getInstance();
|
||||
function moduleInstall()
|
||||
{
|
||||
$oDB = DB::getInstance();
|
||||
|
||||
// register the action forward (for using on the admin mode)
|
||||
$oModuleController = &getController('module');
|
||||
// register the action forward (for using on the admin mode)
|
||||
$oModuleController = getController('module');
|
||||
|
||||
$oDB->addIndex
|
||||
(
|
||||
"comments",
|
||||
"idx_module_list_order",
|
||||
array("module_srl", "list_order"),
|
||||
true
|
||||
);
|
||||
$oDB->addIndex(
|
||||
"comments", "idx_module_list_order", array("module_srl", "list_order"), TRUE
|
||||
);
|
||||
|
||||
// 2007. 10. 17 add a trigger to delete comments together with posting deleted
|
||||
$oModuleController->insertTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after');
|
||||
// 2007. 10. 17 add a trigger to delete all of comments together with module deleted
|
||||
$oModuleController->insertTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after');
|
||||
// 2008. 02. 22 add comment setting when a new module added
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before');
|
||||
// 2007. 10. 17 add a trigger to delete comments together with posting deleted
|
||||
$oModuleController->insertTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after');
|
||||
// 2007. 10. 17 add a trigger to delete all of comments together with module deleted
|
||||
$oModuleController->insertTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after');
|
||||
// 2008. 02. 22 add comment setting when a new module added
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to check if installation is succeeded
|
||||
* @return bool
|
||||
*/
|
||||
function checkUpdate() {
|
||||
$oDB = &DB::getInstance();
|
||||
$oModuleModel = &getModel('module');
|
||||
// 2007. 10. 17 add a trigger to delete comments together with posting deleted
|
||||
if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after')) return true;
|
||||
// 2007. 10. 17 add a trigger to delete all of comments together with module deleted
|
||||
if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after')) return true;
|
||||
// 2007. 10. 23 add a column for recommendation votes or notification of the comments
|
||||
if(!$oDB->isColumnExists("comments","voted_count")) return true;
|
||||
if(!$oDB->isColumnExists("comments","notify_message")) return true;
|
||||
// 2008. 02. 22 add comment setting when a new module added
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before')) return true;
|
||||
// 2008. 05. 14 add a column for blamed count
|
||||
if(!$oDB->isColumnExists("comments", "blamed_count")) return true;
|
||||
if(!$oDB->isColumnExists("comment_voted_log", "point")) return true;
|
||||
/**
|
||||
* Method to check if installation is succeeded
|
||||
* @return bool
|
||||
*/
|
||||
function checkUpdate()
|
||||
{
|
||||
$oDB = DB::getInstance();
|
||||
$oModuleModel = getModel('module');
|
||||
// 2007. 10. 17 add a trigger to delete comments together with posting deleted
|
||||
if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
// 2007. 10. 17 add a trigger to delete all of comments together with module deleted
|
||||
if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
// 2007. 10. 23 add a column for recommendation votes or notification of the comments
|
||||
if(!$oDB->isColumnExists("comments", "voted_count"))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
if(!$oDB->isColumnExists("comments", "notify_message"))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
// 2008. 02. 22 add comment setting when a new module added
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
// 2008. 05. 14 add a column for blamed count
|
||||
if(!$oDB->isColumnExists("comments", "blamed_count"))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
if(!$oDB->isColumnExists("comment_voted_log", "point"))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (!$oDB->isIndexExists("comments", "idx_module_list_order"))
|
||||
return true;
|
||||
//2012. 02. 24 add comment published status column and index
|
||||
if(!$oDB->isColumnExists("comments", "status"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!$oDB->isIndexExists("comments", "idx_status"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if(!$oDB->isIndexExists("comments", "idx_module_list_order"))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
//2012. 02. 24 add comment published status column and index
|
||||
if(!$oDB->isColumnExists("comments", "status"))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
if(!$oDB->isIndexExists("comments", "idx_status"))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after')) return true;
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute update
|
||||
* @return Object
|
||||
*/
|
||||
function moduleUpdate() {
|
||||
$oDB = &DB::getInstance();
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleController = &getController('module');
|
||||
// 2007. 10. 17 add a trigger to delete comments together with posting deleted
|
||||
if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
|
||||
$oModuleController->insertTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after');
|
||||
// 2007. 10. 17 add a trigger to delete all of comments together with module deleted
|
||||
if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
|
||||
$oModuleController->insertTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after');
|
||||
// 2007. 10. 23 add a column for recommendation votes or notification of the comments
|
||||
if(!$oDB->isColumnExists("comments","voted_count")) {
|
||||
$oDB->addColumn("comments","voted_count", "number","11");
|
||||
$oDB->addIndex("comments","idx_voted_count", array("voted_count"));
|
||||
}
|
||||
/**
|
||||
* Execute update
|
||||
* @return Object
|
||||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
$oDB = DB::getInstance();
|
||||
$oModuleModel = getModel('module');
|
||||
$oModuleController = getController('module');
|
||||
// 2007. 10. 17 add a trigger to delete comments together with posting deleted
|
||||
if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after');
|
||||
}
|
||||
// 2007. 10. 17 add a trigger to delete all of comments together with module deleted
|
||||
if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after');
|
||||
}
|
||||
// 2007. 10. 23 add a column for recommendation votes or notification of the comments
|
||||
if(!$oDB->isColumnExists("comments", "voted_count"))
|
||||
{
|
||||
$oDB->addColumn("comments", "voted_count", "number", "11");
|
||||
$oDB->addIndex("comments", "idx_voted_count", array("voted_count"));
|
||||
}
|
||||
|
||||
if(!$oDB->isColumnExists("comments","notify_message")) {
|
||||
$oDB->addColumn("comments","notify_message", "char","1");
|
||||
}
|
||||
// 2008. 02. 22 add comment setting when a new module added
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before');
|
||||
// 2008. 05. 14 add a column for blamed count
|
||||
if(!$oDB->isColumnExists("comments", "blamed_count")) {
|
||||
$oDB->addColumn('comments', 'blamed_count', 'number', 11, 0, true);
|
||||
$oDB->addIndex('comments', 'idx_blamed_count', array('blamed_count'));
|
||||
}
|
||||
if(!$oDB->isColumnExists("comment_voted_log", "point"))
|
||||
$oDB->addColumn('comment_voted_log', 'point', 'number', 11, 0, true);
|
||||
|
||||
if (!$oDB->isIndexExists("comments", "idx_module_list_order"))
|
||||
$oDB->addIndex
|
||||
(
|
||||
"comments",
|
||||
"idx_module_list_order",
|
||||
array("module_srl", "list_order"),
|
||||
true
|
||||
);
|
||||
if(!$oDB->isColumnExists("comments", "notify_message"))
|
||||
{
|
||||
$oDB->addColumn("comments", "notify_message", "char", "1");
|
||||
}
|
||||
// 2008. 02. 22 add comment setting when a new module added
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before');
|
||||
}
|
||||
// 2008. 05. 14 add a column for blamed count
|
||||
if(!$oDB->isColumnExists("comments", "blamed_count"))
|
||||
{
|
||||
$oDB->addColumn('comments', 'blamed_count', 'number', 11, 0, TRUE);
|
||||
$oDB->addIndex('comments', 'idx_blamed_count', array('blamed_count'));
|
||||
}
|
||||
if(!$oDB->isColumnExists("comment_voted_log", "point"))
|
||||
{
|
||||
$oDB->addColumn('comment_voted_log', 'point', 'number', 11, 0, TRUE);
|
||||
}
|
||||
|
||||
//2012. 02. 24 add comment published status column and index
|
||||
if(!$oDB->isColumnExists("comments", "status")) {
|
||||
$oDB->addColumn("comments", "status", "number", 1, 1, true);
|
||||
}
|
||||
if (!$oDB->isIndexExists("comments", "idx_status"))
|
||||
$oDB->addIndex
|
||||
(
|
||||
"comments",
|
||||
"idx_status",
|
||||
array("status", "comment_srl", "module_srl", "document_srl"),
|
||||
true
|
||||
);
|
||||
if(!$oDB->isIndexExists("comments", "idx_module_list_order"))
|
||||
{
|
||||
$oDB->addIndex(
|
||||
"comments", "idx_module_list_order", array("module_srl", "list_order"), TRUE
|
||||
);
|
||||
}
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after');
|
||||
}
|
||||
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
//2012. 02. 24 add comment published status column and index
|
||||
if(!$oDB->isColumnExists("comments", "status"))
|
||||
{
|
||||
$oDB->addColumn("comments", "status", "number", 1, 1, TRUE);
|
||||
}
|
||||
if(!$oDB->isIndexExists("comments", "idx_status"))
|
||||
{
|
||||
$oDB->addIndex(
|
||||
"comments", "idx_status", array("status", "comment_srl", "module_srl", "document_srl"), TRUE
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Regenerate cache file
|
||||
* @return void
|
||||
*/
|
||||
function recompileCache() {
|
||||
}
|
||||
}
|
||||
?>
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after');
|
||||
}
|
||||
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* Regenerate cache file
|
||||
* @return void
|
||||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
/* End of file comment.class.php */
|
||||
/* Location: ./modules/comment/comment.class.php */
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,49 +1,64 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* commentView class
|
||||
* comment module's view class
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/comment
|
||||
* @version 0.1
|
||||
*/
|
||||
class commentView extends comment
|
||||
{
|
||||
|
||||
/**
|
||||
* commentView class
|
||||
* comment module's view class
|
||||
*
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @package /modules/comment
|
||||
* @version 0.1
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
class commentView extends comment {
|
||||
/**
|
||||
* Initialization
|
||||
* @return void
|
||||
*/
|
||||
function init() {
|
||||
}
|
||||
function init()
|
||||
{
|
||||
|
||||
/**
|
||||
* Add a form fot comment setting on the additional setting of module
|
||||
* @param string $obj
|
||||
* @return string
|
||||
*/
|
||||
function triggerDispCommentAdditionSetup(&$obj) {
|
||||
$current_module_srl = Context::get('module_srl');
|
||||
$current_module_srls = Context::get('module_srls');
|
||||
}
|
||||
|
||||
if(!$current_module_srl && !$current_module_srls) {
|
||||
// get information of the selected module
|
||||
$current_module_info = Context::get('current_module_info');
|
||||
$current_module_srl = $current_module_info->module_srl;
|
||||
if(!$current_module_srl) return new Object();
|
||||
}
|
||||
// get the comment configuration
|
||||
$oCommentModel = &getModel('comment');
|
||||
$comment_config = $oCommentModel->getCommentConfig($current_module_srl);
|
||||
Context::set('comment_config', $comment_config);
|
||||
// get a group list
|
||||
$oMemberModel = &getModel('member');
|
||||
$group_list = $oMemberModel->getGroups();
|
||||
Context::set('group_list', $group_list);
|
||||
// Set a template file
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
$tpl = $oTemplate->compile($this->module_path.'tpl', 'comment_module_config');
|
||||
$obj .= $tpl;
|
||||
/**
|
||||
* Add a form fot comment setting on the additional setting of module
|
||||
* @param string $obj
|
||||
* @return string
|
||||
*/
|
||||
function triggerDispCommentAdditionSetup(&$obj)
|
||||
{
|
||||
$current_module_srl = Context::get('module_srl');
|
||||
$current_module_srls = Context::get('module_srls');
|
||||
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
?>
|
||||
if(!$current_module_srl && !$current_module_srls)
|
||||
{
|
||||
// get information of the selected module
|
||||
$current_module_info = Context::get('current_module_info');
|
||||
$current_module_srl = $current_module_info->module_srl;
|
||||
if(!$current_module_srl)
|
||||
{
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
|
||||
// get the comment configuration
|
||||
$oCommentModel = getModel('comment');
|
||||
$comment_config = $oCommentModel->getCommentConfig($current_module_srl);
|
||||
Context::set('comment_config', $comment_config);
|
||||
|
||||
// get a group list
|
||||
$oMemberModel = getModel('member');
|
||||
$group_list = $oMemberModel->getGroups();
|
||||
Context::set('group_list', $group_list);
|
||||
|
||||
// Set a template file
|
||||
$oTemplate = TemplateHandler::getInstance();
|
||||
$tpl = $oTemplate->compile($this->module_path . 'tpl', 'comment_module_config');
|
||||
$obj .= $tpl;
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
}
|
||||
/* End of file comment.view.php */
|
||||
/* Location: ./modules/comment/comment.view.php */
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@
|
|||
<title xml:lang="ru">Комментарии</title>
|
||||
<title xml:lang="zh-TW">回覆</title>
|
||||
<title xml:lang="tr">Yorum</title>
|
||||
<description xml:lang="ko">게시판이나 블로그등의 댓글을 관리하는 모듈입니다.</description>
|
||||
<description xml:lang="ko">게시판이나 블로그등의 댓글을 관리합니다.</description>
|
||||
<description xml:lang="jp">掲示板やブログなどのコメントを管理するモジュールです。</description>
|
||||
<description xml:lang="zh-CN">管理版面或博客评论的模块。</description>
|
||||
<description xml:lang="en">Module for managing board/blog's comments</description>
|
||||
<description xml:lang="en">Managing board/blog's comments</description>
|
||||
<description xml:lang="vi">Module quản lý bình luận của bài viết và sổ lưu niệm</description>
|
||||
<description xml:lang="es">Es el módulo para manejar commentarios en blog o boletínes.</description>
|
||||
<description xml:lang="ru">Модуль для управления комментариями форума/блога.</description>
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<lang>
|
||||
<item name="cmd_comment_do">
|
||||
<value xml:lang="ko"><![CDATA[이 댓글을...]]></value>
|
||||
<value xml:lang="ko"><![CDATA[이 댓글을]]></value>
|
||||
<value xml:lang="en"><![CDATA[I want to]]></value>
|
||||
<value xml:lang="jp"><![CDATA[このコメントを…]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[将把此评论..]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[將此回覆..]]></value>
|
||||
<value xml:lang="fr"><![CDATA[Vous voudriez...]]></value>
|
||||
<value xml:lang="ru"><![CDATA[Эту запись...]]></value>
|
||||
<value xml:lang="es"><![CDATA[Usted ...]]></value>
|
||||
<value xml:lang="fr"><![CDATA[Vous voudriez]]></value>
|
||||
<value xml:lang="ru"><![CDATA[Эту запись]]></value>
|
||||
<value xml:lang="es"><![CDATA[Usted ]]></value>
|
||||
<value xml:lang="tr"><![CDATA[Şunu yap]]></value>
|
||||
<value xml:lang="vi"><![CDATA[Bình chọn / Phê bình]]></value>
|
||||
</item>
|
||||
|
|
@ -251,11 +251,11 @@
|
|||
<item name="published_name_list" type="array">
|
||||
<item name="Y">
|
||||
<value xml:lang="en"><![CDATA[Published]]></value>
|
||||
<value xml:lang="ko"><![CDATA[공개 발행]]></value>
|
||||
<value xml:lang="ko"><![CDATA[발행완료]]></value>
|
||||
</item>
|
||||
<item name="N">
|
||||
<value xml:lang="en"><![CDATA[Unpublished]]></value>
|
||||
<value xml:lang="ko"><![CDATA[발행 대기]]></value>
|
||||
<value xml:lang="ko"><![CDATA[발행대기]]></value>
|
||||
</item>
|
||||
</item>
|
||||
<item name="comment_manager">
|
||||
|
|
@ -271,9 +271,11 @@
|
|||
<value xml:lang="zh-TW"><![CDATA[已選回覆]]></value>
|
||||
</item>
|
||||
<item name="cmd_comment_validation">
|
||||
<value xml:lang="ko"><![CDATA[승인 후 공개]]></value>
|
||||
<value xml:lang="en"><![CDATA[Use comment validation]]></value>
|
||||
</item>
|
||||
<item name="about_comment_validation">
|
||||
<value xml:lang="ko"><![CDATA[관리자 승인 후 댓글을 공개합니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[If you want to use comment validation before displaying on your module frontend select USE, otherwise select NOT USE.]]></value>
|
||||
</item>
|
||||
<item name="published">
|
||||
|
|
@ -296,4 +298,8 @@
|
|||
<value xml:lang="ko"><![CDATA[페이지]]></value>
|
||||
<value xml:lang="en"><![CDATA[Page]]></value>
|
||||
</item>
|
||||
<item name="msg_not_selected_comment">
|
||||
<value xml:lang="ko"><![CDATA[선택한 댓글이 없습니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[There are no selected comment.]]></value>
|
||||
</item>
|
||||
</lang>
|
||||
|
|
@ -24,6 +24,6 @@
|
|||
<column name="last_update" var="last_update" default="curdate()" />
|
||||
<column name="ipaddress" var="ipaddress" default="ipaddress()" />
|
||||
<column name="list_order" var="list_order" default="0" />
|
||||
<column name="status" var="status" notnull="notnull" default="1" />
|
||||
<column name="status" var="status" notnull="notnull" filter="number" />
|
||||
</columns>
|
||||
</query>
|
||||
|
|
|
|||
|
|
@ -1,97 +1,131 @@
|
|||
<!--#include("header.html")-->
|
||||
<script type="text/javascript">
|
||||
<include target="header.html" />
|
||||
<script>
|
||||
xe.lang.msg_empty_search_target = '{$lang->msg_empty_search_target}';
|
||||
xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
|
||||
</script>
|
||||
<load target="js/comment_admin.js" usecdn="true" />
|
||||
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/comment/tpl/comment_list/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
</div>
|
||||
<form id="fo_list" action="./" method="post" class="form">
|
||||
<h1 class="h1">{$lang->comment}</h1>
|
||||
<div class="table even">
|
||||
<div class="cnb">
|
||||
<a href="{getUrl('search_keyword','','act','dispCommentAdminList', 'Y')}" <!--@if($search_keyword == '')-->class="active"<!--@end-->>{$lang->all}</a>
|
||||
| <a href="{getUrl('search_target','is_secret','search_keyword', 'N')}" <!--@if($search_target == 'is_secret' && $search_keyword == 'N')-->class="active"<!--@end-->>{$secret_name_list['N']}</a>
|
||||
| <a href="{getUrl('search_target','is_secret','search_keyword', 'Y')}" <!--@if($search_target == 'is_secret' && $search_keyword == 'Y')-->class="active"<!--@end-->>{$secret_name_list['Y']}</a>
|
||||
| <a href="{getUrl('search_target','is_published','search_keyword', 'N')}" <!--@if($search_target == 'is_published' && $search_keyword == 'N')-->class="active"<!--@end-->>{$lang->published_name_list['N']}</a>
|
||||
| <a href="{getUrl('search_target','is_published','search_keyword', 'Y')}" <!--@if($search_target == 'is_published' && $search_keyword == 'Y')-->class="active"<!--@end-->>{$lang->published_name_list['Y']}</a>
|
||||
|
||||
<block cond="$modules_list">
|
||||
| <label for="comment_modules" <!--@if($search_target == 'module')-->class="active"<!--@end-->>{$lang->select_module}:
|
||||
<select id="comment_modules" name="comment_modules" onchange="location.href='{getUrl('search_target','module','search_keyword','')}&search_keyword='+this.value">
|
||||
<option></option>
|
||||
<!--@foreach($modules_list as $key => $node)-->
|
||||
<option value="{$key}"<!--@if($key==$search_keyword)-->selected<!--@end-->>{$node}</option>
|
||||
<!--@end-->
|
||||
</select></label>
|
||||
</block>
|
||||
</div>
|
||||
<table width="100%" border="1" cellspacing="0" id="commentListTable">
|
||||
<caption>
|
||||
<!--@if($search_keyword == '')-->
|
||||
{$lang->all}
|
||||
<!--@elseif($search_target == 'is_secret' && $search_keyword == 'N')-->
|
||||
{$secret_name_list['N']}
|
||||
<!--@elseif($search_target == 'is_secret' && $search_keyword == 'Y')-->
|
||||
{$secret_name_list['Y']}
|
||||
<!--@elseif($search_target == 'is_published' && $search_keyword == 'N')-->
|
||||
{$published_name_list['N']}
|
||||
<!--@elseif($search_target == 'is_published' && $search_keyword == 'Y')-->
|
||||
{$published_name_list['Y']}
|
||||
<!--@end-->
|
||||
({number_format($total_count)})
|
||||
<div class="side">
|
||||
<span class="btn"><a href="#listManager" class="modalAnchor" onclick="getCommentList();">{$lang->comment_manager}...</a></span>
|
||||
</div>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="text">{$lang->comment}</th>
|
||||
<th scope="col" class="nowr">{$lang->writer}</th>
|
||||
<th scope="col" class="nowr">{$lang->cmd_vote}(+/-)</th>
|
||||
<th scope="col" class="nowr">{$lang->date}</th>
|
||||
<th scope="col" class="nowr">{$lang->ipaddress}</th>
|
||||
<th scope="col" class="nowr">{$lang->status}</th>
|
||||
<th scope="col">{$lang->published}</th>
|
||||
<th scope="col"><input type="checkbox" data-name="cart" title="Check All" /></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th scope="col" class="text">{$lang->comment}</th>
|
||||
<th scope="col" class="nowr">{$lang->writer}</th>
|
||||
<th scope="col" class="nowr">{$lang->cmd_vote}(+/-)</th>
|
||||
<th scope="col" class="nowr">{$lang->date}</th>
|
||||
<th scope="col" class="nowr">{$lang->ipaddress}</th>
|
||||
<th scope="col" class="nowr">{$lang->status}</th>
|
||||
<th scope="col">{$lang->published}</th>
|
||||
<th scope="col"><input type="checkbox" data-name="cart" title="Check All" /></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<!--@foreach($comment_list as $no => $val)-->
|
||||
{@ $comment = cut_str(trim(strip_tags($val->content)), 200, '...')}
|
||||
<tr>
|
||||
<td class="text"><a href="{getUrl('','document_srl',$val->document_srl)}#comment_{$val->comment_srl}" target="_blank"><!--@if(strlen($comment))-->{$comment}<!--@else--><em>{$lang->no_text_comment}</em><!--@end--></a></td>
|
||||
<td class="nowr"><a href="#popup_menu_area" class="member_{$val->member_srl}">{$val->nick_name}</a></td>
|
||||
<td class="nowr">{number_format($val->get('voted_count'))}/{number_format($val->get('blamed_count'))}</td>
|
||||
<td class="nowr">{(zdate($val->regdate,"Y-m-d\nH:i:s"))}</td>
|
||||
<td class="nowr"><a href="{getUrl('search_target','ipaddress','search_keyword',$val->ipaddress)}">{$val->ipaddress}</a></td>
|
||||
<td class="nowr"><!--@if($val->isSecret())-->{$secret_name_list['Y']}<!--@else-->{$secret_name_list['N']}<!--@end--></td>
|
||||
<td class="nowr"><!--@if($val->status)-->{$lang->published_name_list['Y']}<!--@else-->{$lang->published_name_list['N']}<!--@end--></td>
|
||||
<td><input type="checkbox" name="cart" value="{$val->comment_srl}" /></td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="btnArea">
|
||||
<span class="btn"><a href="#listManager" class="modalAnchor" onclick="getCommentList();">{$lang->comment_manager}...</a></span>
|
||||
</div>
|
||||
<form id="fo_list" action="./" method="post">
|
||||
<table id="commentListTable" class="x_table x_table-striped x_table-hover">
|
||||
<caption>
|
||||
<a href="{getUrl('','module','admin','act','dispCommentAdminList','Y')}" class="active"|cond="$search_keyword == ''">{$lang->all}<block cond="$search_keyword == ''">({number_format($total_count)})</block></a>
|
||||
<i>|</i>
|
||||
<a href="{getUrl('search_target','is_secret','search_keyword','N')}" class="active"|cond="$search_target == 'is_secret' && $search_keyword == 'N'">{$secret_name_list['N']}<block cond="$search_target == 'is_secret' && $search_keyword == 'N'">({number_format($total_count)})</block></a>
|
||||
<i>|</i>
|
||||
<a href="{getUrl('search_target','is_secret','search_keyword','Y')}" class="active"|cond="$search_target == 'is_secret' && $search_keyword == 'Y'">{$secret_name_list['Y']}<block cond="$search_target == 'is_secret' && $search_keyword == 'Y'">({number_format($total_count)})</block></a>
|
||||
<i>|</i>
|
||||
<a href="{getUrl('search_target','is_published','search_keyword','N')}" class="active"|cond="$search_target == 'is_published' && $search_keyword == 'N'">{$lang->published_name_list['N']}<block cond="$search_target == 'is_published' && $search_keyword == 'N'">({number_format($total_count)})</block></a>
|
||||
<i>|</i>
|
||||
<a href="{getUrl('search_target','is_published','search_keyword','Y')}" class="active"|cond="$search_target == 'is_published' && $search_keyword == 'Y'">{$lang->published_name_list['Y']}<block cond="$search_target == 'is_published' && $search_keyword == 'Y'">({number_format($total_count)})</block></a>
|
||||
<i>|</i>
|
||||
<a href="{getUrl('', 'module', 'admin', 'act','dispCommentAdminDeclared')}">{$lang->cmd_declared_list}</a>
|
||||
<i cond="$search_target == 'ipaddress'">|</i>
|
||||
<a href="{getUrl('search_target', 'ipaddress')}" class="active" cond="$search_target == 'ipaddress'">{$lang->ipaddress}:{$search_keyword}({number_format($total_count)})</a>
|
||||
|
||||
<div class="x_btn-group x_pull-right">
|
||||
<a href="#listManager" class="x_btn modalAnchor" data-value="true" data-name="is_trash">{$lang->trash}</a>
|
||||
<a href="#listManager" class="x_btn modalAnchor" data-value="false" data-name="is_trash">{$lang->delete}</a>
|
||||
<a href="#listManager" class="x_btn modalAnchor" data-value="0" data-name="will_publish" cond="$search_target=='is_published' && $search_keyword=='Y'">{$lang->cmd_unpublish}</a>
|
||||
<a href="#listManager" class="x_btn modalAnchor" data-value="1" data-name="will_publish" cond="$search_target=='is_published' && $search_keyword=='N'">{$lang->cmd_publish}</a>
|
||||
<a href="#listManager" class="x_btn modalAnchor" data-value="0" data-name="will_publish" cond="$search_target!='is_published'">{$lang->cmd_unpublish}</a>
|
||||
<a href="#listManager" class="x_btn modalAnchor" data-value="1" data-name="will_publish" cond="$search_target!='is_published'">{$lang->cmd_publish}</a>
|
||||
</div>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{$lang->comment}</th>
|
||||
<th scope="col" class="nowr">{$lang->writer}</th>
|
||||
<th scope="col" class="nowr">{$lang->cmd_vote}(+/-)</th>
|
||||
<th scope="col" class="nowr">{$lang->date}</th>
|
||||
<th scope="col" class="nowr">{$lang->ipaddress}</th>
|
||||
<th scope="col" class="nowr">{$lang->status}</th>
|
||||
<th scope="col" class="nowr">{$lang->published}</th>
|
||||
<th scope="col"><input type="checkbox" data-name="cart" title="Check All" /></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr loop="$comment_list => $no, $val">
|
||||
{@ $comment = $val->getContentText(200)}
|
||||
<td><a href="{getUrl('','document_srl',$val->document_srl)}#comment_{$val->comment_srl}" target="_blank"><!--@if(strlen($comment))-->{$comment}<!--@else--><em>{$lang->no_text_comment}</em><!--@end--></a></td>
|
||||
<td class="nowr"><a href="#popup_menu_area" class="member_{$val->member_srl}">{$val->getNickName()}</a></td>
|
||||
<td class="nowr">{number_format($val->get('voted_count'))}/{number_format($val->get('blamed_count'))}</td>
|
||||
<td class="nowr">{(zdate($val->regdate,"Y-m-d\nH:i:s"))}</td>
|
||||
<td class="nowr"><a href="{getUrl('search_target','ipaddress','search_keyword',$val->ipaddress)}">{$val->ipaddress}</a></td>
|
||||
<td class="nowr"><!--@if($val->isSecret())-->{$secret_name_list['Y']}<!--@else-->{$secret_name_list['N']}<!--@end--></td>
|
||||
<td class="nowr"><!--@if($val->status)-->{$lang->published_name_list['Y']}<!--@else-->{$lang->published_name_list['N']}<!--@end--></td>
|
||||
<td><input type="checkbox" name="cart" value="{$val->comment_srl}" /></td>
|
||||
</tr>
|
||||
<tr cond="!$comment_list">
|
||||
<td>{$lang->no_documents}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="x_btn-group x_pull-right">
|
||||
<a href="#listManager" class="x_btn modalAnchor" data-value="true" data-name="is_trash">{$lang->trash}</a>
|
||||
<a href="#listManager" class="x_btn modalAnchor" data-value="false" data-name="is_trash">{$lang->delete}</a>
|
||||
<a href="#listManager" class="x_btn modalAnchor" data-value="0" data-name="will_publish" cond="$search_target=='is_published' && $search_keyword=='Y'">{$lang->cmd_unpublish}</a>
|
||||
<a href="#listManager" class="x_btn modalAnchor" data-value="1" data-name="will_publish" cond="$search_target=='is_published' && $search_keyword=='N'">{$lang->cmd_publish}</a>
|
||||
<a href="#listManager" class="x_btn modalAnchor" data-value="0" data-name="will_publish" cond="$search_target!='is_published'">{$lang->cmd_unpublish}</a>
|
||||
<a href="#listManager" class="x_btn modalAnchor" data-value="1" data-name="will_publish" cond="$search_target!='is_published'">{$lang->cmd_publish}</a>
|
||||
</div>
|
||||
</form>
|
||||
<div class="modal" id="listManager">
|
||||
<form ruleset="deleteChecked" action="./" method="post" class="fg form">
|
||||
|
||||
|
||||
<form action="./" class="x_pagination">
|
||||
<input type="hidden" name="error_return_url" value="" />
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<input cond="$search_keyword" type="hidden" name="search_keyword" value="{$search_keyword}" />
|
||||
<input cond="$search_target" type="hidden" name="search_target" value="{$search_target}" />
|
||||
<ul>
|
||||
<li class="x_disabled"|cond="!$page || $page == 1"><a href="{getUrl('page', '')}">« {$lang->first_page}</a></li>
|
||||
<block cond="$page_navigation->first_page != 1 && $page_navigation->first_page + $page_navigation->page_count > $page_navigation->last_page - 1 && $page_navigation->page_count != $page_navigation->total_page">
|
||||
{@$isGoTo = true}
|
||||
<li>
|
||||
<a href="#goTo" data-toggle title="{$lang->cmd_go_to_page}">…</a>
|
||||
<span cond="$isGoTo" id="goTo" class="x_input-append">
|
||||
<input type="number" min="1" max="{$page_navigation->last_page}" required name="page" title="{$lang->cmd_go_to_page}" />
|
||||
<button type="submit" class="x_add-on">Go</button>
|
||||
</span>
|
||||
</li>
|
||||
</block>
|
||||
|
||||
<!--@while($page_no = $page_navigation->getNextPage())-->
|
||||
{@$last_page = $page_no}
|
||||
<li class="x_active"|cond="$page_no == $page"><a href="{getUrl('page', $page_no)}">{$page_no}</a></li>
|
||||
<!--@end-->
|
||||
|
||||
<block cond="$last_page != $page_navigation->last_page && $last_page + 1 != $page_navigation->last_page">
|
||||
{@$isGoTo = true}
|
||||
<li>
|
||||
<a href="#goTo" data-toggle title="{$lang->cmd_go_to_page}">…</a>
|
||||
<span cond="$isGoTo" id="goTo" class="x_input-append">
|
||||
<input type="number" min="1" max="{$page_navigation->last_page}" required name="page" title="{$lang->cmd_go_to_page}" />
|
||||
<button type="submit" class="x_add-on">Go</button>
|
||||
</span>
|
||||
</li>
|
||||
</block>
|
||||
<li class="x_disabled"|cond="$page == $page_navigation->last_page"><a href="{getUrl('page', $page_navigation->last_page)}" title="{$page_navigation->last_page}">{$lang->last_page} »</a></li>
|
||||
</ul>
|
||||
</form>
|
||||
|
||||
<form action="./" method="get" class="search center x_input-append" onsubmit="return checkSearch(this)">
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<input type="hidden" name="module_srl" value="{$module_srl}" />
|
||||
<input type="hidden" name="error_return_url" value="" />
|
||||
<select name="search_target" title="{$lang->search_target}" style="margin-right:4px">
|
||||
<!--@foreach($lang->search_target_list as $key => $val)-->
|
||||
<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<input type="search" name="search_keyword" value="{htmlspecialchars($search_keyword)}" />
|
||||
<button type="submit" class="x_btn x_btn-inverse">{$lang->cmd_search}</button>
|
||||
<a href="{getUrl('','module',$module,'act',$act)}" class="x_btn">{$lang->cmd_cancel}</a>
|
||||
</form>
|
||||
|
||||
<form ruleset="deleteChecked" action="./" method="post" class="x_modal x" id="listManager">
|
||||
<input type="hidden" name="module" value="comment" />
|
||||
<input type="hidden" name="act" value="procCommentAdminDeleteChecked" />
|
||||
<input type="hidden" name="page" value="{$page}" />
|
||||
|
|
@ -99,86 +133,64 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
|
|||
<input type="hidden" name="will_publish" value="0" />
|
||||
<input type="hidden" name="search_target" value="{$search_target}" />
|
||||
<input type="hidden" name="search_keyword" value="{$search_keyword}" />
|
||||
<h2 class="h2">{$lang->comment_manager}</h2>
|
||||
<div class="table even">
|
||||
<table width="100%" border="1" cellspacing="0" id="commentManageListTable">
|
||||
<caption>
|
||||
{$lang->selected_comment} <strong id="selectedCommentCount"></strong>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="title">{$lang->comment}</th>
|
||||
<th scope="col" class="nowr">{$lang->writer}</th>
|
||||
<th scope="col" class="nowr">{$lang->status}</th>
|
||||
<th scope="col">{$lang->published}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="hidden" name="xe_validator_id" value="modules/comment/tpl/comment_list/1" />
|
||||
<div class="x_modal-header">
|
||||
<h1>{$lang->comment_manager}: <span class="_sub"></span></h1>
|
||||
</div>
|
||||
<div class="x_modal-body">
|
||||
<table id="commentManageListTable" class="x_table x_table-striped x_table-hover">
|
||||
<caption>
|
||||
<strong>{$lang->selected_comment} <span id="selectedCommentCount"></span></strong>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="title">{$lang->comment}</th>
|
||||
<th scope="col" class="nowr">{$lang->writer}</th>
|
||||
<th scope="col" class="nowr">{$lang->status}</th>
|
||||
<th scope="col">{$lang->published}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="x_control-group" style="margin:15px 14px 0 0">
|
||||
<label for="message">{$lang->message_notice}</label>
|
||||
<textarea rows="4" cols="42" name="message_content" id="message" style="width:100%"></textarea>
|
||||
</div>
|
||||
<p class="q"><label for="message">{$lang->message_notice}</label></p>
|
||||
<p>
|
||||
<textarea rows="8" cols="42" name="message_content" id="message" style="width:98%"></textarea>
|
||||
</p>
|
||||
<div class="btnArea">
|
||||
<!--@if ($search_target=='is_published' && $search_keyword=="N")-->
|
||||
<span class="btn"><button type="submit" name="will_publish" value="1" onclick="doChangePublishedStatus(this.value);">{$lang->cmd_publish}</button></span>
|
||||
<!--@elseif ($search_target=='is_published' && $search_keyword=="Y")-->
|
||||
<span class="btn"><button type="submit" name="will_publish" value="0" onclick="doChangePublishedStatus(this.value);">{$lang->cmd_unpublish}</button></span>
|
||||
<!--@else-->
|
||||
<span class="btn"><button type="submit" name="will_publish" value="1" onclick="doChangePublishedStatus(this.value);">{$lang->cmd_publish}</button></span>
|
||||
<span class="btn"><button type="submit" name="will_publish" value="0" onclick="doChangePublishedStatus(this.value);">{$lang->cmd_unpublish}</button></span>
|
||||
<!--@end-->
|
||||
<span class="btn"><button type="submit" name="is_trash" value="true">{$lang->cmd_trash}</button></span>
|
||||
<span class="btn"><button type="submit" name="is_trash" value="false">{$lang->cmd_delete}</button></span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="search">
|
||||
<form action="./" class="pagination">
|
||||
<input type="hidden" name="error_return_url" value="" />
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<input cond="$search_keyword" type="hidden" name="search_keyword" value="{$search_keyword}" />
|
||||
<input cond="$search_target" type="hidden" name="search_target" value="{$search_target}" />
|
||||
|
||||
<a href="{getUrl('page', '')}" class="direction">« {$lang->first_page}</a>
|
||||
<block cond="$page_navigation->first_page + $page_navigation->page_count > $page_navigation->last_page && $page_navigation->page_count != $page_navigation->total_page">
|
||||
{@$isGoTo = true}
|
||||
<a href="{getUrl('page', '')}">1</a>
|
||||
<a href="#goTo" class="tgAnchor" title="{$lang->cmd_go_to_page}">...</a>
|
||||
</block>
|
||||
<!--@while($page_no = $page_navigation->getNextPage())-->
|
||||
{@$last_page = $page_no}
|
||||
<strong cond="$page_no == $page">{$page_no}</strong>
|
||||
<a cond="$page_no != $page" href="{getUrl('page', $page_no)}">{$page_no}</a>
|
||||
<!--@end-->
|
||||
<block cond="$last_page != $page_navigation->last_page">
|
||||
{@$isGoTo = true}
|
||||
<a href="#goTo" class="tgAnchor" title="{$lang->cmd_go_to_page}">...</a>
|
||||
<a href="{getUrl('page', $page_navigation->last_page)}">{$page_navigation->last_page}</a>
|
||||
</block>
|
||||
<a href="{getUrl('page', $page_navigation->last_page)}" class="direction">{$lang->last_page} »</a>
|
||||
<span cond="$isGoTo" id="goTo" class="tgContent">
|
||||
<input name="page" title="{$lang->cmd_go_to_page}" />
|
||||
<button type="submit">Go</button>
|
||||
</span>
|
||||
</div>
|
||||
<div class="x_modal-footer">
|
||||
<button type="submit" class="x_btn x_btn-inverse x_pull-right" name="is_trash|will_publish" value="true|false|0|1">{$lang->cmd_confirm}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form action="./" method="get" class="adminSearch" onsubmit="return checkSearch(this)">
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<input type="hidden" name="module_srl" value="{$module_srl}" />
|
||||
<input type="hidden" name="error_return_url" value="" />
|
||||
<select name="search_target">
|
||||
<option value="">{$lang->search_target}</option>
|
||||
<!--@foreach($lang->search_target_list as $key => $val)-->
|
||||
<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" />
|
||||
<input type="submit" value="{$lang->cmd_search}" />
|
||||
<a href="{getUrl('','module',$module,'act',$act)}">{$lang->cmd_cancel}</a>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
jQuery(function($){
|
||||
// Modal anchor activation
|
||||
var $docTable = $('#commentListTable');
|
||||
$docTable.find(':checkbox').change(function(){
|
||||
var $modalAnchor = $('a[data-value]');
|
||||
if($docTable.find('tbody :checked').length == 0){
|
||||
$modalAnchor.removeAttr('href').addClass('x_disabled');
|
||||
} else {
|
||||
$modalAnchor.attr('href','#listManager').removeClass('x_disabled');
|
||||
}
|
||||
}).change();
|
||||
// Button action
|
||||
$('a[data-value]').bind('before-open.mw', function(){
|
||||
if($docTable.find('tbody :checked').length == 0){
|
||||
$('body').css('overflow','auto');
|
||||
alert('{$lang->msg_not_selected_comment}');
|
||||
return false;
|
||||
} else {
|
||||
var $this = $(this);
|
||||
var thisValue = $this.attr('data-value');
|
||||
var thisName = $this.attr('data-name');
|
||||
var thisText = $this.text();
|
||||
getCommentList();
|
||||
$('#listManager').find('.x_modal-header ._sub').text(thisText).end().find('[type="submit"]:eq(0)').val(thisValue).attr('name', thisName).text(thisText);
|
||||
}
|
||||
});
|
||||
$('.x_modal-footer').on("click", '[type="submit"][name="will_publish"]', function(){
|
||||
doChangePublishedStatus($(this).val());
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,51 +1,49 @@
|
|||
<form ruleset="insertCommentModuleConfig" action="./" method="post" class="form">
|
||||
<input type="hidden" name="module" value="comment" />
|
||||
<input type="hidden" name="act" value="procCommentInsertModuleConfig" />
|
||||
<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
|
||||
<input type="hidden" name="target_module_srl" value="{$module_info->module_srl?$module_info->module_srl:$module_srls}" />
|
||||
<h3 class="h3">{$lang->comment}</h3>
|
||||
<div class="table">
|
||||
<table width="100%" border="1" cellspacing="0">
|
||||
<tr>
|
||||
<th scope="row"><label for="comment_count">{$lang->comment_count}</label></th>
|
||||
<td class="text">
|
||||
<input type="text" name="comment_count" id="comment_count" value="{$comment_config->comment_count}" style="width:30px" />
|
||||
<span class="desc">{$lang->about_comment_count}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="use_vote_up">{$lang->cmd_vote}</label></th>
|
||||
<td class="text">
|
||||
<select name="use_vote_up" id="use_vote_up">
|
||||
<option value="Y" selected="selected"|cond="$comment_config->use_vote_up=='Y'">{$lang->use}</option>
|
||||
<option value="S" selected="selected"|cond="$comment_config->use_vote_up=='S'">{$lang->use_and_display}</option>
|
||||
<option value="N" selected="selected"|cond="$comment_config->use_vote_up=='N'">{$lang->notuse}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="use_vote_down">{$lang->cmd_vote_down}</label></th>
|
||||
<td class="text">
|
||||
<select name="use_vote_down" id="use_vote_down">
|
||||
<option value="Y" selected="selected"|cond="$comment_config->use_vote_down=='Y'">{$lang->use}</option>
|
||||
<option value="S" selected="selected"|cond="$comment_config->use_vote_down=='S'">{$lang->use_and_display}</option>
|
||||
<option value="N" selected="selected"|cond="$comment_config->use_vote_down=='N'">{$lang->notuse}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="use_comment_validation">{$lang->cmd_comment_validation}</label></th>
|
||||
<td>
|
||||
<select name="use_comment_validation">
|
||||
<option value="N" selected="selected"|cond="$comment_config->use_comment_validation=='N'">{$lang->notuse}</option>
|
||||
<option value="Y" selected="selected"|cond="$comment_config->use_comment_validation=='Y'">{$lang->use}</option>
|
||||
</select>
|
||||
<p>{$lang->about_comment_validation}</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="btnArea">
|
||||
<span class="btn"><input type="submit" value="{$lang->cmd_save}"/></span>
|
||||
</div>
|
||||
</form>
|
||||
<section class="section">
|
||||
<h1>{$lang->comment}</h1>
|
||||
<form ruleset="insertCommentModuleConfig" action="./" method="post" class="x_form-horizontal">
|
||||
<input type="hidden" name="module" value="comment" />
|
||||
<input type="hidden" name="act" value="procCommentInsertModuleConfig" />
|
||||
<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
|
||||
<input type="hidden" name="target_module_srl" value="{$module_info->module_srl?$module_info->module_srl:$module_srls}" />
|
||||
<div class="x_control-group">
|
||||
<label for="comment_count" class="x_control-label">{$lang->comment_count}</label>
|
||||
<div class="x_controls">
|
||||
<input type="number" min="1" name="comment_count" id="comment_count" value="{$comment_config->comment_count}" />
|
||||
<p class="x_help-inline">{$lang->about_comment_count}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="use_vote_up" class="x_control-label">{$lang->cmd_vote}</label>
|
||||
<div class="x_controls">
|
||||
<select name="use_vote_up" id="use_vote_up">
|
||||
<option value="Y" selected="selected"|cond="$comment_config->use_vote_up=='Y'">{$lang->use}</option>
|
||||
<option value="S" selected="selected"|cond="$comment_config->use_vote_up=='S'">{$lang->use_and_display}</option>
|
||||
<option value="N" selected="selected"|cond="$comment_config->use_vote_up=='N'">{$lang->notuse}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="use_vote_down" class="x_control-label">{$lang->cmd_vote_down}</label>
|
||||
<div class="x_controls">
|
||||
<select name="use_vote_down" id="use_vote_down">
|
||||
<option value="Y" selected="selected"|cond="$comment_config->use_vote_down=='Y'">{$lang->use}</option>
|
||||
<option value="S" selected="selected"|cond="$comment_config->use_vote_down=='S'">{$lang->use_and_display}</option>
|
||||
<option value="N" selected="selected"|cond="$comment_config->use_vote_down=='N'">{$lang->notuse}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="use_comment_validation" class="x_control-label">{$lang->cmd_comment_validation}</label>
|
||||
<div class="x_controls">
|
||||
<select name="use_comment_validation" id="use_comment_validation">
|
||||
<option value="N" selected="selected"|cond="$comment_config->use_comment_validation=='N'">{$lang->notuse}</option>
|
||||
<option value="Y" selected="selected"|cond="$comment_config->use_comment_validation=='Y'">{$lang->use}</option>
|
||||
</select>
|
||||
<p class="x_help-inline">{$lang->about_comment_validation}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_clearfix btnArea">
|
||||
<button type="submit" class="x_btn x_btn-primary">{$lang->cmd_save}</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<!--#include("header.html")-->
|
||||
|
||||
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<include target="header.html" />
|
||||
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/comment/tpl/declared_list/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
</div>
|
||||
<form ruleset="deleteChecked" id="fo_list" action="./" method="post">
|
||||
|
|
@ -9,53 +8,111 @@
|
|||
<input type="hidden" value="{getUrl('', 'module', $module, 'act', $act)}" name="success_return_url">
|
||||
<input type="hidden" name="page" value="{$page}" />
|
||||
<input type="hidden" name="is_trash" value="false" />
|
||||
<input type="hidden" name="xe_validator_id" value="modules/comment/tpl/declared_list/1" />
|
||||
|
||||
<!-- 목록 -->
|
||||
<div class="table">
|
||||
<table width="100%" border="1" cellspacing="0">
|
||||
<caption>{$lang->all} {number_format($total_count)}, {$lang->page} {number_format($page)}/{number_format($total_page)}</caption>
|
||||
<table id="commentListTable" class="x_table x_table-striped x_table-hover">
|
||||
<caption>
|
||||
<a href="{getUrl('search_keyword','','search_target','','act','dispCommentAdminList','Y')}">{$lang->all}</a>
|
||||
<i>|</i>
|
||||
<a href="{getUrl('act','dispCommentAdminList','search_target','is_secret','search_keyword','N')}">{$secret_name_list['N']}</a>
|
||||
<i>|</i>
|
||||
<a href="{getUrl('act','dispCommentAdminList','search_target','is_secret','search_keyword','Y')}">{$secret_name_list['Y']}</a>
|
||||
<i>|</i>
|
||||
<a href="{getUrl('act','dispCommentAdminList','search_target','is_published','search_keyword','N')}">{$lang->published_name_list['N']}</a>
|
||||
<i>|</i>
|
||||
<a href="{getUrl('act','dispCommentAdminList','search_target','is_published','search_keyword','Y')}">{$lang->published_name_list['Y']}</a>
|
||||
<i>|</i>
|
||||
<a href="{getUrl('', 'module', 'admin', 'act','dispCommentAdminDeclared')}" class="active"|cond="$act == 'dispCommentAdminDeclared'">{$lang->cmd_declared_list}({number_format($total_count)})</a>
|
||||
|
||||
<div class="x_pull-right x_btn-group">
|
||||
<button class="x_btn" type="submit" name="trash" onclick="this.form.is_trash.value=true">{$lang->cmd_trash}</button>
|
||||
<button class="x_btn" type="submit" onclick="this.form.is_trash.value=false">{$lang->cmd_delete_checked_comment}</button>
|
||||
</div>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><input type="checkbox" onclick="XE.checkboxToggleAll(); return false;" /></th>
|
||||
<th scope="col">{$lang->comment}</th>
|
||||
<th scope="col">{$lang->user_name}</th>
|
||||
<th scope="col">{$lang->date}</th>
|
||||
<th scope="col">{$lang->cmd_declare}</th>
|
||||
<th scope="col">{$lang->ipaddress}</th>
|
||||
<th scope="col" style="width:15px"><input type="checkbox" /></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!--@foreach($comment_list as $no => $oComment)-->
|
||||
<tr>
|
||||
<td>{$no}</td>
|
||||
<td><input type="checkbox" name="cart" value="{$oComment->get('comment_srl')}" /> <a href="{getUrl('','document_srl',$oComment->get('document_srl'))}#comment_{$oComment->get('comment_srl')}" onclick="window.open(this.href);return false;">{$oComment->getSummary(100)}</a></td>
|
||||
<tr loop="$comment_list => $no, $oComment">
|
||||
<td><a href="{getUrl('','document_srl',$oComment->get('document_srl'))}#comment_{$oComment->get('comment_srl')}" onclick="window.open(this.href);return false;">{$oComment->getSummary(100)}</a></td>
|
||||
<td><span class="member_{$oComment->getMemberSrl()}">{$oComment->getNickName()}</span></td>
|
||||
<td>{$oComment->getRegdate("Y-m-d")}</td>
|
||||
<td><strong>{$oComment->get('declared_count')}</strong></td>
|
||||
<td>{$oComment->get('ipaddress')}</td>
|
||||
<td><input type="checkbox" name="cart[]" value="{$oComment->get('comment_srl')}" /></td>
|
||||
</tr>
|
||||
<tr cond="!$comment_list">
|
||||
<td>{$lang->no_documents}</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="btnArea">
|
||||
<span class="btn"><button type="button" onclick="doCancelDeclare();">{$lang->cmd_cancel_declare}</button></span>
|
||||
<span class="btn"><a href="javascript:XE.checkboxToggleAll({ checked:true })">{$lang->cmd_select_all}</a></span>
|
||||
<span class="btn"><a href="javascript:XE.checkboxToggleAll()">{$lang->cmd_reverse_all}</a></span>
|
||||
<span class="btn"><input type="submit" value="{$lang->cmd_delete_checked_comment}" onclick="this.form.is_trash.value=false" /></span>
|
||||
<span class="btn"><input type="submit" name="trash" value="{$lang->cmd_trash}" onclick="this.form.is_trash.value=true" /></span>
|
||||
</table>
|
||||
<div class="x_clearfix">
|
||||
<div class="x_pull-left x_btn-group">
|
||||
<button class="x_btn" type="button" onclick="doCancelDeclare();">{$lang->cmd_cancel_declare}</button>
|
||||
</div>
|
||||
<div class="x_pull-right x_btn-group">
|
||||
<button class="x_btn" type="submit" name="trash" onclick="this.form.is_trash.value=true">{$lang->cmd_trash}</button>
|
||||
<button class="x_btn" type="submit" onclick="this.form.is_trash.value=false">{$lang->cmd_delete_checked_comment}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- 페이지 네비게이션 -->
|
||||
<div class="pagination">
|
||||
<a href="{getUrl('page','','module_srl','')}" class="direction">« {$lang->first_page}</a>
|
||||
<!--@while($page_no = $page_navigation->getNextPage())-->
|
||||
<!--@if($page == $page_no)-->
|
||||
<strong>{$page_no}</strong>
|
||||
<!--@else-->
|
||||
<a href="{getUrl('page',$page_no,'module_srl','')}">{$page_no}</a>
|
||||
<!--@end-->
|
||||
<!--@end-->
|
||||
<a href="{getUrl('page',$page_navigation->last_page,'module_srl','')}" class="direction">{$lang->last_page} »</a>
|
||||
</div>
|
||||
<form action="./" class="x_pagination x_pagination-centered">
|
||||
<input type="hidden" name="error_return_url" value="" />
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="{$act}" />
|
||||
<input cond="$search_keyword" type="hidden" name="search_keyword" value="{$search_keyword}" />
|
||||
<input cond="$search_target" type="hidden" name="search_target" value="{$search_target}" />
|
||||
<ul>
|
||||
<li class="x_disabled"|cond="!$page || $page == 1"><a href="{getUrl('page', '')}">« {$lang->first_page}</a></li>
|
||||
<block cond="$page_navigation->first_page != 1 && $page_navigation->first_page + $page_navigation->page_count > $page_navigation->last_page - 1 && $page_navigation->page_count != $page_navigation->total_page">
|
||||
{@$isGoTo = true}
|
||||
<li>
|
||||
<a href="#goTo" data-toggle title="{$lang->cmd_go_to_page}">…</a>
|
||||
<span cond="$isGoTo" id="goTo" class="x_input-append">
|
||||
<input type="number" min="1" max="{$page_navigation->last_page}" required name="page" title="{$lang->cmd_go_to_page}" />
|
||||
<button type="submit" class="x_add-on">Go</button>
|
||||
</span>
|
||||
</li>
|
||||
</block>
|
||||
|
||||
<!--@while($page_no = $page_navigation->getNextPage())-->
|
||||
{@$last_page = $page_no}
|
||||
<li class="x_active"|cond="$page_no == $page"><a href="{getUrl('page', $page_no)}">{$page_no}</a></li>
|
||||
<!--@end-->
|
||||
|
||||
<block cond="$last_page != $page_navigation->last_page && $last_page + 1 != $page_navigation->last_page">
|
||||
{@$isGoTo = true}
|
||||
<li>
|
||||
<a href="#goTo" data-toggle title="{$lang->cmd_go_to_page}">…</a>
|
||||
<span cond="$isGoTo" id="goTo" class="x_input-append">
|
||||
<input type="number" min="1" max="{$page_navigation->last_page}" required name="page" title="{$lang->cmd_go_to_page}" />
|
||||
<button type="submit" class="x_add-on">Go</button>
|
||||
</span>
|
||||
</li>
|
||||
</block>
|
||||
<li class="x_disabled"|cond="$page == $page_navigation->last_page"><a href="{getUrl('page', $page_navigation->last_page)}" title="{$page_navigation->last_page}">{$lang->last_page} »</a></li>
|
||||
</ul>
|
||||
</form>
|
||||
<script>
|
||||
jQuery(function($){
|
||||
// Modal anchor activation
|
||||
var $docTable = $('#commentListTable');
|
||||
$docTable.find(':checkbox').change(function(){
|
||||
var $btn = $('#fo_list [type="submit"], #fo_list [type="button"]');
|
||||
if($docTable.find('tbody :checked').length == 0){
|
||||
$btn.addClass('x_disabled');
|
||||
} else {
|
||||
$btn.removeClass('x_disabled');
|
||||
}
|
||||
}).change();
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,10 +1,4 @@
|
|||
<load target="js/comment_admin.js" usecdn="true" />
|
||||
|
||||
<h3 class="xeAdmin">{$lang->comment} <span class="gray">{$lang->cmd_management}</span></h3>
|
||||
|
||||
<div class="header4">
|
||||
<ul class="localNavigation">
|
||||
<li <!--@if($act=='dispCommentAdminList')-->class="on"<!--@end-->><a href="{getUrl('act','dispCommentAdminList')}">{$lang->comment_list}</a></li>
|
||||
<li <!--@if($act=='dispCommentAdminDeclared')-->class="on"<!--@end-->><a href="{getUrl('act','dispCommentAdminDeclared')}">{$lang->cmd_declared_list}</a></li>
|
||||
</ul>
|
||||
<div class="x_page-header">
|
||||
<h1>{$lang->comment} {$lang->cmd_management} <a class="x_icon-question-sign" href="./admin/help/index.html#UMAN_content_comment" target="_blank">{$lang->help}</a></h1>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ function completeGetCommentList(ret_obj, response_tags)
|
|||
if(ret_obj['comment_list'] == null)
|
||||
{
|
||||
htmlListBuffer = '<tr>' +
|
||||
'<td colspan="3" style="text-align:center;">'+ret_obj['message']+'</td>' +
|
||||
'<td colspan="4" style="text-align:center">'+ret_obj['message']+'</td>' +
|
||||
'</tr>';
|
||||
}
|
||||
else
|
||||
|
|
@ -58,9 +58,8 @@ function completeGetCommentList(ret_obj, response_tags)
|
|||
'<td class="title">'+ objComment.content +'</td>' +
|
||||
'<td class="nowr">'+ objComment.nick_name +'</td>' +
|
||||
'<td class="nowr">'+ statusNameList[objComment.is_secret] +'</td>' +
|
||||
'<td>'+ publishedStatusList[objComment.status] +'</td>' +
|
||||
'</tr>' +
|
||||
'<input type="hidden" name="cart[]" value="'+objComment.comment_srl+'" />';
|
||||
'<td>'+ publishedStatusList[objComment.status] + '<input type="hidden" name="cart[]" value="'+objComment.comment_srl+'" />' + '</td>' +
|
||||
'</tr>';
|
||||
}
|
||||
jQuery('#selectedCommentCount').html(comment_list.length);
|
||||
}
|
||||
|
|
@ -84,9 +83,11 @@ function checkSearch(form)
|
|||
alert(xe.lang.msg_empty_search_target);
|
||||
return false;
|
||||
}
|
||||
/*
|
||||
if(form.search_keyword.value == '')
|
||||
{
|
||||
alert(xe.lang.msg_empty_search_keyword);
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue