Plugin Directory


Ignore:
Timestamp:
01/29/2010 02:34:53 PM (16 years ago)
Author:
Txanny
Message:

Released SidePosts 3.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sideposts/trunk/framework/lib/filesystem.php

    r196960 r199488  
    126126function ak_dir_content($directory, $args='')
    127127{
     128
    128129    $directory = realpath($directory); // Be sure the directory path is well formed.
    129130    if ( ! is_dir($directory) ) {      // Check if it is a directory.
     
    164165    }
    165166    $d->close();
    166     sort($dir_tree);
     167    asort($dir_tree);
    167168
    168169    return $dir_tree;
    169170}
     171
     172/**
     173 * Returns a list of templates found in an array of directories
     174 *
     175 * @param array|string $folders Array of folders to search in.
     176 * @return array Found templates (all found php files).
     177 */
     178function ak_get_templates( $folders )
     179{
     180    $paths = array();
     181    foreach ( (array) $folders as $folder ) {
     182        $templates = ak_dir_content($folder, 'tree=0&extensions=php&with_ext=0');
     183        $paths = array_merge($templates, $paths);
     184    }
     185
     186    return $paths;
     187}
Note: See TracChangeset for help on using the changeset viewer.