aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
Diffstat (limited to 'admin')
-rw-r--r--admin/extend_for_templates.php33
-rw-r--r--admin/include/functions.php28
2 files changed, 28 insertions, 33 deletions
diff --git a/admin/extend_for_templates.php b/admin/extend_for_templates.php
index 938b83fed..294d600af 100644
--- a/admin/extend_for_templates.php
+++ b/admin/extend_for_templates.php
@@ -36,39 +36,6 @@
*/
// +-----------------------------------------------------------------------+
-// | functions |
-// +-----------------------------------------------------------------------+
-
-/**
- * returns a list of templates currently available in template-extension
- *
- * Each .tpl file is extracted from template-extension.
- *
- * @return array
- */
-function get_extents($start='')
-{
- if ($start == '') { $start = './template-extension'; }
- $dir = opendir($start);
- $extents = array();
-
- while (($file = readdir($dir)) !== false)
- {
- if ( $file == '.' or $file == '..' or $file == '.svn') continue;
- $path = $start . '/' . $file;
- if (is_dir($path))
- {
- $extents = array_merge($extents, get_extents($path));
- }
- elseif ( !is_link($path) and file_exists($path)
- and strripos($path,'.tpl') > 0 )
- {
- $extents[] = substr($path, 21);
- }
- }
- return $extents;
-}
-// +-----------------------------------------------------------------------+
// initialization |
// +-----------------------------------------------------------------------+
diff --git a/admin/include/functions.php b/admin/include/functions.php
index fb482c3aa..b239b08a1 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -1788,4 +1788,32 @@ function get_user_access_level_html_options($MinLevelAccess = ACCESS_FREE, $MaxL
return $tpl_options;
}
+/**
+ * returns a list of templates currently available in template-extension
+ * Each .tpl file is extracted from template-extension.
+ * @return array
+ */
+function get_extents($start='')
+{
+ if ($start == '') { $start = './template-extension'; }
+ $dir = opendir($start);
+ $extents = array();
+
+ while (($file = readdir($dir)) !== false)
+ {
+ if ( $file == '.' or $file == '..' or $file == '.svn') continue;
+ $path = $start . '/' . $file;
+ if (is_dir($path))
+ {
+ $extents = array_merge($extents, get_extents($path));
+ }
+ elseif ( !is_link($path) and file_exists($path)
+ and get_extension($path) == 'tpl' )
+ {
+ $extents[] = substr($path, 21);
+ }
+ }
+ return $extents;
+}
+
?> \ No newline at end of file