Groups can now have their own virtual directories too.

This commit is contained in:
Pierre HUBERT
2018-07-14 11:37:28 +02:00
parent 8e0eba4385
commit 86cdc3d9a8
4 changed files with 99 additions and 3 deletions

View File

@ -566,6 +566,41 @@ function getPostVirtualDirectory(string $name) : string {
}
/**
* Check wether a virtual directory is available or not
*
* @param string $name The virtual directory to check
* @param int $id The ID of the target element
* @param bool $isPage TRUE if the request is made for a page
* @return bool TRUE if the virtual directory is valid / FALSE else
*/
function checkVirtualDirectoryAvailability(string $name, int $id, bool $isPage) : bool {
if(!checkVirtualDirectoryValidity($name))
return FALSE;
if(!$isPage){
if(!components()->settings->checkUserDirectoryAvailability($name, $id))
return FALSE;
if(!components()->groups->checkDirectoryAvailability($name, -1))
return FALSE;
}
else {
if(!components()->settings->checkUserDirectoryAvailability($name, -1))
return FALSE;
if(!components()->groups->checkDirectoryAvailability($name, $id))
return FALSE;
}
//The directory seems to be valid
return TRUE;
}
/**
* Get a POST group ID
*