Updated helpers

This commit is contained in:
Pierre
2017-05-26 09:50:20 +02:00
parent 7a393b1644
commit 78e72542d8
4 changed files with 54 additions and 20 deletions

View File

@ -9,18 +9,23 @@
* Get and returns the URL path to an userdata file
*
* @param String $fileURI Optionnal, defines the URI pointing on the file
* @param Boolean $systemPath Optionnal, defines if system path is required instead of URL
* @return String The full URL to the userdata file
*/
function path_user_data($fileURI = ""){
return CS::get()->config->get("storage_url").$fileURI;
function path_user_data($fileURI = "", $systemPath = false){
if(!$systemPath)
return CS::get()->config->get("storage_url").$fileURI;
else
return CS::get()->config->get("storage_path").$fileURI;
}
/**
* Get and return the URL path to a specified account image
*
* @param String $imageURI Optionnal, defines URI of the image
* @param Boolean $systemPath Optionnal, defines if system path is required instead of URL
* @return String The full URL to the image account file
*/
function path_account_image($imageURI=""){
return path_user_data("avatars/".$imageURI);
function path_account_image($imageURI="", $systemPath = false){
return path_user_data(CS::get()->config->get("imageAccountPath").$imageURI, $systemPath);
}