MailTemplateList.php
[Pman.Core] / MailTemplateList.php
1 <?php
2
3 require_once 'ConvertStyle.php';
4
5 class Pman_Core_MailTemplateList extends Pman_Core_ConvertStyle
6 {
7     
8     function get()
9     {
10         print_r($this);exit;
11         $fopts = HTML_FlexyFramework::get()->HTML_Template_Flexy;
12         
13         $templateDir = explode(PATH_SEPARATOR, $fopts['templateDir']);
14         
15         $ret = array();
16         
17         foreach ($templateDir as $dir){
18             
19             if(!file_exists($dir . '/mail')){
20                 continue;
21             }
22             
23             if ($handle = opendir($dir . '/mail')) {
24                 while (false !== ($entry = readdir($handle))) {
25                     if ($entry == "." || $entry == ".." || !preg_match('/\.html$/', $entry)) {
26                         continue;
27                     }
28                     
29                     $ret[] = array(
30                         'file' => $entry,
31                         'content' => $this->convertStyle("$dir/mail/$entry")
32                     );
33                 }
34                 
35                 closedir($handle);
36             }
37             
38         }
39         
40         $this->jok($ret);
41         
42     }
43      
44 }