mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
call postAddSubfolder, add folder to fulltext index
This commit is contained in:
parent
df29339c28
commit
8bc8b3ae13
|
@ -33,7 +33,7 @@ class SeedDMS_Controller_AddSubFolder extends SeedDMS_Controller_Common {
|
|||
if(false === $this->callHook('preAddSubFolder')) {
|
||||
if(empty($this->errormsg))
|
||||
$this->errormsg = 'hook_preAddSubFolder_failed';
|
||||
return null;
|
||||
return false;
|
||||
}
|
||||
|
||||
$name = $this->getParam('name');
|
||||
|
@ -61,8 +61,8 @@ class SeedDMS_Controller_AddSubFolder extends SeedDMS_Controller_Common {
|
|||
$notificationgroups = $this->getParam('notificationgroups');
|
||||
$notificationusers = $this->getParam('notificationusers');
|
||||
|
||||
$result = $this->callHook('addSubFolder');
|
||||
if($result === null) {
|
||||
$subFolder = $this->callHook('addSubFolder');
|
||||
if($subFolder === null) {
|
||||
$subFolder = $folder->addSubFolder($name, $comment, $user, $sequence, $attributes);
|
||||
if (!is_object($subFolder)) {
|
||||
$this->errormsg = "error_occured";
|
||||
|
@ -77,13 +77,27 @@ class SeedDMS_Controller_AddSubFolder extends SeedDMS_Controller_Common {
|
|||
if($subFolder->getGroupAccessMode($notgroup) >= M_READ)
|
||||
$res = $subFolder->addNotify($notgroup->getID(), false);
|
||||
}
|
||||
|
||||
if(!$this->callHook('postAddSubFolder', $subFolder)) {
|
||||
}
|
||||
$result = $subFolder;
|
||||
} elseif($subFolder === false) {
|
||||
if(empty($this->errormsg))
|
||||
$this->errormsg = 'hook_addFolder_failed';
|
||||
return false;
|
||||
}
|
||||
|
||||
return $result;
|
||||
if($fulltextservice && ($index = $fulltextservice->Indexer()) && $document) {
|
||||
$idoc = $fulltextservice->IndexedDocument($subFolder);
|
||||
if(false !== $this->callHook('preIndexFolder', $document, $idoc)) {
|
||||
$index->addDocument($idoc);
|
||||
$index->commit();
|
||||
}
|
||||
}
|
||||
|
||||
if(false === $this->callHook('postAddSubFolder', $subFolder)) {
|
||||
if(empty($this->errormsg))
|
||||
$this->errormsg = 'hook_postAddSubFoder_failed';
|
||||
return false;
|
||||
}
|
||||
|
||||
return $subFolder;
|
||||
} /* }}} */
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user