Commit 91249f8e authored by lrargerich's avatar lrargerich

Resource plugin added (Experimental)

parent cd0c0e1a
......@@ -86,6 +86,7 @@ tiki/Smarty/plugins/modifier.upper.php -text
tiki/Smarty/plugins/modifier.wordwrap.php -text
tiki/Smarty/plugins/outputfilter.trimwhitespace.php -text
tiki/Smarty/plugins/prefilter.tr.php -text
tiki/Smarty/plugins/resource.style.php -text
tiki/Smarty/plugins/shared.make_timestamp.php -text
tiki/article_image.php -text
tiki/backups/license.txt -text
......
<?php
/*
* Smarty plugin
* -------------------------------------------------------------
* File: resource.style.php
* Type: resource
* -------------------------------------------------------------
*/
function smarty_resource_style_source($tpl_name, &$tpl_source, &$smarty)
{
// do database call here to fetch your template,
// populating $tpl_source
$sql = new SQL;
$sql->query("select tpl_source
from my_table
where tpl_name='$tpl_name'");
if ($sql->num_rows) {
$tpl_source = $sql->record['tpl_source'];
return true;
} else {
return false;
}
}
function smarty_resource_style_timestamp($tpl_name, &$tpl_timestamp, &$smarty)
{
// do database call here to populate $tpl_timestamp.
$sql = new SQL;
$sql->query("select tpl_timestamp
from my_table
where tpl_name='$tpl_name'");
if ($sql->num_rows) {
$tpl_timestamp = $sql->record['tpl_timestamp'];
return true;
} else {
return false;
}
}
function smarty_resource_style_secure($tpl_name, &$smarty)
{
// assume all templates are secure
return true;
}
function smarty_resource_style_trusted($tpl_name, &$smarty)
{
// not used for templates
}
?>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment