팝업 메뉴에 추천, 비추천, 신고 취소 기능 작동하도록 추가.

This commit is contained in:
BJRambo 2019-08-08 17:57:20 +09:00
parent adb68347ef
commit ff9c21d04f
4 changed files with 47 additions and 19 deletions

View file

@ -31,6 +31,8 @@ $lang->cmd_vote = '추천';
$lang->cmd_vote_down = '비추천';
$lang->cmd_declare = '신고';
$lang->cmd_cancel_declare = '신고 취소';
$lang->cmd_cancel_vote = '추천 취소';
$lang->cmd_cancel_vote_down = '비추천 취소';
$lang->cmd_declared_list = '신고 목록';
$lang->cmd_copy = '복사';
$lang->cmd_move = '이동';

View file

@ -311,13 +311,16 @@ class documentController extends document
{
throw new Rhymix\Framework\Exceptions\MustLogin;
}
$document_srl = intval(Context::get('target_srl'));
$module_info = getModel('module')->getModuleInfoByDocumentSrl($document_srl);
if($this->module_info->cancel_vote !== 'Y')
if($module_info->cancel_vote !== 'Y')
{
throw new Rhymix\Framework\Exception('failed_voted_cancel');
throw new Rhymix\Framework\Exception('failed_declared_cancel');
}
$document_srl = intval(Context::get('target_srl'));
if(!$document_srl)
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;

View file

@ -431,9 +431,6 @@ class documentModel extends document
{
// Post number and the current login information requested Wanted
$document_srl = Context::get('target_srl');
$mid = Context::get('cur_mid');
$logged_info = Context::get('logged_info');
$act = Context::get('cur_act');
// to menu_list "pyosihalgeul, target, url" put into an array
$menu_list = array();
// call trigger
@ -441,7 +438,7 @@ class documentModel extends document
$oDocumentController = getController('document');
// Members must be a possible feature
if($logged_info->member_srl)
if($this->user->member_srl)
{
$oDocumentModel = getModel('document');
$columnList = array('document_srl', 'module_srl', 'member_srl', 'ipaddress');
@ -452,23 +449,45 @@ class documentModel extends document
$oModuleModel = getModel('module');
$document_config = $oModuleModel->getModulePartConfig('document',$module_srl);
if($document_config->use_vote_up!='N' && $member_srl!=$logged_info->member_srl)
if($document_config->use_vote_up!='N' && $member_srl!=$this->user->member_srl)
{
// Add a Referral Button
$url = sprintf("doCallModuleAction('document','procDocumentVoteUp','%s')", $document_srl);
$oDocumentController->addDocumentPopupMenu($url,'cmd_vote','','javascript');
if($oDocument->getVoted() === false || $oDocument->getVoted() < 0)
{
$url = sprintf("doCallModuleAction('document','procDocumentVoteUp','%s')", $document_srl);
$oDocumentController->addDocumentPopupMenu($url,'cmd_vote','','javascript');
}
elseif($oDocument->getVoted() > 0)
{
$url = sprintf("doCallModuleAction('document','procDocumentVoteUpCancel','%s')", $document_srl);
$oDocumentController->addDocumentPopupMenu($url,'cmd_cancel_vote','','javascript');
}
}
if($document_config->use_vote_down!='N' && $member_srl!=$logged_info->member_srl)
if($document_config->use_vote_down!='N' && $member_srl!=$this->user->member_srl)
{
// Add button to negative
$url= sprintf("doCallModuleAction('document','procDocumentVoteDown','%s')", $document_srl);
$oDocumentController->addDocumentPopupMenu($url,'cmd_vote_down','','javascript');
if($oDocument->getVoted() === false || $oDocument->getVoted() > 0)
{
$url = sprintf("doCallModuleAction('document','procDocumentVoteDown','%s')", $document_srl);
$oDocumentController->addDocumentPopupMenu($url,'cmd_vote_down','','javascript');
}
else if($oDocument->getVoted() < 0)
{
$url = sprintf("doCallModuleAction('document','procDocumentVoteDownCancel','%s')", $document_srl);
$oDocumentController->addDocumentPopupMenu($url,'cmd_cancel_vote_down','','javascript');
}
}
// Adding Report
$url = getUrl('', 'act', 'dispDocumentDeclare', 'target_srl', $document_srl);
$oDocumentController->addDocumentPopupMenu($url,'cmd_declare','','popup');
if($oDocument->getDeclared())
{
$url = getUrl('', 'act', 'dispDocumentDeclare', 'target_srl', $document_srl, 'type', 'cancel');
$oDocumentController->addDocumentPopupMenu($url,'cmd_cancel_declare','','popup');
}
else
{
$url = getUrl('', 'act', 'dispDocumentDeclare', 'target_srl', $document_srl);
$oDocumentController->addDocumentPopupMenu($url,'cmd_declare','','popup');
}
// Add Bookmark button
$url = sprintf("doCallModuleAction('member','procMemberScrapDocument','%s')", $document_srl);
@ -487,7 +506,7 @@ class documentModel extends document
}
// If you are managing to find posts by ip
if($logged_info->is_admin == 'Y')
if($this->user->is_admin == 'Y')
{
$oDocumentModel = getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl); //before setting document recycle

View file

@ -8,7 +8,11 @@
<h1>{$lang->improper_document_declare}</h1>
<form action="./" method="post" id="fo_component" ruleset="insertDeclare">
<input type="hidden" name="module" value="document" />
<!--@if($type == 'cancel')-->
<input type="hidden" name="act" value="procDocumentDeclareCancel" />
<!--@else-->
<input type="hidden" name="act" value="procDocumentDeclare" />
<!--@end-->
<input type="hidden" name="target_srl" value="{$target_srl}" />
<input type="hidden" name="success_return_url" value="{getUrl('', 'act', $act, 'target_srl', $target_srl)}" />
<input type="hidden" name="xe_validator_id" value="modules/document/tpl/1" />
@ -53,4 +57,4 @@
msg_area.hide();
$(document).load(setFixedPopupSize);
})(jQuery);
</script>
</script>