Dotclear


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.core.php

    r1153 r706  
    3939     public $rest;       ///< <b>dcRestServer</b> dcRestServer object 
    4040     public $log;        ///< <b>dcLog</b>             dcLog object 
    41      public $tpl;        ///< <b>Twig_Environment</b>  Twig_Environment object 
    4241      
    4342     private $versions = null; 
     
    9695          $this->addFormater('xhtml', create_function('$s','return $s;')); 
    9796          $this->addFormater('wiki', array($this,'wikiTransform')); 
    98           $this->loadTemplateEnvironment(); 
    9997     } 
    10098      
     
    120118     } 
    121119      
    122      /** 
    123      Create template environment (Twig_Environment instance) 
    124       
    125      default-templates path must be added from admin|public/prepend.php with: 
    126      $core->tpl->getLoader()->addPath('PATH_TO/default-templates'); 
    127      Selected theme path must be added with: 
    128      $core->tpl->getLoader()->prependPath('PATH_TO/MY_THEME'); 
    129      */ 
    130      public function loadTemplateEnvironment() 
    131      { 
    132           $cache_dir = path::real(DC_TPL_CACHE.'/twtpl',false); 
    133           if (!is_dir($cache_dir)) { 
    134                try { 
    135                     files::makeDir($cache_dir); 
    136                } catch (Exception $e) { 
    137                     $cache_dir = false; 
    138                } 
    139           } 
    140            
    141           $this->tpl = new Twig_Environment( 
    142                new Twig_Loader_Filesystem(dirname(__FILE__).'/../swf'), 
    143                array( 
    144                     'auto_reload' => true, 
    145                     'autoescape' => false, 
    146                     'base_template_class' => 'Twig_Template', 
    147                     'cache' => $cache_dir,  
    148                     'charset' => 'UTF-8', 
    149                     'debug' => DC_DEBUG, 
    150                     'optimizations' => -1, 
    151                     'strict_variables' => 0 //DC_DEBUG // Please fix undefined variables! 
    152                ) 
    153           ); 
    154           $this->tpl->addExtension(new dcFormExtension($this)); 
    155           $this->tpl->addExtension(new dcTabExtension($this)); 
    156      } 
    157120      
    158121     /// @name Blog init methods 
Note: See TracChangeset for help on using the changeset viewer.

Sites map