diff --git a/core/src/plugins/action.share/class.ShareCenter.php b/core/src/plugins/action.share/class.ShareCenter.php index 4291161ee8..d954bcf080 100644 --- a/core/src/plugins/action.share/class.ShareCenter.php +++ b/core/src/plugins/action.share/class.ShareCenter.php @@ -604,6 +604,13 @@ public function writePubliclet(&$data, $accessDriver, $repository) "limit" => $data['DOWNLOAD_LIMIT'], "repo_uuid" => $copy->uuid )); + AJXP_Controller::applyHook("node.share.create", array( + 'type' => 'file', + 'repository' => &$copy, + 'accessDriver' => &$accessDriver, + 'data' => &$data, + 'url' => $url, + )); return array($hash, $url); } @@ -1031,9 +1038,18 @@ public function createSharedMinisite($httpVars, $repository, $accessDriver) return "Can't write to PUBLIC URL"; } @chmod($downloadFolder."/".$hash.".php", 0755); + $url = $this->buildPublicletLink($hash); - return array($hash, $this->buildPublicletLink($hash)); + AJXP_Controller::applyHook("node.share.create", array( + 'type' => 'minisite', + 'repository' => &$repository, + 'accessDriver' => &$accessDriver, + 'data' => &$data, + 'url' => $url, + 'new_repository' => &$newRepo + )); + return array($hash, $url); } /** @@ -1310,6 +1326,15 @@ public function createSharedRepository($httpVars, $repository, $accessDriver, $u AuthService::updateRole($grRole); } + if (array_key_exists("minisite", $httpVars) && $httpVars["minisite"] != true) { + AJXP_Controller::applyHook("node.share.create", array( + 'type' => 'repository', + 'repository' => &$repository, + 'accessDriver' => &$accessDriver, + 'new_repository' => &$newRepo + )); + } + return $newRepo; }