smarty_cms_prefilter_precompilefunc

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
peter2108
Forum Members
Forum Members
Posts: 10
Joined: Sat Feb 09, 2008 10:23 am
Location: Wakefield, UK

smarty_cms_prefilter_precompilefunc

Post by peter2108 »

Hi,

I'm  studying CMSMS to see how it works - particularly how it uses Smarty. I found a prefilter called prefilter_precompilefunc.php that Smarty loads. This has a function smarty_cms_prefilter_precompilefunc which is called before a template is compiled passing the source. The function has a case statement depending on the value of $smarty->_current_file before a ':'.  The cases are
'content' ,'globalcontent', and 'template'. I'm using 1.4.1 and tracing entry to the function it does not seem ever to call with 'template' though it does call with 'tpl_body', 'tpl_top' and 'tpl_head'.  So any module functions TemplatePreCompile don't get called. Is this a bug or is it a deliberate move?

Thanks for any help,

Peter
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: smarty_cms_prefilter_precompilefunc

Post by Ted »

This only gets called during a compilation of the template after it's changed.  Are you checking right after you add/edit a page template?  If it's not getting called at all, then I would have to think it's a bug.
peter2108
Forum Members
Forum Members
Posts: 10
Joined: Sat Feb 09, 2008 10:23 am
Location: Wakefield, UK

Re: smarty_cms_prefilter_precompilefunc

Post by peter2108 »

I deleted everything from templates_c so presumably it should be compiled.

Code: Select all

smarty_cms_prefilter_precompilefunc 29 in/cmsmadesimple/plugins/prefilter.precompilefunc.php
$result[0] for case is tpl_body 
$smarty->_current_file: tpl_body:17
Nothing done


Other calls with $smarty->_current_file is 'content:...' or 'globalcontent:'  are there as expected. 

-- Peter
Post Reply

Return to “Developers Discussion”