function import() { $res = $this->oStorage->init(); if (PEAR::isError($res)) { $this->oStorage->cleanup(); return $res; } $res = $this->_importfolder($this->oFolder, "/"); if (PEAR::isError($res)) { $this->oStorage->cleanup(); return $res; } if (count($this->uploadedDocs) > 0) { // Bulk action subscription notification $oSubscriptionEvent = new SubscriptionEvent(); $oSubscriptionEvent->notifyBulkDocumentAction($this->uploadedDocs, 'AddDocument', $this->oFolder); } elseif (count($this->uploadedFolders) > 0) { $oSubscriptionEvent = new SubscriptionEvent(); $oSubscriptionEvent->notifyBulkDocumentAction($this->uploadedFolders, 'AddFolder', $this->oFolder); } $this->oStorage->cleanup(); return; }
function do_notification($objects, $eventAction, $targetFolder) { // Make sure there were documents/folders affected if ($targetFolder && count($objects) > 0 && $eventAction != '') { $oSubscriptionEvent = new SubscriptionEvent(); $oSubscriptionEvent->notifyBulkDocumentAction($objects, $eventAction, $targetFolder); } }