| | 549 | class jSelectorVTpl extends jSelectorModule { |
|---|
| | 550 | protected $type = 'tpl'; |
|---|
| | 551 | protected $_dirname = 'classes/'; |
|---|
| | 552 | protected $_suffix = '.tpl'; |
|---|
| | 553 | protected $_where; |
|---|
| | 554 | public $outputType=''; |
|---|
| | 555 | public $trusted=true; |
|---|
| | 556 | public $_dyn = true; |
|---|
| | 557 | function __construct($sel, $outputtype='', $trusted=true) { |
|---|
| | 558 | if($outputtype == ''){ |
|---|
| | 559 | if($GLOBALS['gJCoord']->response) |
|---|
| | 560 | $this->outputType = $GLOBALS['gJCoord']->response->getFormatType(); |
|---|
| | 561 | else |
|---|
| | 562 | $this->outputType = $GLOBALS['gJCoord']->request->defaultResponseType; |
|---|
| | 563 | } else |
|---|
| | 564 | $this->outputType = $outputtype; |
|---|
| | 565 | $this->trusted = $trusted; |
|---|
| | 566 | $this->_compiler='jVTplCompiler'; |
|---|
| | 567 | $this->_compilerPath=JELIX_LIB_PATH.'tpl/jTplCompiler.class.php'; |
|---|
| | 568 | parent::__construct($sel); |
|---|
| | 569 | } |
|---|
| | 570 | protected function _createPath(){ |
|---|
| | 571 | global $gJConfig; |
|---|
| | 572 | if(!isset($gJConfig->_modulesPathList[$this->module])){ |
|---|
| | 573 | throw new jExceptionSelector('jelix~errors.selector.module.unknow', $this->toString()); |
|---|
| | 574 | } |
|---|
| | 575 | $path = $this->module.'/'.$this->resource; |
|---|
| | 576 | // pas d'overload via themes/ |
|---|
| | 577 | // pas de local |
|---|
| | 578 | $this->_path = $gJConfig->_modulesPathList[$this->module].$this->_dirname.'dynTpl.class.php'; |
|---|
| | 579 | if(is_readable($this->_path)){ |
|---|
| | 580 | $this->_where = 'modules/'.$path; |
|---|
| | 581 | return; |
|---|
| | 582 | } |
|---|
| | 583 | throw new jExceptionSelector('jelix~errors.selector.invalid.target', array($this->toString(), "dyn template")); |
|---|
| | 584 | } |
|---|
| | 585 | protected function _createCachePath(){ |
|---|
| | 586 | $this->_cachePath = JELIX_APP_TEMP_PATH.'compiled/templates/'.$this->_where.'_'.$this->outputType.($this->trusted?'_t':'').$this->_cacheSuffix; |
|---|
| | 587 | } |
|---|
| | 588 | } |
|---|