initial code for extensions and hooks

This commit is contained in:
Uwe Steinmann 2013-04-17 11:01:03 +02:00
parent a8f3c7be59
commit 17b2e06fe9
2 changed files with 19 additions and 0 deletions

11
ext/example/conf.php Normal file
View File

@ -0,0 +1,11 @@
<?php
$_GLOBALS['SEEDDMS_EXT']['example'] = array(
'title' => 'Example Extension',
'description' => 'Example Extension',
'version' => '1.0.0',
'author' => array('name'=>'Uwe Steinmann', 'email'=>'uwe@steinmann.cx', 'company'=>'MMK GmbH'),
'constraints' => array(
'depends' => array('php' => '5.4.4-', 'seeddms' => '4.2.0-'),
),
);
?>

View File

@ -49,6 +49,14 @@ $folder = $document->getFolder();
/* Get the notify list before removing the document */
$nl = $document->getNotifyList();
$docname = $document->getName();
if (is_array($GLOBALS['SEEDDMS_HOOKS']['RemoveDocument'])) {
foreach($GLOBALS['SEEDDMS_HOOKS']['RemoveDocument'] as $_classRef) {
$_procObj = & new $_classRef;
$ret = $_procObj->postRemoveDocument($dms, $document);
}
}
if (!$document->remove()) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("error_occured"));
} else {