Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Add node.share.create hooks
Browse files Browse the repository at this point in the history
Signed-off-by: Etienne CHAMPETIER <etienne.champetier@fiducial.net>
  • Loading branch information
Etienne CHAMPETIER committed Nov 13, 2013
1 parent 54df2e7 commit 09766eb
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion core/src/plugins/action.share/class.ShareCenter.php
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 09766eb

Please sign in to comment.