aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2013-03-15 10:06:38 +0000
committerplegall <plg@piwigo.org>2013-03-15 10:06:38 +0000
commit0c49940ad2efbc1c2ad8d8a7ae9432c10173932f (patch)
tree64655a5f8fde388c7f558f9839cbca8ac6d5a9e0 /admin
parent071036fa3ac278bbe4cc412b6853dd243fa68d44 (diff)
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
Diffstat (limited to 'admin')
-rw-r--r--admin/extend_for_templates.php26
-rw-r--r--admin/include/functions.php26
2 files changed, 26 insertions, 26 deletions
diff --git a/admin/extend_for_templates.php b/admin/extend_for_templates.php
index cb2845adc..0faced402 100644
--- a/admin/extend_for_templates.php
+++ b/admin/extend_for_templates.php
@@ -113,32 +113,6 @@ $eligible_templates = array(
$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(
array('N/A' => '----------'),
get_dirs(PHPWG_ROOT_PATH.'themes'));
diff --git a/admin/include/functions.php b/admin/include/functions.php
index 957ef086e..4e53d09e6 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -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;
+}
?> \ No newline at end of file