aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions.inc.php
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2004-01-04 10:16:36 +0000
committerz0rglub <z0rglub@piwigo.org>2004-01-04 10:16:36 +0000
commitf434e5e8f809fcc68e9a86074a8b5d96561137c2 (patch)
tree7c01a71ac022a2b14dfb206ba78194f972464269 /include/functions.inc.php
parent09da40f46184fb53b44c4b304d786d3e343d35f9 (diff)
- 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
Diffstat (limited to 'include/functions.inc.php')
-rw-r--r--include/functions.inc.php36
1 files changed, 12 insertions, 24 deletions
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 <span style="$style">$search</span>
// in the given $string.