/[cvs]/nfo/php/libs/org.netfrag.flib/Site/Loader.php
ViewVC logotype

Diff of /nfo/php/libs/org.netfrag.flib/Site/Loader.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by joko, Thu Dec 19 06:21:37 2002 UTC revision 1.4 by jonen, Mon Dec 23 11:33:32 2002 UTC
# Line 3  Line 3 
3  //    $Id$  //    $Id$
4  //    -------------------------------------------------------------------------  //    -------------------------------------------------------------------------
5  //    $Log$  //    $Log$
6    //    Revision 1.4  2002/12/23 11:33:32  jonen
7    //    + minor changes
8    //
9  //    Revision 1.3  2002/12/19 06:21:37  joko  //    Revision 1.3  2002/12/19 06:21:37  joko
10  //    + loadTemplate  //    + loadTemplate
11  //    + case 'template' for 'function loadComponent'  //    + case 'template' for 'function loadComponent'
# Line 20  class Site_Loader { Line 23  class Site_Loader {
23    
24    var $site;    var $site;
25    
26    function includeFile($filename) {    function includeFile($filename, $args = array()) {
27    
28      // TODO: try to remove these globals!      // TODO: try to remove these globals!
29      global $site;      global $site;
30      global $site_state;      global $site_state;
31      global $uservars;      //global $uservars;
32      global $request;      global $request;
33      global $http_referer;      global $http_referer;
34    
35        global $page_state;
36    
37      $this->site->log( get_class($this) . "->includeFile( filename $filename )", LOG_DEBUG);      $this->site->log( get_class($this) . "->includeFile( filename $filename )", LOG_DEBUG);
38      $site = &$this->site;      $site = &$this->site;
39      if (include($filename)) {      if (include($filename)) {
40        return 1;       return 1;
41      }      }
42            
43    }    }
# Line 57  class Site_Loader { Line 62  class Site_Loader {
62          $prefix = $this->site->config[path][base] . 'core/pages/';          $prefix = $this->site->config[path][base] . 'core/pages/';
63          $postfix = ".page";          $postfix = ".page";
64          $includefile = "$prefix$name$postfix";          $includefile = "$prefix$name$postfix";
65          return $this->includeFile($includefile);          return $this->includeFile($includefile, $arguments );
66          break;          break;
67    
68        case "template":        case "template":
# Line 81  class Site_Loader { Line 86  class Site_Loader {
86      return $this->loadComponent($name, "handler");      return $this->loadComponent($name, "handler");
87    }    }
88    
89    function loadPage($name) {    function loadPage($name, $args = array()) {
90      $this->site->log( get_class($this) . "->loadPage( name $name )", LOG_DEBUG);      $this->site->log( get_class($this) . "->loadPage( name $name )", LOG_DEBUG);
91      return $this->loadComponent($name, "page");      return $this->loadComponent($name, "page", $args);
92    }    }
93    
94    function loadTemplate($name, $template_variables = array(), $cache_key = "") {    function loadTemplate($name, $template_variables = array(), $cache_key = "") {
95      $this->site->log( get_class($this) . "->loadTemplate( name $name cache_key $cache_key )", LOG_DEBUG);      $this->site->log( get_class($this) . "->loadTemplate( name $name cache_key $cache_key )", LOG_DEBUG);
96      return $this->loadComponent($name, "template", array( cache_key => $cache_key, vars => $template_variables) );      return $this->loadComponent($name, "template", array( 'cache_key' => $cache_key, 'vars' => $template_variables) );
97    }    }
98    
99    function loadClass() {    function loadClass() {

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed