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         print_r($fopts);exit;
21         $templateDir = explode(PATH_SEPARATOR, $fopts->templateDir);
22         
23         foreach ($templateDir as $dir){
24             if(!file_exists($dir . '/mail')){
25                 continue;
26             }
27             
28             if ($handle = opendir($dir . '/')) {
29                 while (false !== ($entry = readdir($handle))) {
30                     if ($entry == "." || $entry == "..") {
31                         continue;
32                     }
33                     
34                     echo "$entry\n";
35                 }
36                 
37                 closedir($handle);
38             }
39             
40         }
41         exit;
42         $this->jdata(array(array('name' => 'aa', 'body'=> 'test')));
43         
44         print_r(array_unique($fopts->templateDir));
45         exit;
46     }
47      
48 }