MailTemplateList.php
[Pman.Core] / MailTemplateList.php
index 6d13abf..1ab5705 100644 (file)
@@ -1,21 +1,13 @@
 <?php
 
-require_once 'Pman.php';
+require_once 'ConvertStyle.php';
 
-class Pman_Core_MailTemplateList extends Pman
+class Pman_Core_MailTemplateList extends Pman_Core_ConvertStyle
 {
-    function getAuth()
-    {
-        $au = $this->getAuthUser();
-        if (!$au) {
-            die("NOT authenticated");
-        }
-        $this->authUser = $au;
-        return true;
-    }
-
+    
     function get()
     {
+//        print_r($this);exit;
         $fopts = HTML_FlexyFramework::get()->HTML_Template_Flexy;
         
         $templateDir = explode(PATH_SEPARATOR, $fopts['templateDir']);
@@ -27,29 +19,27 @@ class Pman_Core_MailTemplateList extends Pman
             if(!file_exists($dir . '/mail')){
                 continue;
             }
-            
-            if ($handle = opendir($dir . '/mail')) {
-                while (false !== ($entry = readdir($handle))) {
-                    if ($entry == "." || $entry == ".." || !preg_match('/\.html$/', $entry)) {
-                        continue;
-                    }
-                    
-                    $ret[] = array(
-                        'file' => $entry
-//                        'content' => file_get_contents("$dir/mail/$entry")
-                    );
-                }
-                
-                closedir($handle);
-            }
+              
+            echo dir($dir . '/mail');
+//            if ($handle = opendir($dir . '/mail')) {
+//                while (false !== ($entry = readdir($handle))) {
+//                    if ($entry == "." || $entry == ".." || !preg_match('/\.html$/', $entry)) {
+//                        continue;
+//                    }
+//                    echo "$dir/mail/$entry<br/>";
+////                    $ret[] = array(
+////                        'file' => $entry,
+////                        'content' => $this->convertStyle("$dir/mail/$entry")
+////                    );
+//                }
+//                
+//                closedir($handle);
+//            }
             
         }
-        print_r($ret);exit;
         exit;
-        $this->jdata(array(array('name' => 'aa', 'body'=> 'test')));
+//        $this->jok($ret);
         
-        print_r(array_unique($fopts->templateDir));
-        exit;
     }
      
 }