26 if($this->module_info->module !=
"board")
28 return new BaseObject(-1,
"msg_invalid_request");
30 if(!$this->grant->write_document)
32 return new BaseObject(-1,
'msg_not_permitted');
39 if(
$obj->is_notice!=
'Y'||!$this->grant->manager)
$obj->is_notice =
'N';
40 $obj->commentStatus =
$obj->comment_status;
46 if(!isset(
$obj->use_editor))
$obj->use_editor =
'Y';
47 if(!isset(
$obj->use_html))
$obj->use_html =
'Y';
51 if(!isset(
$obj->use_editor))
$obj->use_editor =
'N';
52 if(!isset(
$obj->use_html))
$obj->use_html =
'N';
55 settype(
$obj->title,
"string");
56 if(
$obj->title ==
'')
$obj->title =
cut_str(trim(strip_tags(nl2br(
$obj->content))),20,
'...');
58 if(
$obj->title ==
'')
$obj->title =
'Untitled';
61 if(!$this->grant->manager)
63 unset(
$obj->title_color);
64 unset(
$obj->title_bold);
78 if($oDocument->isExists() && $oDocument->document_srl ==
$obj->document_srl)
84 if($this->module_info->use_anonymous ==
'Y')
86 $this->module_info->admin_mail =
'';
87 $obj->notify_message =
'N';
88 if($is_update===
false)
92 $obj->email_address =
$obj->homepage =
$obj->user_id =
'';
93 $obj->user_name =
$obj->nick_name =
'anonymous';
95 if($is_update===
false)
97 $oDocument->add(
'member_srl',
$obj->member_srl);
105 if(
$obj->is_secret ==
'Y' || strtoupper(
$obj->status ==
'SECRET'))
107 $use_status = explode(
'|@|', $this->module_info->use_status);
108 if(!is_array($use_status) || !in_array(
'SECRET', $use_status))
110 unset(
$obj->is_secret);
111 $obj->status =
'PUBLIC';
118 if(!$oDocument->isGranted())
120 return new BaseObject(-1,
'msg_not_permitted');
123 if($this->module_info->use_anonymous ==
'Y') {
124 $obj->member_srl = abs($oDocument->get(
'member_srl')) * -1;
125 $oDocument->add(
'member_srl',
$obj->member_srl);
128 if($this->module_info->protect_content==
"Y" && $oDocument->get(
'comment_count')>0 && $this->grant->manager==
false)
130 return new BaseObject(-1,
'msg_protect_content');
133 if(!$this->grant->manager)
136 $obj->is_notice = $oDocument->get(
'is_notice');
137 $obj->title_color = $oDocument->get(
'title_color');
138 $obj->title_bold = $oDocument->get(
'title_bold');
142 if($oDocument->get(
'status') ==
'TEMP')
144 $obj->last_update =
$obj->regdate = date(
'YmdHis');
149 $msg_code =
'success_updated';
154 $msg_code =
'success_registed';
158 if(
$output->toBool() && $this->module_info->admin_mail)
164 $oMail->setTitle(
$obj->title);
165 $oMail->setContent( sprintf(
"From : <a href=\"%s\">%s</a><br/>\r\n%s",
getFullUrl(
'',
'document_srl',
$obj->document_srl),
getFullUrl(
'',
'document_srl',
$obj->document_srl),
$obj->content));
166 $oMail->setSender(
$obj->user_name ?
$obj->user_name :
'anonymous',
$obj->email_address ?
$obj->email_address : $member_config->webmaster_email);
168 $target_mail = explode(
',',$this->module_info->admin_mail);
169 for($i=0;$i<count($target_mail);$i++)
171 $email_address = trim($target_mail[$i]);
172 if(!$email_address)
continue;
173 $oMail->setReceiptor($email_address, $email_address);
187 $this->
add(
'document_srl',
$output->get(
'document_srl'));
207 return $this->doError(
'msg_invalid_document');
213 if($this->module_info->protect_content==
"Y" && $oDocument->get(
'comment_count')>0 && $this->grant->manager==
false)
215 return new BaseObject(-1,
'msg_protect_content');
256 if(!$this->grant->write_comment)
258 return new BaseObject(-1,
'msg_not_permitted');
266 if(!$this->module_info->use_status) $this->module_info->use_status =
'PUBLIC';
267 if(!is_array($this->module_info->use_status))
269 $this->module_info->use_status = explode(
'|@|', $this->module_info->use_status);
272 if(in_array(
'SECRET', $this->module_info->use_status))
274 $this->module_info->secret =
'Y';
278 unset(
$obj->is_secret);
279 $this->module_info->secret =
'N';
286 if(!isset(
$obj->use_editor))
$obj->use_editor =
'Y';
287 if(!isset(
$obj->use_html))
$obj->use_html =
'Y';
291 if(!isset(
$obj->use_editor))
$obj->use_editor =
'N';
292 if(!isset(
$obj->use_html))
$obj->use_html =
'N';
298 if(!$oDocument->isExists())
304 if($this->module_info->use_anonymous ==
'Y')
306 $this->module_info->admin_mail =
'';
307 $obj->notify_message =
'N';
309 $obj->email_address =
$obj->homepage =
$obj->user_id =
'';
310 $obj->user_name =
$obj->nick_name =
'anonymous';
319 $oCommentModel =
getModel(
'comment');
326 if(!
$obj->comment_srl)
330 $comment = $oCommentModel->getComment(
$obj->comment_srl, $this->grant->manager);
334 if($comment->comment_srl !=
$obj->comment_srl)
340 $parent_comment = $oCommentModel->getComment(
$obj->parent_srl);
341 if(!$parent_comment->comment_srl)
343 return new BaseObject(-1,
'msg_invalid_request');
346 $output = $oCommentController->insertComment(
$obj, $bAnonymous);
350 $output = $oCommentController->insertComment(
$obj, $bAnonymous);
355 if(!$comment->isGranted())
357 return new BaseObject(-1,
'msg_not_permitted');
360 $obj->parent_srl = $comment->parent_srl;
361 $output = $oCommentController->updateComment(
$obj, $this->grant->manager);
362 $comment_srl =
$obj->comment_srl;
375 $this->
add(
'document_srl',
$obj->document_srl);
376 $this->
add(
'comment_srl',
$obj->comment_srl);
388 return $this->doError(
'msg_invalid_request');
394 $output = $oCommentController->deleteComment($comment_srl, $this->grant->manager);
402 $this->
add(
'document_srl',
$output->get(
'document_srl'));
419 if(!$oTrackbackController)
return;
421 $output = $oTrackbackController->deleteTrackback($trackback_srl, $this->grant->manager);
429 $this->
add(
'document_srl',
$output->get(
'document_srl'));
452 $oCommentModel =
getModel(
'comment');
453 $oComment = $oCommentModel->getComment($comment_srl);
454 if(!$oComment->isExists())
456 return new BaseObject(-1,
'msg_invalid_request');
460 if(!$oMemberModel->isValidPassword($oComment->get(
'password'),$password))
462 return new BaseObject(-1,
'msg_invalid_password');
465 $oComment->setGrant();
470 if(!$oDocument->isExists())
472 return new BaseObject(-1,
'msg_invalid_request');
476 if(!$oMemberModel->isValidPassword($oDocument->get(
'password'),$password))
478 return new BaseObject(-1,
'msg_invalid_password');
481 $oDocument->setGrant();
493 if(!$member_srl || !
$mid)
502 $columnList = array(
'module');
505 if($cur_module_info->module !=
'board')
516 $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
519 if(!$member_info->user_id)
525 $url =
getUrl(
'',
'mid',
$mid,
'search_target',
'nick_name',
'search_keyword',$member_info->nick_name);
527 $oMemberController->addMemberPopupMenu($url,
'cmd_view_own_document',
'');
procBoardInsertComment()
insert comments
setMessage($message= 'success', $type=NULL)
getController($module_name)
triggerMemberMenu(&$obj)
the trigger for displaying 'view document' link when click the user ID
procBoardDeleteComment()
delete the comment
procBoardDeleteDocument()
delete the document
$module_srl
integer value to represent a run-time instance of Module (XE Module)
$mid
string to represent run-time instance of Module (XE Module)
setRedirectUrl($url= './', $output=NULL)
board module Controller class
procBoardDeleteTrackback()
delete the tracjback
cut_str($string, $cut_size=0, $tail= '...')
procBoardInsertDocument()
insert document
procBoardVerificationPassword()
check the password for document and comment
procBoardVoteDocument()
vote