mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 21:21:27 +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();
|
$nl = $document->getNotifyList();
|
||||||
$docname = $document->getName();
|
$docname = $document->getName();
|
||||||
|
|
||||||
|
$hookObjectsArr = array();
|
||||||
if (is_array($GLOBALS['SEEDDMS_HOOKS']['RemoveDocument'])) {
|
if (is_array($GLOBALS['SEEDDMS_HOOKS']['RemoveDocument'])) {
|
||||||
foreach($GLOBALS['SEEDDMS_HOOKS']['RemoveDocument'] as $_classRef) {
|
foreach($GLOBALS['SEEDDMS_HOOKS']['RemoveDocument'] as $_classRef) {
|
||||||
$_procObj = & new $_classRef;
|
$hookObjectsArr[] = & new $_classRef;
|
||||||
$ret = $_procObj->postRemoveDocument($dms, $document);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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"));
|
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("error_occured"));
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
foreach($hookObjectsArr as $_hookObj) {
|
||||||
|
if (method_exists($_hookObj, 'postRemoveDocument')) {
|
||||||
|
$_hookObj->postRemoveDocument($dms, $documentid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Remove the document from the fulltext index */
|
/* Remove the document from the fulltext index */
|
||||||
if($settings->_enableFullSearch) {
|
if($settings->_enableFullSearch) {
|
||||||
if(!empty($settings->_luceneClassDir))
|
if(!empty($settings->_luceneClassDir))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user