summaryrefslogtreecommitdiff
path: root/smarty_bit/resource.style.php
blob: 3553f2bc030cd771d4306b21244fabf834061363 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */

/**
 * Smarty plugin - smarty_resource_style_source
 * ------------------------------------------------------------- 
 * 
 * -------------------------------------------------------------
 */
function smarty_resource_style_source($tpl_name, &$tpl_source, &$smarty)
{
	// Check if file exists in the style directory if not
	// check if file exists in the templates directory,
	// if not then fall
}

/**
 * Smarty plugin - smarty_resource_style_timestamp
 * ------------------------------------------------------------- 
 * 
 * -------------------------------------------------------------
 */
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;
    }
}

/**
 * Smarty plugin - smarty_resource_style_secure
 * ------------------------------------------------------------- 
 * 
 * -------------------------------------------------------------
 */
function smarty_resource_style_secure($tpl_name, &$smarty)
{
    // assume all templates are secure
    return true;
}

/**
 * Smarty plugin - smarty_resource_style_trusted
 * ------------------------------------------------------------- 
 * 
 * -------------------------------------------------------------
 */
function smarty_resource_style_trusted($tpl_name, &$smarty)
{
    // not used for templates
}
?>