Changeset 264


Ignore:
Timestamp:
Jan 4, 2004, 11:16:36 AM (20 years ago)
Author:
z0rglub
Message:
  • no need of last '/' for get_dirs parameter
  • remove function get_themes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/release-1_3/include/functions.inc.php

    r243 r264  
    158158}
    159159
    160 // get_dirs retourne un tableau contenant tous les sous-répertoires d'un
    161 // répertoire
    162 function get_dirs( $rep )
    163 {
    164   $sub_rep = array();
    165 
    166   if ( $opendir = opendir ( $rep ) )
     160/**
     161 * returns an array contening sub-directories
     162 *
     163 * @param string $dir
     164 * @return array
     165 */
     166function get_dirs( $directory )
     167{
     168  $sub_dirs = array();
     169
     170  if ( $opendir = opendir( $directory ) )
    167171  {
    168172    while ( $file = readdir ( $opendir ) )
    169173    {
    170       if ( $file != '.' and $file != '..' and is_dir ( $rep.$file ) )
     174      if ( $file != '.' and $file != '..' and is_dir ( $directory.'/'.$file ) )
    171175      {
    172         array_push( $sub_rep, $file );
     176        array_push( $sub_dirs, $file );
    173177      }
    174178    }
    175179  }
    176   return $sub_rep;
     180  return $sub_dirs;
    177181}
    178182
     
    257261}
    258262
    259 // get_themes retourne un tableau contenant tous les "template - couleur"
    260 function get_themes( $theme_dir )
    261 {
    262   $themes = array();
    263   $main_themes = get_dirs( $theme_dir );
    264   for ( $i = 0; $i < sizeof( $main_themes ); $i++ )
    265   {
    266     $colors = get_dirs( $theme_dir.$main_themes[$i].'/' );
    267     for ( $j = 0; $j < sizeof( $colors ); $j++ )
    268     {
    269       array_push( $themes, $main_themes[$i].' - '.$colors[$j] );
    270     }
    271   }
    272   return $themes;
    273 }
    274 
    275263// - add_style replaces the
    276264//         $search  into <span style="$style">$search</span>
Note: See TracChangeset for help on using the changeset viewer.