mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-15 06:01:19 +00:00
get parameters from view right before used
allows to modify those parameters in preEditFolder hook
This commit is contained in:
parent
7563ebdbf7
commit
9720703c37
|
@ -27,28 +27,26 @@ class SeedDMS_Controller_EditFolder extends SeedDMS_Controller_Common {
|
||||||
$user = $this->params['user'];
|
$user = $this->params['user'];
|
||||||
$settings = $this->params['settings'];
|
$settings = $this->params['settings'];
|
||||||
$folder = $this->params['folder'];
|
$folder = $this->params['folder'];
|
||||||
$name = $this->params['name'];
|
|
||||||
$comment = $this->params['comment'];
|
|
||||||
$sequence = $this->params['sequence'];
|
|
||||||
$attributes = $this->params['attributes'];
|
|
||||||
|
|
||||||
/* Get the document id and name before removing the document */
|
if(false === $this->callHook('preEditFolder')) {
|
||||||
$foldername = $folder->getName();
|
if(empty($this->errormsg))
|
||||||
$folderid = $folder->getID();
|
$this->errormsg = 'hook_preEditFolder_failed';
|
||||||
|
return null;
|
||||||
if(!$this->callHook('preEditFolder')) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->callHook('editFolder', $folder);
|
$result = $this->callHook('editFolder', $folder);
|
||||||
if($result === null) {
|
if($result === null) {
|
||||||
|
$name = $this->params['name'];
|
||||||
if(($oldname = $folder->getName()) != $name)
|
if(($oldname = $folder->getName()) != $name)
|
||||||
if(!$folder->setName($name))
|
if(!$folder->setName($name))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
$comment = $this->params['comment'];
|
||||||
if(($oldcomment = $folder->getComment()) != $comment)
|
if(($oldcomment = $folder->getComment()) != $comment)
|
||||||
if(!$folder->setComment($comment))
|
if(!$folder->setComment($comment))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
$attributes = $this->params['attributes'];
|
||||||
$oldattributes = $folder->getAttributes();
|
$oldattributes = $folder->getAttributes();
|
||||||
if($attributes) {
|
if($attributes) {
|
||||||
foreach($attributes as $attrdefid=>$attribute) {
|
foreach($attributes as $attrdefid=>$attribute) {
|
||||||
|
@ -78,6 +76,7 @@ class SeedDMS_Controller_EditFolder extends SeedDMS_Controller_Common {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$sequence = $this->params['sequence'];
|
||||||
if(strcasecmp($sequence, "keep")) {
|
if(strcasecmp($sequence, "keep")) {
|
||||||
if($folder->setSequence($sequence)) {
|
if($folder->setSequence($sequence)) {
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user