MailTemplateList.php
[Pman.Core] / MailTemplateList.php
1 <?php
2
3 require_once 'Pman.php';
4
5 class Pman_Core_MailTemplateList extends Pman
6 {
7     function getAuth()
8     {
9         $au = $this->getAuthUser();
10         if (!$au) {
11             die("NOT authenticated");
12         }
13         $this->authUser = $au;
14         return true;
15     }
16
17     function get()
18     {
19         $fopts = HTML_FlexyFramework::get()->HTML_Template_Flexy;
20         
21         $templateDir = explode(PATH_SEPARATOR, $fopts['templateDir']);
22         
23         foreach ($templateDir as $dir){
24             echo "$dir <br/>";
25             if(!file_exists($dir . '/mail')){
26                 continue;
27             }
28             
29             if ($handle = opendir($dir . '/mail')) {
30                 while (false !== ($entry = readdir($handle))) {
31                     if ($entry == "." || $entry == "..") {
32                         continue;
33                     }
34                     
35                     echo "$entry <br/>";
36                 }
37                 
38                 closedir($handle);
39             }
40             
41         }
42         exit;
43         $this->jdata(array(array('name' => 'aa', 'body'=> 'test')));
44         
45         print_r(array_unique($fopts->templateDir));
46         exit;
47     }
48      
49 }