1: <?php
2: 3: 4: 5: 6:
7:
8: 9: 10: 11: 12: 13: 14:
15: function smarty_core_assemble_plugin_filepath($params, &$smarty)
16: {
17: $_plugin_filename = $params['type'] . '.' . $params['name'] . '.php';
18: if (isset($smarty->_filepaths_cache[$_plugin_filename])) {
19: return $smarty->_filepaths_cache[$_plugin_filename];
20: }
21: $_return = false;
22:
23: foreach ((array)$smarty->plugins_dir as $_plugin_dir) {
24:
25: $_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename;
26:
27:
28: if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir)) {
29: $_relative_paths[] = $_plugin_dir;
30:
31: if (@is_readable(SMARTY_DIR . $_plugin_filepath)) {
32: $_return = SMARTY_DIR . $_plugin_filepath;
33: break;
34: }
35: }
36:
37: if (@is_readable($_plugin_filepath)) {
38: $_return = $_plugin_filepath;
39: break;
40: }
41: }
42:
43: if($_return === false) {
44:
45: if(isset($_relative_paths)) {
46: foreach ((array)$_relative_paths as $_plugin_dir) {
47:
48: $_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename;
49:
50: $_params = array('file_path' => $_plugin_filepath);
51: require_once(SMARTY_CORE_DIR . 'core.get_include_path.php');
52: if(smarty_core_get_include_path($_params, $smarty)) {
53: $_return = $_params['new_file_path'];
54: break;
55: }
56: }
57: }
58: }
59: $smarty->_filepaths_cache[$_plugin_filename] = $_return;
60: return $_return;
61: }
62:
63:
64:
65: ?>
66: