| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | require_once(dirname(__FILE__) . "/../ConfigUtil.class.php"); |
|---|
| 4 | $cfg = new ConfigUtil(); |
|---|
| 5 | $cfg->load("views.Servlet"); |
|---|
| 6 | |
|---|
| 7 | class StandardForm extends Servlet{ |
|---|
| 8 | var $fields; |
|---|
| 9 | var $blocks; |
|---|
| 10 | |
|---|
| 11 | function mergeField($name, $value){ |
|---|
| 12 | $this->fields[$name] = $value; |
|---|
| 13 | } |
|---|
| 14 | function mergeBlock($name, $block){ |
|---|
| 15 | $this->blocks[$name] = $block; |
|---|
| 16 | } |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | function processRequest(){ |
|---|
| 20 | |
|---|
| 21 | $this->loadTemplate("index"); |
|---|
| 22 | parent::processRequest(); |
|---|
| 23 | |
|---|
| 24 | $this->mergeField('top','template_top.html'); |
|---|
| 25 | $this->mergeField('template_menu','template_menu.html'); |
|---|
| 26 | $this->mergeField('template_ad', 'template_ad_small.html'); |
|---|
| 27 | $this->mergeField('template_download' , ''); |
|---|
| 28 | $active = ($_GET['active']?$_GET['active']:'home'); |
|---|
| 29 | $this->mergeField('active',$active); |
|---|
| 30 | $this->mergeField('template_page',('page_'.$active.'.html')); |
|---|
| 31 | $this->mergeField('template_footer','template_footer.html'); |
|---|
| 32 | $this->mergeField('ad_728x90','ad_728x90.html'); |
|---|
| 33 | $this->mergeField('ad_200x200','ad_200x200.html'); |
|---|
| 34 | $this->mergeField('site_name','site_name.html'); |
|---|
| 35 | $this->mergeField('site_slogan','site_slogan.html'); |
|---|
| 36 | $this->mergeField('site_copyright','site_copyright.html'); |
|---|
| 37 | $this->mergeField('link_xhtml','link_xhtml.html'); |
|---|
| 38 | $this->mergeField('link_rss','link_rss.html'); |
|---|
| 39 | $this->mergeField('link_css','link_css.html'); |
|---|
| 40 | $this->mergeField('link_language','link_language.html'); |
|---|
| 41 | $this->mergeField('link_powerdby','link_powerdby.html'); |
|---|
| 42 | //$this->mergeField('vmenu', 'template_vmenu.html'); |
|---|
| 43 | |
|---|
| 44 | //$this->mergeField('vmenu', ''); |
|---|
| 45 | $this->mergeField('template', 'templates/default'); |
|---|
| 46 | $this->mergeField('title','UMIT v0.1 | '); |
|---|
| 47 | $this->pageExists($active); |
|---|
| 48 | $this->_preProcess(); |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | foreach($this->fields as $key=>$value){ |
|---|
| 53 | $this->tbs->MergeField($key, $value); |
|---|
| 54 | } |
|---|
| 55 | |
|---|
| 56 | foreach($this->blocks as $key=>$value){ |
|---|
| 57 | $this->tbs->MergeBlock($key, $value); |
|---|
| 58 | } |
|---|
| 59 | |
|---|
| 60 | } |
|---|
| 61 | |
|---|
| 62 | function pageExists($active){ |
|---|
| 63 | |
|---|
| 64 | //if (!file_exists($path_m.'pages/'.$active.'.php')){ |
|---|
| 65 | // $this->mergeField('template_page', 'page_404.html'); |
|---|
| 66 | //$active = '404'; |
|---|
| 67 | //} |
|---|
| 68 | } |
|---|
| 69 | } |
|---|
| 70 | ?> |
|---|
| 71 | |
|---|