Preview.php
[Pman.Builder] / Preview.php
1 <?php
2 /**
3  * extends the CMS preview  - but should take the template from the builder..
4  * intended use is with the bootstrap code HTML generated..
5  *
6 */
7 require_once 'Pman/Cms/Preview.php';
8
9 class Pman_Builder_Preview extends Pman_Cms_Preview
10 {
11     
12     
13     function loadPage($prefix, $name, $default = false)
14     {
15         //var_dump($name, $default);
16         //DB_DataObject::debugLevel(5);
17         parent::loadPage($prefix, $name, $default );
18         
19         
20         // template...
21         
22         // menus????
23         
24          
25     }
26     
27     function outputBody()
28     {
29         
30         $proj = HTML_FlexyFramework::get()->project;
31         // DB_DataObject::debugLevel(1);
32         $m = DB_DAtaObject::factory('Builder_modules');
33         $m->get('name', $proj );
34         
35         // needs to modify the template directory??
36         // use the builder_module == app name
37         // look for part with same name.
38         $template_engine = new HTML_Template_Flexy(array(
39             'templateDir' => $m->path
40         ));
41         $template_engine->compile($this->template);
42         if ($this->elements) { /* BC crap! */
43             $this->elements = HTML_Template_Flexy_Factory::setErrors($this->elements,$this->errors);
44         }
45         $template_engine->elements = $this->elements;
46         $template_engine->outputObject($this,$this->elements);
47         
48         
49         
50     }
51 }