Version 0.9 ()
------------------------------------------------------------------------
+ * Make template directory allow to contain subdirectories with more
+ templates. This allows you to symbolically link the "additional_themes"
+ CVS directory within your templates path, just like you can do
+ with the "additional_plugins" directory already (garvinhicking)
+
* Allow UTF-8 recoding using mb_* functions (Tadashi Jokagi)
* Allow to switch charsets ("Native" / "UTF-8"). (garvinhicking)
return serendipity_mb('ucfirst', serendipity_strftime($cache[$format], (int)$time, $useOffset));
}
-function serendipity_fetchTemplates() {
+function serendipity_fetchTemplates($dir = '') {
global $serendipity;
- $dir = opendir($serendipity['serendipityPath'] . $serendipity['templatePath']);
- while (($file = readdir($dir)) !== false) {
- if (is_dir($serendipity['serendipityPath'] . $serendipity['templatePath'] . $file) && !ereg('^(\.|CVS)', $file) && !file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $file . '/inactive.txt') && file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $file . '/info.txt')) {
- $rv[] = $file;
+
+ $cdir = opendir($serendipity['serendipityPath'] . $serendipity['templatePath'] . $dir);
+ $rv = array();
+ while (($file = readdir($cdir)) !== false) {
+ if (is_dir($serendipity['serendipityPath'] . $serendipity['templatePath'] . $dir . $file) && !ereg('^(\.|CVS)', $file) && !file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $dir . $file . '/inactive.txt')) {
+ if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $dir . $file . '/info.txt')) {
+ $rv[] = $dir . $file;
+ } else {
+ $temp = serendipity_fetchTemplates($dir . $file . '/');
+ if (count($temp) > 0) {
+ $rv = array_merge($rv, $temp);
+ }
+ }
}
}
+ closedir($cdir);
natcasesort($rv);
return $rv;
}