MessagePreview.php
[Pman.Core] / MessagePreview.php
index 68550ba..e5a4f2f 100644 (file)
@@ -1,17 +1,36 @@
 <?php
 
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+require_once 'Pman.php';
 
-/**
- * Description of MessagePreview
- *
- * @author edward
- */
-class MessagePreview {
-    //put your code here
-}
+class Pman_Core_MessagePreview extends Pman
+{
+    var $masterTemplate = 'mail/MessagePreview.html';
+    
+    function getAuth()
+    {
+        if (HTML_FlexyFramework::get()->cli) {
+            return true;
+        }
+        $this->authUser = $this->getAuthUser();
+        if (!$this->authUser) {
+            return false;
+        }
+        return true;
+    }
+    
+    function get()
+    {
+        if(empty($_REQUEST['_id'])){
+            $this->jerr('Missing Options');
+        }
+        
+        $mlq = DB_DataObject::factory('core_email');
+        
+        $mlq->get($_REQUEST['_id']);
+        
+        $this->msg = $mlq;
 
-?>
+        $this->showHtml = isset($_REQUEST['_as_html']) ? true : false;
+        
+    }
+}