From c9844d410bb22faa227c7be4c08e1d5139271708 Mon Sep 17 00:00:00 2001 From: messju Date: Fri, 23 Jul 2004 15:34:53 +0000 Subject: [PATCH] backed out renaming of _get_plugin_filepath() to get_plugin_filepath() we'll stick to _get_plugin_filepath() and look for a more viable solution to be exposed to plugin-writers. --- NEWS | 3 --- libs/Smarty.class.php | 13 ++----------- libs/Smarty_Compiler.class.php | 8 ++++---- libs/core/core.load_plugins.php | 2 +- libs/core/core.load_resource_plugin.php | 2 +- libs/plugins/function.html_checkboxes.php | 2 +- libs/plugins/function.html_image.php | 2 +- libs/plugins/function.html_options.php | 2 +- libs/plugins/function.html_radios.php | 2 +- libs/plugins/function.html_select_date.php | 4 ++-- libs/plugins/function.html_select_time.php | 4 ++-- libs/plugins/modifier.date_format.php | 2 +- 12 files changed, 17 insertions(+), 29 deletions(-) diff --git a/NEWS b/NEWS index 02508119..6f6fa957 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,3 @@ - - rename "private" Smarty::_get_plugin_filepath() to public - Smarty:: get_plugin_filepath() . _get_plugin_filepath() is kept as - a wrapper for backward compatibility (messju) - remove touch() call that made the compiled-template's timestamp the same as the source-template's one. (messju) - add assign attribute to html_checkboxes and html_radios diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 186ae0ba..d68140f0 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -1309,7 +1309,7 @@ class Smarty */ function config_load($file, $section = null, $scope = 'global') { - require_once($this->get_plugin_filepath('function', 'config_load')); + require_once($this->_get_plugin_filepath('function', 'config_load')); smarty_function_config_load(array('file' => $file, 'section' => $section, 'scope' => $scope), $this); } @@ -1352,22 +1352,13 @@ class Smarty * @param string $name * @return string|false */ - function get_plugin_filepath($type, $name) + function _get_plugin_filepath($type, $name) { $_params = array('type' => $type, 'name' => $name); require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.assemble_plugin_filepath.php'); return smarty_core_assemble_plugin_filepath($_params, $this); } - /** - * wrapper (kept for compatibility) - * - */ - function _get_plugin_filepath($type, $name) - { - return $this->get_plugin_filepath($type, $name); - } - /** * test if resource needs compiling * diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index 5d5452f9..aebeb23c 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -590,7 +590,7 @@ class Smarty_Compiler extends Smarty { * Otherwise we need to load plugin file and look for the function * inside it. */ - else if ($plugin_file = $this->get_plugin_filepath('compiler', $tag_command)) { + else if ($plugin_file = $this->_get_plugin_filepath('compiler', $tag_command)) { $found = true; include_once $plugin_file; @@ -665,7 +665,7 @@ class Smarty_Compiler extends Smarty { * Otherwise we need to load plugin file and look for the function * inside it. */ - else if ($plugin_file = $this->get_plugin_filepath('block', $tag_command)) { + else if ($plugin_file = $this->_get_plugin_filepath('block', $tag_command)) { $found = true; include_once $plugin_file; @@ -749,7 +749,7 @@ class Smarty_Compiler extends Smarty { * Otherwise we need to load plugin file and look for the function * inside it. */ - else if ($plugin_file = $this->get_plugin_filepath('function', $tag_command)) { + else if ($plugin_file = $this->_get_plugin_filepath('function', $tag_command)) { $found = true; include_once $plugin_file; @@ -1894,7 +1894,7 @@ class Smarty_Compiler extends Smarty { } if (empty($this->_plugins['modifier'][$_modifier_name]) - && !$this->get_plugin_filepath('modifier', $_modifier_name) + && !$this->_get_plugin_filepath('modifier', $_modifier_name) && function_exists($_modifier_name)) { if ($this->security && !in_array($_modifier_name, $this->security_settings['MODIFIER_FUNCS'])) { $this->_trigger_fatal_error("[plugin] (secure mode) modifier '$_modifier_name' is not allowed" , $this->_current_file, $this->_current_line_no, __FILE__, __LINE__); diff --git a/libs/core/core.load_plugins.php b/libs/core/core.load_plugins.php index 0bb4a15a..6db1dc51 100644 --- a/libs/core/core.load_plugins.php +++ b/libs/core/core.load_plugins.php @@ -54,7 +54,7 @@ function smarty_core_load_plugins($params, &$smarty) } } - $_plugin_file = $smarty->get_plugin_filepath($_type, $_name); + $_plugin_file = $smarty->_get_plugin_filepath($_type, $_name); if (! $_found = ($_plugin_file != false)) { $_message = "could not load plugin file '$_type.$_name.php'\n"; diff --git a/libs/core/core.load_resource_plugin.php b/libs/core/core.load_resource_plugin.php index c4aeb80c..a7d37d1a 100644 --- a/libs/core/core.load_resource_plugin.php +++ b/libs/core/core.load_resource_plugin.php @@ -41,7 +41,7 @@ function smarty_core_load_resource_plugin($params, &$smarty) return; } - $_plugin_file = $smarty->get_plugin_filepath('resource', $params['type']); + $_plugin_file = $smarty->_get_plugin_filepath('resource', $params['type']); $_found = ($_plugin_file != false); if ($_found) { /* diff --git a/libs/plugins/function.html_checkboxes.php b/libs/plugins/function.html_checkboxes.php index 21df27d2..f4f5957d 100644 --- a/libs/plugins/function.html_checkboxes.php +++ b/libs/plugins/function.html_checkboxes.php @@ -40,7 +40,7 @@ */ function smarty_function_html_checkboxes($params, &$smarty) { - require_once $smarty->get_plugin_filepath('shared','escape_special_chars'); + require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); $name = 'checkbox'; $values = null; diff --git a/libs/plugins/function.html_image.php b/libs/plugins/function.html_image.php index 2a999a1f..2654b03d 100644 --- a/libs/plugins/function.html_image.php +++ b/libs/plugins/function.html_image.php @@ -36,7 +36,7 @@ */ function smarty_function_html_image($params, &$smarty) { - require_once $smarty->get_plugin_filepath('shared','escape_special_chars'); + require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); $alt = ''; $file = ''; diff --git a/libs/plugins/function.html_options.php b/libs/plugins/function.html_options.php index fb0d5f4d..da5571c5 100644 --- a/libs/plugins/function.html_options.php +++ b/libs/plugins/function.html_options.php @@ -28,7 +28,7 @@ */ function smarty_function_html_options($params, &$smarty) { - require_once $smarty->get_plugin_filepath('shared','escape_special_chars'); + require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); $name = null; $values = null; diff --git a/libs/plugins/function.html_radios.php b/libs/plugins/function.html_radios.php index 290397a3..e6a94660 100644 --- a/libs/plugins/function.html_radios.php +++ b/libs/plugins/function.html_radios.php @@ -40,7 +40,7 @@ */ function smarty_function_html_radios($params, &$smarty) { - require_once $smarty->get_plugin_filepath('shared','escape_special_chars'); + require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); $name = 'radio'; $values = null; diff --git a/libs/plugins/function.html_select_date.php b/libs/plugins/function.html_select_date.php index 984dae84..3de7f532 100644 --- a/libs/plugins/function.html_select_date.php +++ b/libs/plugins/function.html_select_date.php @@ -32,8 +32,8 @@ */ function smarty_function_html_select_date($params, &$smarty) { - require_once $smarty->get_plugin_filepath('shared','make_timestamp'); - require_once $smarty->get_plugin_filepath('function','html_options'); + require_once $smarty->_get_plugin_filepath('shared','make_timestamp'); + require_once $smarty->_get_plugin_filepath('function','html_options'); /* Default values. */ $prefix = "Date_"; $start_year = strftime("%Y"); diff --git a/libs/plugins/function.html_select_time.php b/libs/plugins/function.html_select_time.php index 35d90f90..00cd1ae8 100644 --- a/libs/plugins/function.html_select_time.php +++ b/libs/plugins/function.html_select_time.php @@ -21,8 +21,8 @@ */ function smarty_function_html_select_time($params, &$smarty) { - require_once $smarty->get_plugin_filepath('shared','make_timestamp'); - require_once $smarty->get_plugin_filepath('function','html_options'); + require_once $smarty->_get_plugin_filepath('shared','make_timestamp'); + require_once $smarty->_get_plugin_filepath('function','html_options'); /* Default values. */ $prefix = "Time_"; $time = time(); diff --git a/libs/plugins/modifier.date_format.php b/libs/plugins/modifier.date_format.php index d167ba29..2f36b3b7 100644 --- a/libs/plugins/modifier.date_format.php +++ b/libs/plugins/modifier.date_format.php @@ -8,7 +8,7 @@ /** * Include the {@link shared.make_timestamp.php} plugin */ -require_once $smarty->get_plugin_filepath('shared','make_timestamp'); +require_once $smarty->_get_plugin_filepath('shared','make_timestamp'); /** * Smarty date_format modifier plugin *