Ejemplo n.º 1
0
 protected function initRuntimeVars(\Dwoo_ITemplate $tpl)
 {
     // call parent
     parent::initRuntimeVars($tpl);
     // set site information
     $this->globals['Site'] = array('title' => Site::$title, 'degredations' => Site::getConfig('degredations'));
     // add magic globals
     foreach (self::$magicGlobals as $name) {
         if (isset($GLOBALS[$name])) {
             $this->globals[$name] =& $GLOBALS[$name];
         } else {
             $this->globals[$name] = false;
         }
     }
     // set user
     $this->globals['User'] = !empty($GLOBALS['Session']) && $GLOBALS['Session']->Person ? $GLOBALS['Session']->Person : null;
     if (is_callable(static::$onGlobalsSet)) {
         call_user_func(static::$onGlobalsSet, $this);
     }
 }