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