Changeset 611
- Timestamp:
- 10/15/07 22:22:37 (1 year ago)
- Files:
-
- branches/1.0beta3.x/lib/jelix/plugins/tpl/html/block.form.php (modified) (1 diff)
- branches/1.0beta3.x/lib/jelix/plugins/tpl/html/block.form.php (modified) (1 diff)
- branches/1.0beta3.x/lib/jelix/tpl/jTpl.class.php (modified) (4 diffs)
- branches/1.0beta3.x/lib/jelix/tpl/jTpl.class.php (modified) (4 diffs)
- branches/1.0beta3.x/lib/jelix/tpl/jTplCompiler.class.php (modified) (2 diffs)
- branches/1.0beta3.x/lib/jelix/tpl/jTplCompiler.class.php (modified) (2 diffs)
- trunk/lib/jelix/plugins/tpl/html/block.form.php (modified) (1 diff)
- trunk/lib/jelix/plugins/tpl/html/block.form.php (modified) (1 diff)
- trunk/lib/jelix/tpl/jTpl.class.php (modified) (4 diffs)
- trunk/lib/jelix/tpl/jTpl.class.php (modified) (4 diffs)
- trunk/lib/jelix/tpl/jTplCompiler.class.php (modified) (2 diffs)
- trunk/lib/jelix/tpl/jTplCompiler.class.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0beta3.x/lib/jelix/plugins/tpl/html/block.form.php
r602 r611 56 56 $t->_privateVars[\'__formbuilder\']->outputHeader(array('.$errdecorator.','.$helpdecorator.')); 57 57 $t->_privateVars[\'__displayed_ctrl\'] = array(); 58 if($GLOBALS[\'gJCoord\']->response!= null){ 58 '; 59 $compiler->addMetaContent('if($GLOBALS[\'gJCoord\']->response!= null){ 59 60 $GLOBALS[\'gJCoord\']->response->addJSLink($GLOBALS[\'gJConfig\']->urlengine[\'jelixWWWPath\'].\'js/jforms.js\'); 60 61 $GLOBALS[\'gJCoord\']->response->addCSSLink($GLOBALS[\'gJConfig\']->urlengine[\'jelixWWWPath\'].\'design/jform.css\'); 61 62 } 62 ' ;63 '); 63 64 64 65 return $content; branches/1.0beta3.x/lib/jelix/plugins/tpl/html/block.form.php
r602 r611 56 56 $t->_privateVars[\'__formbuilder\']->outputHeader(array('.$errdecorator.','.$helpdecorator.')); 57 57 $t->_privateVars[\'__displayed_ctrl\'] = array(); 58 if($GLOBALS[\'gJCoord\']->response!= null){ 58 '; 59 $compiler->addMetaContent('if($GLOBALS[\'gJCoord\']->response!= null){ 59 60 $GLOBALS[\'gJCoord\']->response->addJSLink($GLOBALS[\'gJConfig\']->urlengine[\'jelixWWWPath\'].\'js/jforms.js\'); 60 61 $GLOBALS[\'gJCoord\']->response->addCSSLink($GLOBALS[\'gJConfig\']->urlengine[\'jelixWWWPath\'].\'design/jform.css\'); 61 62 } 62 ' ;63 '); 63 64 64 65 return $content; branches/1.0beta3.x/lib/jelix/tpl/jTpl.class.php
r559 r611 162 162 public function meta($tpl, $outputtype='', $trusted = true){ 163 163 $this->getTemplate($tpl,'template_meta_', $outputtype, $trusted); 164 return $this->_meta; 164 165 } 165 166 … … 215 216 * @param string $outputtype the type of output (html, text etc..) 216 217 * @param boolean $trusted says if the template file is trusted or not 218 * @param boolean $callMeta false if meta should not be called 217 219 * @return string the generated content 218 220 */ 219 public function fetch ($tpl, $outputtype='', $trusted = true){ 220 ob_start (); 221 try{ 222 $this->getTemplate($tpl,'template_', $outputtype, $trusted); 223 $content = ob_get_clean(); 224 }catch(Exception $e){ 225 ob_end_clean(); 226 throw $e; 227 } 228 return $content; 229 } 230 231 /** 232 * optimized version of meta() + fetch() 233 * @param string $tpl template selector 234 * @param string $outputtype the type of output (html, text etc..) 235 * @param boolean $trusted says if the template file is trusted or not 236 * @return string the generated content 237 * @since 1.0b1 238 */ 239 public function metaFetch ($tpl, $outputtype='', $trusted = true){ 221 public function fetch ($tpl, $outputtype='', $trusted = true, $callMeta=true){ 222 $content = ''; 240 223 ob_start (); 241 224 try{ … … 264 247 $md = md5($tpl.'_'.$outputtype.($trusted?'_t':'')); 265 248 #endif 266 $fct = 'template_meta_'.$md; 267 $fct($this); 249 if ($callMeta) { 250 $fct = 'template_meta_'.$md; 251 $fct($this); 252 } 268 253 $fct = 'template_'.$md; 269 254 $fct($this); … … 276 261 } 277 262 263 /** 264 * deprecated function: optimized version of meta() + fetch(). 265 * Instead use fetch with true as $callMeta parameter. 266 * @param string $tpl template selector 267 * @param string $outputtype the type of output (html, text etc..) 268 * @param boolean $trusted says if the template file is trusted or not 269 * @return string the generated content 270 * @deprecated 271 */ 272 public function metaFetch ($tpl, $outputtype='', $trusted = true){ 273 return $this->fetch ($tpl, $outputtype, $trusted,true); 274 } 275 278 276 279 277 /** branches/1.0beta3.x/lib/jelix/tpl/jTpl.class.php
r559 r611 162 162 public function meta($tpl, $outputtype='', $trusted = true){ 163 163 $this->getTemplate($tpl,'template_meta_', $outputtype, $trusted); 164 return $this->_meta; 164 165 } 165 166 … … 215 216 * @param string $outputtype the type of output (html, text etc..) 216 217 * @param boolean $trusted says if the template file is trusted or not 218 * @param boolean $callMeta false if meta should not be called 217 219 * @return string the generated content 218 220 */ 219 public function fetch ($tpl, $outputtype='', $trusted = true){ 220 ob_start (); 221 try{ 222 $this->getTemplate($tpl,'template_', $outputtype, $trusted); 223 $content = ob_get_clean(); 224 }catch(Exception $e){ 225 ob_end_clean(); 226 throw $e; 227 } 228 return $content; 229 } 230 231 /** 232 * optimized version of meta() + fetch() 233 * @param string $tpl template selector 234 * @param string $outputtype the type of output (html, text etc..) 235 * @param boolean $trusted says if the template file is trusted or not 236 * @return string the generated content 237 * @since 1.0b1 238 */ 239 public function metaFetch ($tpl, $outputtype='', $trusted = true){ 221 public function fetch ($tpl, $outputtype='', $trusted = true, $callMeta=true){ 222 $content = ''; 240 223 ob_start (); 241 224 try{ … … 264 247 $md = md5($tpl.'_'.$outputtype.($trusted?'_t':'')); 265 248 #endif 266 $fct = 'template_meta_'.$md; 267 $fct($this); 249 if ($callMeta) { 250 $fct = 'template_meta_'.$md; 251 $fct($this); 252 } 268 253 $fct = 'template_'.$md; 269 254 $fct($this); … … 276 261 } 277 262 263 /** 264 * deprecated function: optimized version of meta() + fetch(). 265 * Instead use fetch with true as $callMeta parameter. 266 * @param string $tpl template selector 267 * @param string $outputtype the type of output (html, text etc..) 268 * @param boolean $trusted says if the template file is trusted or not 269 * @return string the generated content 270 * @deprecated 271 */ 272 public function metaFetch ($tpl, $outputtype='', $trusted = true){ 273 return $this->fetch ($tpl, $outputtype, $trusted,true); 274 } 275 278 276 279 277 /** branches/1.0beta3.x/lib/jelix/tpl/jTplCompiler.class.php
r571 r611 129 129 $header.='function template_meta_'.md5($selector->module.'_'.$selector->resource.'_'.$this->outputType.($this->trusted?'_t':'')).'($t){'; 130 130 #endif 131 $header .="\n".$this->_metaBody."\n return \$t->_meta;\n}\n";131 $header .="\n".$this->_metaBody."\n}\n"; 132 132 133 133 #if JTPL_STANDALONE … … 515 515 } 516 516 517 public function addMetaContent($content){ 518 $this->_metaBody.= $content."\n"; 519 } 520 517 521 /** 518 522 * try to find a plugin branches/1.0beta3.x/lib/jelix/tpl/jTplCompiler.class.php
r571 r611 129 129 $header.='function template_meta_'.md5($selector->module.'_'.$selector->resource.'_'.$this->outputType.($this->trusted?'_t':'')).'($t){'; 130 130 #endif 131 $header .="\n".$this->_metaBody."\n return \$t->_meta;\n}\n";131 $header .="\n".$this->_metaBody."\n}\n"; 132 132 133 133 #if JTPL_STANDALONE … … 515 515 } 516 516 517 public function addMetaContent($content){ 518 $this->_metaBody.= $content."\n"; 519 } 520 517 521 /** 518 522 * try to find a plugin trunk/lib/jelix/plugins/tpl/html/block.form.php
r610 r611 61 61 $t->_privateVars[\'__formbuilder\']->outputHeader(array('.$errdecorator.','.$helpdecorator.',\''.$method.'\')); 62 62 $t->_privateVars[\'__displayed_ctrl\'] = array(); 63 if($GLOBALS[\'gJCoord\']->response!= null){ 63 '; 64 $compiler->addMetaContent('if($GLOBALS[\'gJCoord\']->response!= null){ 64 65 $GLOBALS[\'gJCoord\']->response->addJSLink($GLOBALS[\'gJConfig\']->urlengine[\'jelixWWWPath\'].\'js/jforms.js\'); 65 66 $GLOBALS[\'gJCoord\']->response->addCSSLink($GLOBALS[\'gJConfig\']->urlengine[\'jelixWWWPath\'].\'design/jform.css\'); 66 67 } 67 ' ;68 '); 68 69 69 70 return $content; trunk/lib/jelix/plugins/tpl/html/block.form.php
r610 r611 61 61 $t->_privateVars[\'__formbuilder\']->outputHeader(array('.$errdecorator.','.$helpdecorator.',\''.$method.'\')); 62 62 $t->_privateVars[\'__displayed_ctrl\'] = array(); 63 if($GLOBALS[\'gJCoord\']->response!= null){ 63 '; 64 $compiler->addMetaContent('if($GLOBALS[\'gJCoord\']->response!= null){ 64 65 $GLOBALS[\'gJCoord\']->response->addJSLink($GLOBALS[\'gJConfig\']->urlengine[\'jelixWWWPath\'].\'js/jforms.js\'); 65 66 $GLOBALS[\'gJCoord\']->response->addCSSLink($GLOBALS[\'gJConfig\']->urlengine[\'jelixWWWPath\'].\'design/jform.css\'); 66 67 } 67 ' ;68 '); 68 69 69 70 return $content; trunk/lib/jelix/tpl/jTpl.class.php
r559 r611 162 162 public function meta($tpl, $outputtype='', $trusted = true){ 163 163 $this->getTemplate($tpl,'template_meta_', $outputtype, $trusted); 164 return $this->_meta; 164 165 } 165 166 … … 215 216 * @param string $outputtype the type of output (html, text etc..) 216 217 * @param boolean $trusted says if the template file is trusted or not 218 * @param boolean $callMeta false if meta should not be called 217 219 * @return string the generated content 218 220 */ 219 public function fetch ($tpl, $outputtype='', $trusted = true){ 220 ob_start (); 221 try{ 222 $this->getTemplate($tpl,'template_', $outputtype, $trusted); 223 $content = ob_get_clean(); 224 }catch(Exception $e){ 225 ob_end_clean(); 226 throw $e; 227 } 228 return $content; 229 } 230 231 /** 232 * optimized version of meta() + fetch() 233 * @param string $tpl template selector 234 * @param string $outputtype the type of output (html, text etc..) 235 * @param boolean $trusted says if the template file is trusted or not 236 * @return string the generated content 237 * @since 1.0b1 238 */ 239 public function metaFetch ($tpl, $outputtype='', $trusted = true){ 221 public function fetch ($tpl, $outputtype='', $trusted = true, $callMeta=true){ 222 $content = ''; 240 223 ob_start (); 241 224 try{ … … 264 247 $md = md5($tpl.'_'.$outputtype.($trusted?'_t':'')); 265 248 #endif 266 $fct = 'template_meta_'.$md; 267 $fct($this); 249 if ($callMeta) { 250 $fct = 'template_meta_'.$md; 251 $fct($this); 252 } 268 253 $fct = 'template_'.$md; 269 254 $fct($this); … … 276 261 } 277 262 263 /** 264 * deprecated function: optimized version of meta() + fetch(). 265 * Instead use fetch with true as $callMeta parameter. 266 * @param string $tpl template selector 267 * @param string $outputtype the type of output (html, text etc..) 268 * @param boolean $trusted says if the template file is trusted or not 269 * @return string the generated content 270 * @deprecated 271 */ 272 public function metaFetch ($tpl, $outputtype='', $trusted = true){ 273 return $this->fetch ($tpl, $outputtype, $trusted,true); 274 } 275 278 276 279 277 /** trunk/lib/jelix/tpl/jTpl.class.php
r559 r611 162 162 public function meta($tpl, $outputtype='', $trusted = true){ 163 163 $this->getTemplate($tpl,'template_meta_', $outputtype, $trusted); 164 return $this->_meta; 164 165 } 165 166 … … 215 216 * @param string $outputtype the type of output (html, text etc..) 216 217 * @param boolean $trusted says if the template file is trusted or not 218 * @param boolean $callMeta false if meta should not be called 217 219 * @return string the generated content 218 220 */ 219 public function fetch ($tpl, $outputtype='', $trusted = true){ 220 ob_start (); 221 try{ 222 $this->getTemplate($tpl,'template_', $outputtype, $trusted); 223 $content = ob_get_clean(); 224 }catch(Exception $e){ 225 ob_end_clean(); 226 throw $e; 227 } 228 return $content; 229 } 230 231 /** 232 * optimized version of meta() + fetch() 233 * @param string $tpl template selector 234 * @param string $outputtype the type of output (html, text etc..) 235 * @param boolean $trusted says if the template file is trusted or not 236 * @return string the generated content 237 * @since 1.0b1 238 */ 239 public function metaFetch ($tpl, $outputtype='', $trusted = true){ 221 public function fetch ($tpl, $outputtype='', $trusted = true, $callMeta=true){ 222 $content = ''; 240 223 ob_start (); 241 224 try{ … … 264 247 $md = md5($tpl.'_'.$outputtype.($trusted?'_t':'')); 265 248 #endif 266 $fct = 'template_meta_'.$md; 267 $fct($this); 249 if ($callMeta) { 250 $fct = 'template_meta_'.$md; 251 $fct($this); 252 } 268 253 $fct = 'template_'.$md; 269 254 $fct($this); … … 276 261 } 277 262 263 /** 264 * deprecated function: optimized version of meta() + fetch(). 265 * Instead use fetch with true as $callMeta parameter. 266 * @param string $tpl template selector 267 * @param string $outputtype the type of output (html, text etc..) 268 * @param boolean $trusted says if the template file is trusted or not 269 * @return string the generated content 270 * @deprecated 271 */ 272 public function metaFetch ($tpl, $outputtype='', $trusted = true){ 273 return $this->fetch ($tpl, $outputtype, $trusted,true); 274 } 275 278 276 279 277 /** trunk/lib/jelix/tpl/jTplCompiler.class.php
r571 r611 129 129 $header.='function template_meta_'.md5($selector->module.'_'.$selector->resource.'_'.$this->outputType.($this->trusted?'_t':'')).'($t){'; 130 130 #endif 131 $header .="\n".$this->_metaBody."\n return \$t->_meta;\n}\n";131 $header .="\n".$this->_metaBody."\n}\n"; 132 132 133 133 #if JTPL_STANDALONE … … 515 515 } 516 516 517 public function addMetaContent($content){ 518 $this->_metaBody.= $content."\n"; 519 } 520 517 521 /** 518 522 * try to find a plugin trunk/lib/jelix/tpl/jTplCompiler.class.php
r571 r611 129 129 $header.='function template_meta_'.md5($selector->module.'_'.$selector->resource.'_'.$this->outputType.($this->trusted?'_t':'')).'($t){'; 130 130 #endif 131 $header .="\n".$this->_metaBody."\n return \$t->_meta;\n}\n";131 $header .="\n".$this->_metaBody."\n}\n"; 132 132 133 133 #if JTPL_STANDALONE … … 515 515 } 516 516 517 public function addMetaContent($content){ 518 $this->_metaBody.= $content."\n"; 519 } 520 517 521 /** 518 522 * try to find a plugin
