mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-11 09:35:00 +00:00
add hooks
This commit is contained in:
parent
dd5bc7d10e
commit
ce9bb05a0b
|
@ -52,12 +52,29 @@ if (!isset($_POST["expires"]) || $_POST["expires"] != "false") {
|
|||
$expires = mktime(0,0,0, $_POST["expmonth"], $_POST["expday"], $_POST["expyear"]);
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['setExpires'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['setExpires'] as $hookObj) {
|
||||
if (method_exists($hookObj, 'preSetExpires')) {
|
||||
$hookObj->preSetExpires(array('document'=>$document, 'expires'=>&$expires));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$document->setExpires($expires)){
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
|
||||
}
|
||||
|
||||
$document->verifyLastestContentExpriry();
|
||||
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['setExpires'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['setExpires'] as $hookObj) {
|
||||
if (method_exists($hookObj, 'postSetExpires')) {
|
||||
$hookObj->postSetExpires(array('document'=>$document, 'expires'=>$expires));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
add_log_line("?documentid=".$documentid);
|
||||
|
||||
header("Location:../out/out.ViewDocument.php?documentid=".$documentid);
|
||||
|
|
Loading…
Reference in New Issue
Block a user