From dddedb83fc98b63ef16181c64ae0618bf8599aa9 Mon Sep 17 00:00:00 2001 From: Edward Date: Wed, 19 Feb 2014 15:46:31 +0800 Subject: [PATCH] MailTemplateList.php --- MailTemplateList.php | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/MailTemplateList.php b/MailTemplateList.php index 516eb492..acf8a31b 100644 --- a/MailTemplateList.php +++ b/MailTemplateList.php @@ -16,8 +16,31 @@ class Pman_Core_MailTemplateList extends Pman function get() { - $this->jdata(array(array('name' => 'aa', 'body'=> 'test'))); $fopts = HTML_FlexyFramework::get()->HTML_Template_Flexy; + + $templateDir = explode(PATH_SEPARATOR, $fopts->templateDir); + + foreach ($templateDir as $dir){ + if(!file_exists($dir . '/mail')){ + continue; + } + + if ($handle = opendir($dir . '/')) { + while (false !== ($entry = readdir($handle))) { + if ($entry == "." || $entry == "..") { + continue; + } + + echo "$entry\n"; + } + + closedir($handle); + } + + } + exit; + $this->jdata(array(array('name' => 'aa', 'body'=> 'test'))); + print_r(array_unique($fopts->templateDir)); exit; } -- 2.39.2