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