Changeset 21567 for trunk


Ignore:
Timestamp:
Mar 15, 2013, 11:06:38 AM (12 years ago)
Author:
plg
Message:

merge r21566 from branch 2.5 to trunk

bug 2867 fixed: move get_dirs function to a function file, so that it can be used in plugin LocalFiles Editor (see r18629)

Location:
trunk/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/extend_for_templates.php

    r19703 r21567  
    114114$flip_templates = array_flip($eligible_templates);
    115115
    116 /**
    117  * returns an array contening sub-directories, excluding ".svn"
    118  *
    119  * @param string $dir
    120  * @return array
    121  */
    122 function get_dirs($directory)
    123 {
    124   $sub_dirs = array();
    125   if ($opendir = opendir($directory))
    126   {
    127     while ($file = readdir($opendir))
    128     {
    129       if ($file != '.'
    130           and $file != '..'
    131           and is_dir($directory.'/'.$file)
    132           and $file != '.svn')
    133       {
    134         array_push($sub_dirs, $file);
    135       }
    136     }
    137     closedir($opendir);
    138   }
    139   return $sub_dirs;
    140 }
    141 
    142116$available_templates = array_merge(
    143117  array('N/A' => '----------'),
  • trunk/admin/include/functions.php

    r21070 r21567  
    24572457  }
    24582458}
     2459
     2460/**
     2461 * returns an array contening sub-directories, excluding ".svn"
     2462 *
     2463 * @param string $dir
     2464 * @return array
     2465 */
     2466function get_dirs($directory)
     2467{
     2468  $sub_dirs = array();
     2469  if ($opendir = opendir($directory))
     2470  {
     2471    while ($file = readdir($opendir))
     2472    {
     2473      if ($file != '.'
     2474          and $file != '..'
     2475          and is_dir($directory.'/'.$file)
     2476          and $file != '.svn')
     2477      {
     2478        array_push($sub_dirs, $file);
     2479      }
     2480    }
     2481    closedir($opendir);
     2482  }
     2483  return $sub_dirs;
     2484}
    24592485?>
Note: See TracChangeset for help on using the changeset viewer.