From f434e5e8f809fcc68e9a86074a8b5d96561137c2 Mon Sep 17 00:00:00 2001 From: z0rglub Date: Sun, 4 Jan 2004 10:16:36 +0000 Subject: - no need of last '/' for get_dirs parameter - remove function get_themes git-svn-id: http://piwigo.org/svn/branches/release-1_3@264 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions.inc.php | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) (limited to 'include') diff --git a/include/functions.inc.php b/include/functions.inc.php index 8f0011756..7ff3eda67 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -157,23 +157,27 @@ function get_filename_wo_extension( $filename ) return substr( $filename, 0, strrpos( $filename, '.' ) ); } -// get_dirs retourne un tableau contenant tous les sous-répertoires d'un -// répertoire -function get_dirs( $rep ) +/** + * returns an array contening sub-directories + * + * @param string $dir + * @return array + */ +function get_dirs( $directory ) { - $sub_rep = array(); + $sub_dirs = array(); - if ( $opendir = opendir ( $rep ) ) + if ( $opendir = opendir( $directory ) ) { while ( $file = readdir ( $opendir ) ) { - if ( $file != '.' and $file != '..' and is_dir ( $rep.$file ) ) + if ( $file != '.' and $file != '..' and is_dir ( $directory.'/'.$file ) ) { - array_push( $sub_rep, $file ); + array_push( $sub_dirs, $file ); } } } - return $sub_rep; + return $sub_dirs; } // The get_picture_size function return an array containing : @@ -256,22 +260,6 @@ function get_languages( $rep_language ) return $languages; } -// get_themes retourne un tableau contenant tous les "template - couleur" -function get_themes( $theme_dir ) -{ - $themes = array(); - $main_themes = get_dirs( $theme_dir ); - for ( $i = 0; $i < sizeof( $main_themes ); $i++ ) - { - $colors = get_dirs( $theme_dir.$main_themes[$i].'/' ); - for ( $j = 0; $j < sizeof( $colors ); $j++ ) - { - array_push( $themes, $main_themes[$i].' - '.$colors[$j] ); - } - } - return $themes; -} - // - add_style replaces the // $search into $search // in the given $string. -- cgit v1.2.3