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         $fopts = HTML_FlexyFramework::get()->HTML_Template_Flexy;
11         
12         $templateDir = explode(PATH_SEPARATOR, $fopts['templateDir']);
13         
14         $base = 'http://' . $fopts['host'] . $this->rootURL;
15         
16         $ret = array();
17         
18         foreach ($templateDir as $dir){
19             
20             if(!file_exists($dir . '/mail')){
21                 continue;
22             }
23               
24             if ($handle = opendir($dir . '/mail')) {
25                 while (false !== ($entry = readdir($handle))) {
26                     if ($entry == "." || $entry == ".." || !preg_match('/\.html$/', $entry)) {
27                         continue;
28                     }
29                     
30                     $path = "$dir/mail/$entry";
31                     print_r($path);exit;
32                     $ret[] = array(
33                         'file' => $entry,
34                         'content' => $this->convertStyle($base, $path, false)
35                     );
36                 }
37                 
38                 closedir($handle);
39             }
40             
41         }
42         exit;
43 //        $this->jok($ret);
44         
45     }
46      
47 }