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) git-svn-id: http://piwigo.org/svn/trunk@21567 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
parent
071036fa3a
commit
0c49940ad2
2 changed files with 26 additions and 26 deletions
|
|
@ -113,32 +113,6 @@ $eligible_templates = array(
|
||||||
|
|
||||||
$flip_templates = array_flip($eligible_templates);
|
$flip_templates = array_flip($eligible_templates);
|
||||||
|
|
||||||
/**
|
|
||||||
* returns an array contening sub-directories, excluding ".svn"
|
|
||||||
*
|
|
||||||
* @param string $dir
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
function get_dirs($directory)
|
|
||||||
{
|
|
||||||
$sub_dirs = array();
|
|
||||||
if ($opendir = opendir($directory))
|
|
||||||
{
|
|
||||||
while ($file = readdir($opendir))
|
|
||||||
{
|
|
||||||
if ($file != '.'
|
|
||||||
and $file != '..'
|
|
||||||
and is_dir($directory.'/'.$file)
|
|
||||||
and $file != '.svn')
|
|
||||||
{
|
|
||||||
array_push($sub_dirs, $file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
closedir($opendir);
|
|
||||||
}
|
|
||||||
return $sub_dirs;
|
|
||||||
}
|
|
||||||
|
|
||||||
$available_templates = array_merge(
|
$available_templates = array_merge(
|
||||||
array('N/A' => '----------'),
|
array('N/A' => '----------'),
|
||||||
get_dirs(PHPWG_ROOT_PATH.'themes'));
|
get_dirs(PHPWG_ROOT_PATH.'themes'));
|
||||||
|
|
|
||||||
|
|
@ -2456,4 +2456,30 @@ function delete_element_derivatives($infos, $type='all')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns an array contening sub-directories, excluding ".svn"
|
||||||
|
*
|
||||||
|
* @param string $dir
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function get_dirs($directory)
|
||||||
|
{
|
||||||
|
$sub_dirs = array();
|
||||||
|
if ($opendir = opendir($directory))
|
||||||
|
{
|
||||||
|
while ($file = readdir($opendir))
|
||||||
|
{
|
||||||
|
if ($file != '.'
|
||||||
|
and $file != '..'
|
||||||
|
and is_dir($directory.'/'.$file)
|
||||||
|
and $file != '.svn')
|
||||||
|
{
|
||||||
|
array_push($sub_dirs, $file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir($opendir);
|
||||||
|
}
|
||||||
|
return $sub_dirs;
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue