Esempio n. 1
0
 function __construct($item_type, $item_dir, $view = "Default")
 {
     include_once SMARTY_PATH . 'Smarty.class.php';
     // Set up the Smarty template variable we wrap around.
     $this->tpl = new Smarty();
     $this->tpl->error_reporting = error_reporting() & ~E_NOTICE & ~E_WARNING;
     //FIXME this disables bad template code reporting 3.x
     $this->tpl->error_unassigned = true;
     // display notice when accessing unassigned variable, if warnings turned on
     //		$this->tpl->debugging = DEVELOPMENT;  // Opens up the debug console
     //Some (crappy) wysiwyg editors use php as their default initializer
     //FJD - this might break some editors...we'll see.
     $this->tpl->php_handling = SMARTY::PHP_REMOVE;
     $this->tpl->caching = false;
     $this->tpl->cache_dir = BASE . 'tmp/cache';
     $this->tpl->setPluginsDir(array(SMARTY_PATH . 'plugins', BASE . 'framework/plugins'));
     //autoload filters
     $this->tpl->autoload_filters = array('post' => array('includemiscfiles'));
     $this->viewfile = expTemplate::getViewFile($item_type, $item_dir, $view);
     $this->viewdir = realpath(dirname($this->viewfile));
     $this->module = $item_dir;
     $this->view = substr(basename($this->viewfile), 0, -4);
     //fix for the wamp/lamp issue
     //checks necessary in case a file from /views/ is used
     //should go away, the stuff should be put into a CoreModule
     //then this can be simplified
     //TODO: generate this through $this->viewfile using find BASE/THEME_ABSOLUTE and replace with ""
     //		if($item_type != "") {
     //			$this->langdir .= $item_type . "/";
     //		}
     //		if($item_dir != "") {
     //			$this->langdir .= $item_dir . "/";
     //		}
     //		$this->langdir .= "views/";
     $this->tpl->template_dir = $this->viewdir;
     $this->tpl->compile_dir = BASE . 'tmp/views_c';
     $this->tpl->compile_id = md5($this->viewfile);
     $this->tpl->assign("__view", $this->view);
     $this->tpl->assign("__redirect", expHistory::getLastNotEditable());
 }