add get_category_directories function

git-svn-id: http://piwigo.org/svn/branches/release-1_3@270 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
z0rglub
2004-01-10 23:17:51 +00:00
parent 185b2c2596
commit 1592a942f0
+27
View File
@@ -927,4 +927,31 @@ function is_user_allowed( $category_id, $restrictions )
// no restriction found : the user is allowed to access this category
return 0;
}
/**
* returns an array containing sub-directories which can be a category
*
* directories nammed "thumbnail" are omitted
*
* @param string $basedir
* @return array
*/
function get_category_directories( $basedir )
{
$sub_dirs = array();
if ( $opendir = opendir( $basedir ) )
{
while ( $file = readdir( $opendir ) )
{
if ( $file != '.' and $file != '..'
and is_dir( $basedir.'/'.$file )
and $file != 'thumbnail' )
{
array_push( $sub_dirs, $file );
}
}
}
return $sub_dirs;
}
?>