mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 18:21:39 +09:00
Clean up trigger registration code in document, comment, file, editor modules
This commit is contained in:
parent
79808ee285
commit
f3bc9a2f03
8 changed files with 42 additions and 340 deletions
|
|
@ -19,20 +19,9 @@ class Comment extends ModuleObject
|
|||
function moduleInstall()
|
||||
{
|
||||
$oDB = DB::getInstance();
|
||||
|
||||
// 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
|
||||
);
|
||||
|
||||
// 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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -42,33 +31,11 @@ class Comment extends ModuleObject
|
|||
function checkUpdate()
|
||||
{
|
||||
$oDB = DB::getInstance();
|
||||
|
||||
// 2007. 10. 17 add a trigger to delete comments together with posting deleted
|
||||
if(!ModuleModel::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(!ModuleModel::getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
// 2008. 02. 22 add comment setting when a new module added
|
||||
if(!ModuleModel::getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
if(!$oDB->isIndexExists("comments", "idx_module_list_order"))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||
if(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// 2016. 1. 29: Add a column(declare_message) for report
|
||||
if(!$oDB->isColumnExists("comment_declared_log","declare_message"))
|
||||
{
|
||||
|
|
@ -86,16 +53,6 @@ class Comment extends ModuleObject
|
|||
return true;
|
||||
}
|
||||
|
||||
// 2018.01.24 Improve mass file deletion
|
||||
if(!ModuleModel::getTrigger('document.moveDocumentModule', 'comment', 'controller', 'triggerMoveDocument', 'after'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if(!ModuleModel::getTrigger('document.copyDocumentModule', 'comment', 'controller', 'triggerAddCopyDocument', 'add'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -106,34 +63,11 @@ class Comment extends ModuleObject
|
|||
function moduleUpdate()
|
||||
{
|
||||
$oDB = DB::getInstance();
|
||||
$oModuleController = getController('module');
|
||||
|
||||
// 2007. 10. 17 add a trigger to delete comments together with posting deleted
|
||||
if(!ModuleModel::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(!ModuleModel::getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after');
|
||||
}
|
||||
// 2008. 02. 22 add comment setting when a new module added
|
||||
if(!ModuleModel::getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before');
|
||||
}
|
||||
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(!ModuleModel::getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after');
|
||||
}
|
||||
|
||||
// 2016. 1. 29: Add a column(declare_message) for report
|
||||
if(!$oDB->isColumnExists("comment_declared_log","declare_message"))
|
||||
{
|
||||
|
|
@ -150,27 +84,7 @@ class Comment extends ModuleObject
|
|||
{
|
||||
$oDB->addIndex('comments', 'idx_nick_name', array('nick_name'));
|
||||
}
|
||||
|
||||
// 2018.01.24 Improve mass file deletion
|
||||
if(!ModuleModel::getTrigger('document.moveDocumentModule', 'comment', 'controller', 'triggerMoveDocument', 'after'))
|
||||
{
|
||||
$oModuleController->insertTrigger('document.moveDocumentModule', 'comment', 'controller', 'triggerMoveDocument', 'after');
|
||||
}
|
||||
if(!ModuleModel::getTrigger('document.copyDocumentModule', 'comment', 'controller', 'triggerAddCopyDocument', 'add'))
|
||||
{
|
||||
$oModuleController->insertTrigger('document.copyDocumentModule', 'comment', 'controller', 'triggerAddCopyDocument', 'add');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Regenerate cache file
|
||||
* @return void
|
||||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
/* End of file comment.class.php */
|
||||
/* Location: ./modules/comment/comment.class.php */
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
<grants />
|
||||
<actions>
|
||||
<action name="dispCommentDeclare" type="view" permission="member" />
|
||||
|
||||
|
||||
<action name="getCommentMenu" type="model" />
|
||||
<action name="getCommentVotedMemberList" type="model" permission="root" />
|
||||
|
||||
|
||||
<action name="procCommentVoteUp" type="controller" />
|
||||
<action name="procCommentVoteUpCancel" type="controller" />
|
||||
<action name="procCommentVoteDown" type="controller" />
|
||||
|
|
@ -15,11 +15,11 @@
|
|||
<action name="procCommentDeclareCancel" type="controller" permission="member" />
|
||||
<action name="procCommentGetList" type="controller" permission="manager" check_type="comment" check_var="comment_srls" />
|
||||
<action name="procCommentInsertModuleConfig" type="controller" permission="manager" check_var="target_module_srl" ruleset="insertCommentModuleConfig" />
|
||||
|
||||
|
||||
<action name="dispCommentAdminList" type="view" admin_index="true" menu_name="comment" menu_index="true" />
|
||||
<action name="dispCommentAdminDeclared" type="view" menu_name="comment" />
|
||||
<action name="dispCommentAdminDeclaredLogByCommentSrl" type="view" menu_name="comment" />
|
||||
|
||||
|
||||
<action name="procCommentAdminChangeStatus" type="controller"/>
|
||||
<action name="procCommentAdminChangePublishedStatusChecked" type="controller" />
|
||||
<action name="procCommentAdminCancelDeclare" type="controller" />
|
||||
|
|
@ -27,6 +27,14 @@
|
|||
<action name="procCommentAdminDeleteChecked" type="controller" permission="manager" check_type="comment" check_var="cart" ruleset="deleteChecked" />
|
||||
<action name="procCommentAdminMoveToTrash" type="controller" permission="manager" check_type="comment" check_var="comment_srl" />
|
||||
</actions>
|
||||
<eventHandlers>
|
||||
<eventHandler after="document.deleteDocument" class="controller" method="triggerDeleteDocumentComments" />
|
||||
<eventHandler after="module.deleteModule" class="controller" method="triggerDeleteModuleComments" />
|
||||
<eventHandler after="module.procModuleAdminCopyModule" class="controller" method="triggerCopyModule" />
|
||||
<eventHandler after="document.moveDocumentModule" class="controller" method="triggerMoveDocument" />
|
||||
<eventHandler before="document.copyDocumentModule.each" class="controller" method="triggerAddCopyDocument" />
|
||||
<eventHandler before="module.dispAdditionSetup" class="view" method="triggerDispCommentAdditionSetup" />
|
||||
</eventHandlers>
|
||||
<menus>
|
||||
<menu name="comment">
|
||||
<title xml:lang="en">Comment</title>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue