1: | <?php
|
2: |
|
3: | |
4: | |
5: | |
6: | |
7: | |
8: | |
9: | |
10: |
|
11: | class Smarty_Resource_Extendsall extends Smarty_Internal_Resource_Extends
|
12: | {
|
13: | |
14: | |
15: | |
16: | |
17: | |
18: | |
19: | |
20: |
|
21: | public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)
|
22: | {
|
23: | $uid = '';
|
24: | $sources = array();
|
25: | $timestamp = 0;
|
26: | foreach ($source->smarty->getTemplateDir() as $key => $directory) {
|
27: | try {
|
28: | $s = Smarty_Resource::source(null, $source->smarty, 'file:' . '[' . $key . ']' . $source->name);
|
29: | if (!$s->exists) {
|
30: | continue;
|
31: | }
|
32: | $sources[ $s->uid ] = $s;
|
33: | $uid .= $s->filepath;
|
34: | $timestamp = $s->timestamp > $timestamp ? $s->timestamp : $timestamp;
|
35: | } catch (SmartyException $e) {
|
36: | }
|
37: | }
|
38: | if (!$sources) {
|
39: | $source->exists = false;
|
40: | return;
|
41: | }
|
42: | $sources = array_reverse($sources, true);
|
43: | reset($sources);
|
44: | $s = current($sources);
|
45: | $source->components = $sources;
|
46: | $source->filepath = $s->filepath;
|
47: | $source->uid = sha1($uid . $source->smarty->_joined_template_dir);
|
48: | $source->exists = true;
|
49: | $source->timestamp = $timestamp;
|
50: | }
|
51: |
|
52: | |
53: | |
54: | |
55: | |
56: | |
57: |
|
58: | public function checkTimestamps()
|
59: | {
|
60: | return false;
|
61: | }
|
62: | }
|
63: | |