mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 20:21:16 +00:00
call hooks 'preRemoveDocument' and 'postRemoveDocument'
This commit is contained in:
parent
a4be140775
commit
945c03a8c3
|
@ -50,10 +50,16 @@ $folder = $document->getFolder();
|
|||
$nl = $document->getNotifyList();
|
||||
$docname = $document->getName();
|
||||
|
||||
$hookObjectsArr = array();
|
||||
if (is_array($GLOBALS['SEEDDMS_HOOKS']['RemoveDocument'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['RemoveDocument'] as $_classRef) {
|
||||
$_procObj = & new $_classRef;
|
||||
$ret = $_procObj->postRemoveDocument($dms, $document);
|
||||
$hookObjectsArr[] = & new $_classRef;
|
||||
}
|
||||
}
|
||||
|
||||
foreach($hookObjectsArr as $_hookObj) {
|
||||
if (method_exists($_hookObj, 'preRemoveDocument')) {
|
||||
$ret = $_hookObj->preRemoveDocument($dms, $document);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -61,6 +67,12 @@ if (!$document->remove()) {
|
|||
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("error_occured"));
|
||||
} else {
|
||||
|
||||
foreach($hookObjectsArr as $_hookObj) {
|
||||
if (method_exists($_hookObj, 'postRemoveDocument')) {
|
||||
$_hookObj->postRemoveDocument($dms, $documentid);
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove the document from the fulltext index */
|
||||
if($settings->_enableFullSearch) {
|
||||
if(!empty($settings->_luceneClassDir))
|
||||
|
|
Loading…
Reference in New Issue
Block a user