(phpdoc indentation)

This commit is contained in:
rodneyrehm
2011-12-18 16:52:26 +00:00
parent 9be91eb04b
commit 3495b683bd

View File

@@ -1,34 +1,34 @@
<?php <?php
/** /**
* Smarty Internal Plugin Smarty Template Base * Smarty Internal Plugin Smarty Template Base
* *
* This file contains the basic shared methodes for template handling * This file contains the basic shared methodes for template handling
* *
* @package Smarty * @package Smarty
* @subpackage Template * @subpackage Template
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Class with shared template methodes * Class with shared template methodes
* *
* @package Smarty * @package Smarty
* @subpackage Template * @subpackage Template
*/ */
abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data { abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
/** /**
* fetches a rendered Smarty template * fetches a rendered Smarty template
* *
* @param string $template the resource handle of the template file or template object * @param string $template the resource handle of the template file or template object
* @param mixed $cache_id cache id to be used with this template * @param mixed $cache_id cache id to be used with this template
* @param mixed $compile_id compile id to be used with this template * @param mixed $compile_id compile id to be used with this template
* @param object $parent next higher level of Smarty variables * @param object $parent next higher level of Smarty variables
* @param bool $display true: display, false: fetch * @param bool $display true: display, false: fetch
* @param bool $merge_tpl_vars if true parent template variables merged in to local scope * @param bool $merge_tpl_vars if true parent template variables merged in to local scope
* @param bool $no_output_filter if true do not run output filter * @param bool $no_output_filter if true do not run output filter
* @return string rendered template output * @return string rendered template output
*/ */
public function fetch($template = null, $cache_id = null, $compile_id = null, $parent = null, $display = false, $merge_tpl_vars = true, $no_output_filter = false) public function fetch($template = null, $cache_id = null, $compile_id = null, $parent = null, $display = false, $merge_tpl_vars = true, $no_output_filter = false)
{ {
if ($template === null && $this instanceof $this->template_class) { if ($template === null && $this instanceof $this->template_class) {
@@ -361,13 +361,13 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} }
/** /**
* displays a Smarty template * displays a Smarty template
* *
* @param string $template the resource handle of the template file or template object * @param string $template the resource handle of the template file or template object
* @param mixed $cache_id cache id to be used with this template * @param mixed $cache_id cache id to be used with this template
* @param mixed $compile_id compile id to be used with this template * @param mixed $compile_id compile id to be used with this template
* @param object $parent next higher level of Smarty variables * @param object $parent next higher level of Smarty variables
*/ */
public function display($template = null, $cache_id = null, $compile_id = null, $parent = null) public function display($template = null, $cache_id = null, $compile_id = null, $parent = null)
{ {
// display template // display template
@@ -375,14 +375,14 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} }
/** /**
* test if cache is valid * test if cache is valid
* *
* @param string|object $template the resource handle of the template file or template object * @param string|object $template the resource handle of the template file or template object
* @param mixed $cache_id cache id to be used with this template * @param mixed $cache_id cache id to be used with this template
* @param mixed $compile_id compile id to be used with this template * @param mixed $compile_id compile id to be used with this template
* @param object $parent next higher level of Smarty variables * @param object $parent next higher level of Smarty variables
* @return boolean cache status * @return boolean cache status
*/ */
public function isCached($template = null, $cache_id = null, $compile_id = null, $parent = null) public function isCached($template = null, $cache_id = null, $compile_id = null, $parent = null)
{ {
if ($template === null && $this instanceof $this->template_class) { if ($template === null && $this instanceof $this->template_class) {
@@ -399,27 +399,27 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} }
/** /**
* creates a data object * creates a data object
* *
* @param object $parent next higher level of Smarty variables * @param object $parent next higher level of Smarty variables
* @returns Smarty_Data data object * @returns Smarty_Data data object
*/ */
public function createData($parent = null) public function createData($parent = null)
{ {
return new Smarty_Data($parent, $this); return new Smarty_Data($parent, $this);
} }
/** /**
* Registers plugin to be used in templates * Registers plugin to be used in templates
* *
* @param string $type plugin type * @param string $type plugin type
* @param string $tag name of template tag * @param string $tag name of template tag
* @param callback $callback PHP callback to register * @param callback $callback PHP callback to register
* @param boolean $cacheable if true (default) this fuction is cachable * @param boolean $cacheable if true (default) this fuction is cachable
* @param array $cache_attr caching attributes if any * @param array $cache_attr caching attributes if any
* @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
* @throws SmartyException when the plugin tag is invalid * @throws SmartyException when the plugin tag is invalid
*/ */
public function registerPlugin($type, $tag, $callback, $cacheable = true, $cache_attr = null) public function registerPlugin($type, $tag, $callback, $cacheable = true, $cache_attr = null)
{ {
if (isset($this->smarty->registered_plugins[$type][$tag])) { if (isset($this->smarty->registered_plugins[$type][$tag])) {
@@ -434,12 +434,12 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} }
/** /**
* Unregister Plugin * Unregister Plugin
* *
* @param string $type of plugin * @param string $type of plugin
* @param string $tag name of plugin * @param string $tag name of plugin
* @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
*/ */
public function unregisterPlugin($type, $tag) public function unregisterPlugin($type, $tag)
{ {
if (isset($this->smarty->registered_plugins[$type][$tag])) { if (isset($this->smarty->registered_plugins[$type][$tag])) {
@@ -450,12 +450,12 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} }
/** /**
* Registers a resource to fetch a template * Registers a resource to fetch a template
* *
* @param string $type name of resource type * @param string $type name of resource type
* @param Smarty_Resource|array $callback or instance of Smarty_Resource, or array of callbacks to handle resource (deprecated) * @param Smarty_Resource|array $callback or instance of Smarty_Resource, or array of callbacks to handle resource (deprecated)
* @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
*/ */
public function registerResource($type, $callback) public function registerResource($type, $callback)
{ {
$this->smarty->registered_resources[$type] = $callback instanceof Smarty_Resource ? $callback : array($callback, false); $this->smarty->registered_resources[$type] = $callback instanceof Smarty_Resource ? $callback : array($callback, false);
@@ -463,11 +463,11 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} }
/** /**
* Unregisters a resource * Unregisters a resource
* *
* @param string $type name of resource type * @param string $type name of resource type
* @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
*/ */
public function unregisterResource($type) public function unregisterResource($type)
{ {
if (isset($this->smarty->registered_resources[$type])) { if (isset($this->smarty->registered_resources[$type])) {
@@ -478,12 +478,12 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} }
/** /**
* Registers a cache resource to cache a template's output * Registers a cache resource to cache a template's output
* *
* @param string $type name of cache resource type * @param string $type name of cache resource type
* @param Smarty_CacheResource $callback instance of Smarty_CacheResource to handle output caching * @param Smarty_CacheResource $callback instance of Smarty_CacheResource to handle output caching
* @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
*/ */
public function registerCacheResource($type, Smarty_CacheResource $callback) public function registerCacheResource($type, Smarty_CacheResource $callback)
{ {
$this->smarty->registered_cache_resources[$type] = $callback; $this->smarty->registered_cache_resources[$type] = $callback;
@@ -491,11 +491,11 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} }
/** /**
* Unregisters a cache resource * Unregisters a cache resource
* *
* @param string $type name of cache resource type * @param string $type name of cache resource type
* @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
*/ */
public function unregisterCacheResource($type) public function unregisterCacheResource($type)
{ {
if (isset($this->smarty->registered_cache_resources[$type])) { if (isset($this->smarty->registered_cache_resources[$type])) {
@@ -506,17 +506,17 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} }
/** /**
* Registers object to be used in templates * Registers object to be used in templates
* *
* @param string $object name of template object * @param string $object name of template object
* @param object $object_impl the referenced PHP object to register * @param object $object_impl the referenced PHP object to register
* @param array $allowed list of allowed methods (empty = all) * @param array $allowed list of allowed methods (empty = all)
* @param boolean $smarty_args smarty argument format, else traditional * @param boolean $smarty_args smarty argument format, else traditional
* @param array $block_methods list of block-methods * @param array $block_methods list of block-methods
* @param array $block_functs list of methods that are block format * @param array $block_functs list of methods that are block format
* @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
* @throws SmartyException if any of the methods in $allowed or $block_methods are invalid * @throws SmartyException if any of the methods in $allowed or $block_methods are invalid
*/ */
public function registerObject($object_name, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array()) public function registerObject($object_name, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
{ {
// test if allowed methodes callable // test if allowed methodes callable
@@ -542,12 +542,12 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} }
/** /**
* return a reference to a registered object * return a reference to a registered object
* *
* @param string $name object name * @param string $name object name
* @return object * @return object
* @throws SmartyException if no such object is found * @throws SmartyException if no such object is found
*/ */
public function getRegisteredObject($name) public function getRegisteredObject($name)
{ {
if (!isset($this->smarty->registered_objects[$name])) { if (!isset($this->smarty->registered_objects[$name])) {
@@ -560,11 +560,11 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} }
/** /**
* unregister an object * unregister an object
* *
* @param string $name object name * @param string $name object name
* @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
*/ */
public function unregisterObject($name) public function unregisterObject($name)
{ {
if (isset($this->smarty->registered_objects[$name])) { if (isset($this->smarty->registered_objects[$name])) {
@@ -575,13 +575,13 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} }
/** /**
* Registers static classes to be used in templates * Registers static classes to be used in templates
* *
* @param string $class name of template class * @param string $class name of template class
* @param string $class_impl the referenced PHP class to register * @param string $class_impl the referenced PHP class to register
* @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
* @throws SmartyException if $class_impl does not refer to an existing class * @throws SmartyException if $class_impl does not refer to an existing class
*/ */
public function registerClass($class_name, $class_impl) public function registerClass($class_name, $class_impl)
{ {
// test if exists // test if exists
@@ -594,12 +594,12 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} }
/** /**
* Registers a default plugin handler * Registers a default plugin handler
* *
* @param callable $callback class/method name * @param callable $callback class/method name
* @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
* @throws SmartyException if $callback is not callable * @throws SmartyException if $callback is not callable
*/ */
public function registerDefaultPluginHandler($callback) public function registerDefaultPluginHandler($callback)
{ {
if (is_callable($callback)) { if (is_callable($callback)) {
@@ -612,12 +612,12 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} }
/** /**
* Registers a default template handler * Registers a default template handler
* *
* @param callable $callback class/method name * @param callable $callback class/method name
* @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
* @throws SmartyException if $callback is not callable * @throws SmartyException if $callback is not callable
*/ */
public function registerDefaultTemplateHandler($callback) public function registerDefaultTemplateHandler($callback)
{ {
if (is_callable($callback)) { if (is_callable($callback)) {
@@ -630,12 +630,12 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} }
/** /**
* Registers a default template handler * Registers a default template handler
* *
* @param callable $callback class/method name * @param callable $callback class/method name
* @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
* @throws SmartyException if $callback is not callable * @throws SmartyException if $callback is not callable
*/ */
public function registerDefaultConfigHandler($callback) public function registerDefaultConfigHandler($callback)
{ {
if (is_callable($callback)) { if (is_callable($callback)) {
@@ -648,12 +648,12 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} }
/** /**
* Registers a filter function * Registers a filter function
* *
* @param string $type filter type * @param string $type filter type
* @param callback $callback * @param callback $callback
* @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
*/ */
public function registerFilter($type, $callback) public function registerFilter($type, $callback)
{ {
$this->smarty->registered_filters[$type][$this->_get_filter_name($callback)] = $callback; $this->smarty->registered_filters[$type][$this->_get_filter_name($callback)] = $callback;
@@ -661,12 +661,12 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} }
/** /**
* Unregisters a filter function * Unregisters a filter function
* *
* @param string $type filter type * @param string $type filter type
* @param callback $callback * @param callback $callback
* @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
*/ */
public function unregisterFilter($type, $callback) public function unregisterFilter($type, $callback)
{ {
$name = $this->_get_filter_name($callback); $name = $this->_get_filter_name($callback);
@@ -678,11 +678,11 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} }
/** /**
* Return internal filter name * Return internal filter name
* *
* @param callback $function_name * @param callback $function_name
* @return string internal filter name * @return string internal filter name
*/ */
public function _get_filter_name($function_name) public function _get_filter_name($function_name)
{ {
if (is_array($function_name)) { if (is_array($function_name)) {
@@ -695,12 +695,12 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} }
/** /**
* load a filter of specified type and name * load a filter of specified type and name
* *
* @param string $type filter type * @param string $type filter type
* @param string $name filter name * @param string $name filter name
* @throws SmartyException if filter could not be loaded * @throws SmartyException if filter could not be loaded
*/ */
public function loadFilter($type, $name) public function loadFilter($type, $name)
{ {
$_plugin = "smarty_{$type}filter_{$name}"; $_plugin = "smarty_{$type}filter_{$name}";
@@ -718,12 +718,12 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} }
/** /**
* unload a filter of specified type and name * unload a filter of specified type and name
* *
* @param string $type filter type * @param string $type filter type
* @param string $name filter name * @param string $name filter name
* @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining * @return Smarty_Internal_Templatebase current Smarty_Internal_Templatebase (or Smarty or Smarty_Internal_Template) instance for chaining
*/ */
public function unloadFilter($type, $name) public function unloadFilter($type, $name)
{ {
$_filter_name = "smarty_{$type}filter_{$name}"; $_filter_name = "smarty_{$type}filter_{$name}";
@@ -735,21 +735,21 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} }
/** /**
* preg_replace callback to convert camelcase getter/setter to underscore property names * preg_replace callback to convert camelcase getter/setter to underscore property names
* *
* @param string $match match string * @param string $match match string
* @return string replacemant * @return string replacemant
*/ */
private function replaceCamelcase($match) { private function replaceCamelcase($match) {
return "_" . strtolower($match[1]); return "_" . strtolower($match[1]);
} }
/** /**
* Handle unknown class methods * Handle unknown class methods
* *
* @param string $name unknown method-name * @param string $name unknown method-name
* @param array $args argument array * @param array $args argument array
*/ */
public function __call($name, $args) public function __call($name, $args)
{ {
static $_prefixes = array('set' => true, 'get' => true); static $_prefixes = array('set' => true, 'get' => true);