aboutsummaryrefslogtreecommitdiffstats
path: root/admin/extend_for_templates.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2012-10-12 20:00:16 +0000
committerrvelices <rv-github@modusoptimus.com>2012-10-12 20:00:16 +0000
commit267c548896d1e16ace40b6c1cb4df5913ac0bfa4 (patch)
tree08717cfd200a8beecdacf6d9492efd9e65e785b3 /admin/extend_for_templates.php
parent5a061cb37dcd224f4fd33ebe2845660d6d327b38 (diff)
- remove unsed code; shorten existing code and improve readability ...
git-svn-id: http://piwigo.org/svn/trunk@18629 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/extend_for_templates.php')
-rw-r--r--admin/extend_for_templates.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/admin/extend_for_templates.php b/admin/extend_for_templates.php
index 1cd28b663..e2faa370a 100644
--- a/admin/extend_for_templates.php
+++ b/admin/extend_for_templates.php
@@ -113,6 +113,32 @@ $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'));