34 $comment_srl_list = explode(
'|@|', $cart);
38 $comment_srl_list = $cart;
59 return $this->
stop(
'msg_cart_is_null');
63 $comment_srl_list = explode(
'|@|', $cart);
67 $comment_srl_list = $cart;
70 $args =
new stdClass();
71 $args->status = $will_publish;
72 $args->comment_srls_list = $comment_srl_list;
81 $updated_documents_arr = array();
87 $oCommentModel =
getModel(
'comment');
92 $new_status = ($will_publish) ?
"published" :
"unpublished";
93 foreach($comment_srl_list as $comment_srl)
96 $comment = $oCommentModel->getComment($comment_srl);
97 if($comment->comment_srl != $comment_srl)
99 return new BaseObject(-1,
'msg_invalid_request');
106 $comment_count = $oCommentModel->getCommentCount(
$document_srl);
111 $author_email = $oDocument->variables[
'email_address'];
115 $already_sent = array();
120 $mail_title =
"[XE - " .
$module_info->mid .
"] comment(s) status changed to " . $new_status .
" on document: \"" . $oDocument->getTitleText() .
"\"";
121 $oMail->setTitle($mail_title);
123 The comment #" . $comment_srl .
" on document \"" . $oDocument->getTitleText() .
"\" has been " . $new_status .
" by admin of <strong><i>" . strtoupper(
$module_info->mid) .
"</i></strong> module.
125 <br />Comment content:
126 " . $comment->content .
"
129 $oMail->setContent($mail_content);
132 $document_author_email = $oDocument->variables[
'email_address'];
151 for($i = 0; $i < count($target_mail); $i++)
153 $email_address = trim($target_mail[$i]);
158 if($author_email != $email_address)
160 $oMail->setReceiptor($email_address, $email_address);
178 $message_content = nl2br($message_content);
183 $this->_sendMessageForComment($message_content, $comment_srl_list);
200 return $this->
stop(
'msg_cart_is_null');
204 $comment_srl_list = explode(
'|@|', $cart);
208 $comment_srl_list = $cart;
210 $comment_count = count($comment_srl_list);
213 return $this->
stop(
'msg_cart_is_null');
225 $message_content = nl2br($message_content);
230 $this->_sendMessageForComment($message_content, $comment_srl_list);
234 if($isTrash ==
'true')
236 $this->
_moveCommentToTrash($comment_srl_list, $oCommentController, $oDB, $message_content);
241 for($i = 0; $i < $comment_count; $i++)
243 $comment_srl = trim($comment_srl_list[$i]);
249 $output = $oCommentController->deleteComment($comment_srl, TRUE, $isTrash);
262 if($isTrash ==
'true')
264 $msgCode =
'success_trashed';
268 $msgCode =
'success_deleted';
278 $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);
282 private function _sendMessageForComment($message_content, $comment_srl_list)
285 $oCommentModel =
getModel(
'comment');
289 $title =
cut_str($message_content, 10,
'...');
292 $comment_count = count($comment_srl_list);
293 for($i = 0; $i < $comment_count; $i++)
295 $comment_srl = $comment_srl_list[$i];
296 $oComment = $oCommentModel->getComment($comment_srl, TRUE);
298 if(!$oComment->get(
'member_srl') || $oComment->get(
'member_srl') == $sender_member_srl)
303 $content = sprintf(
"<div>%s</div><hr /><div style=\"font-weight:bold\">%s</div>", $message_content, $oComment->getContentText(20));
305 $oCommunicationController->sendMessage($sender_member_srl, $oComment->get(
'member_srl'), $title, $content, FALSE);
315 require_once(
_XE_PATH_ .
'modules/trash/model/TrashVO.php');
317 if(is_array($commentSrlList))
320 $oCommentModel =
getModel(
'comment');
321 $commentItemList = $oCommentModel->getComments($commentSrlList);
324 foreach($commentItemList AS $key => $oComment)
328 $oTrashVO->setTitle(trim(strip_tags($oComment->variables[
'content'])));
329 $oTrashVO->setOriginModule(
'comment');
330 $oTrashVO->setSerializedObject(serialize($oComment->variables));
331 $oTrashVO->setDescription($message_content);
333 $output = $oTrashAdminController->insertTrash($oTrashVO);
354 $oCommentModel =
getModel(
'comment');
356 $oComment = $oCommentModel->getComment($comment_srl,
false);
358 if(!$oComment->isGranted())
return $this->
stop(
'msg_not_permitted');
360 $message_content =
"";
361 $this->
_moveCommentToTrash(array($comment_srl), $oCommentController, $oDB, $message_content);
364 $output = $oCommentController->deleteComment($comment_srl, TRUE, $isTrash);
369 $this->
add(
'redirect_url', $returnUrl);
382 $args =
new stdClass();
383 $args->comment_srl = $comment_srl;
400 $oCommentModel =
getModel(
'comment');
401 $columnList = array(
'comment_srl');
402 $commentSrlList = array($comment_srl);
404 $output = $oCommentModel->getComments($commentSrlList);
408 foreach(
$output AS $key => $value)
410 if($_SESSION[
'comment_management'][$key])
412 unset($_SESSION[
'comment_management'][$key]);
416 $_SESSION[
'comment_management'][$key] = TRUE;
428 $args =
new stdClass();
440 if($oCacheHandler->isSupport())
443 $oCacheHandler->invalidateGroupKey(
'newestCommentsList');
455 if(is_array($originObject))
457 $originObject = (object) $originObject;
460 $obj =
new stdClass();
461 $obj->document_srl = $originObject->document_srl;
462 $obj->comment_srl = $originObject->comment_srl;
463 $obj->parent_srl = $originObject->parent_srl;
464 $obj->content = $originObject->content;
465 $obj->password = $originObject->password;
466 $obj->nick_name = $originObject->nick_name;
467 $obj->member_srl = $originObject->member_srl;
468 $obj->email_address = $originObject->email_address;
469 $obj->homepage = $originObject->homepage;
470 $obj->is_secret = $originObject->is_secret;
471 $obj->notify_message = $originObject->notify_message;
472 $obj->module_srl = $originObject->module_srl;
475 $output = $oCommentController->insertComment(
$obj,
true);
487 $originObject = unserialize($originObject);
488 if(is_array($originObject))
490 $originObject = (object) $originObject;
494 $oComment->setAttribute($originObject);
498 $args =
new stdClass();
499 $args->comment_srl = $oComment->get(
'comment_srl');
setMessage($message= 'success', $type=NULL)
getController($module_name)
& getInstance($target= 'object', $info=null, $always_use_file=false)
$module_srl
integer value to represent a run-time instance of Module (XE Module)
$module_info
an object containing the module information
setRedirectUrl($url= './', $output=NULL)
getInstance($db_type=NULL)
getAdminController($module_name)
cut_str($string, $cut_size=0, $tail= '...')
executeQuery($query_id, $args=NULL, $arg_columns=NULL)
triggerCall($trigger_name, $called_position, &$obj)