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://' . $_SERVER['SERVER_NAME'] . $this->rootURL;
15         
16         
17         $path = '/home/edward/gitlive/web.madeinnz/Pman/Shop/templates/mail/register.body.html';
18         
19         $data = $this->convertStyle($base, $path, false);
20         
21         print_r($data);exit;
22         
23         $ret = array();
24         
25         foreach ($templateDir as $dir){
26             
27             if(!file_exists($dir . '/mail')){
28                 continue;
29             }
30               
31             if ($handle = opendir($dir . '/mail')) {
32                 while (false !== ($entry = readdir($handle))) {
33                     if ($entry == "." || $entry == ".." || !preg_match('/\.html$/', $entry)) {
34                         continue;
35                     }
36                     
37                     $path = "$dir/mail/$entry";
38                     
39                     $ret[] = array(
40                         'file' => $entry,
41                         'content' => $this->convertStyle($base, $path, false)
42                     );
43                 }
44                 
45                 closedir($handle);
46             }
47             
48         }
49
50         $this->jok($ret);
51         
52     }
53      
54 }