Preview.php
authorAlan Knowles <alan@roojs.com>
Tue, 18 Mar 2014 10:58:55 +0000 (18:58 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 18 Mar 2014 10:58:55 +0000 (18:58 +0800)
Preview.php

index a268455..c36e3c8 100644 (file)
@@ -41,6 +41,13 @@ class Pman_Builder_Preview extends Pman_Cms_Preview
            die("invalid url");
         }
         header('Content-type: text/javascript');
+        // this should outpt the file if it's found.
+        if (file_exists($m->path . '/'. $p->name .'.js')) {
+            $fh = fopen($m->path . '/'. $p->name .'.js', 'r');
+            fpassthru($fh);
+            exit;
+        }
+        
         echo $p->jsource;
         exit;
     }