/framework/vendor/smarty3/lib/libs/sysplugins/smarty_internal_unregister.php

http://zoop.googlecode.com/ · PHP · 151 lines · 55 code · 15 blank · 81 comment · 4 complexity · ba2b4df3ad512e99ab4bbc3a30a4fc81 MD5 · raw file

  1. <?php
  2. /**
  3. * Project: Smarty: the PHP compiling template engine
  4. * File: smarty_internal_unregister.php
  5. * SVN: $Id: $
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this library; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. *
  21. * For questions, help, comments, discussion, etc., please join the
  22. * Smarty mailing list. Send a blank e-mail to
  23. * smarty-discussion-subscribe@googlegroups.com
  24. *
  25. * @link http://www.smarty.net/
  26. * @copyright 2008 New Digital Group, Inc.
  27. * @author Monte Ohrt <monte at ohrt dot com>
  28. * @author Uwe Tews
  29. * @package Smarty
  30. * @subpackage PluginsInternal
  31. * @version 3-SVN$Rev: 3286 $
  32. */
  33. class Smarty_Internal_Unregister {
  34. protected $smarty;
  35. function __construct($smarty) {
  36. $this->smarty = $smarty;
  37. }
  38. /**
  39. * Unregisters block function
  40. *
  41. * @param string $block_tag name of template function
  42. */
  43. function block($block_tag)
  44. {
  45. if (isset($this->smarty->registered_plugins['block'][$block_tag])) {
  46. unset($this->smarty->registered_plugins['block'][$block_tag]);
  47. }
  48. }
  49. /**
  50. * Unregisters compiler function
  51. *
  52. * @param string $compiler_tag name of template function
  53. */
  54. function compilerFunction($compiler_tag)
  55. {
  56. if (isset($this->smarty->registered_plugins['compiler'][$compiler_tag])) {
  57. unset($this->smarty->registered_plugins['compiler'][$compiler_tag]);
  58. }
  59. }
  60. /**
  61. * Unregisters custom function
  62. *
  63. * @param string $function_tag name of template function
  64. */
  65. function templateFunction($function_tag)
  66. {
  67. if (isset($this->smarty->registered_plugins['function'][$function_tag])) {
  68. unset($this->smarty->registered_plugins['function'][$function_tag]);
  69. }
  70. }
  71. /**
  72. * Unregisters modifier
  73. *
  74. * @param string $modifier name of template modifier
  75. */
  76. function modifier($modifier)
  77. {
  78. if (isset($this->smarty->registered_plugins['modifier'][$modifier])) {
  79. unset($this->smarty->registered_plugins['modifier'][$modifier]);
  80. }
  81. }
  82. /**
  83. * Unregisters template object
  84. *
  85. * @param string $object_name name of template object
  86. */
  87. function templateObject($object_name)
  88. {
  89. unset($this->smarty->registered_objects[$object_name]);
  90. }
  91. /**
  92. * Unregisters an output filter
  93. *
  94. * @param callback $function_name
  95. */
  96. function outputFilter($function_name)
  97. {
  98. unset($this->smarty->registered_filters['output'][$this->smarty->_get_filter_name($function_name)]);
  99. }
  100. /**
  101. * Unregisters a postfilter function
  102. *
  103. * @param callback $function_name
  104. */
  105. function postFilter($function_name)
  106. {
  107. unset($this->smarty->registered_filters['post'][$this->smarty->_get_filter_name($function_name)]);
  108. }
  109. /**
  110. * Unregisters a prefilter function
  111. *
  112. * @param callback $function_name
  113. */
  114. function preFilter($function_name)
  115. {
  116. unset($this->smarty->registered_filters['pre'][$this->smarty->_get_filter_name($function_name)]);
  117. }
  118. /**
  119. * Unregisters a resource
  120. *
  121. * @param string $resource_name name of resource
  122. */
  123. function resource($resource_name)
  124. {
  125. unset($this->smarty->plugins['resource'][$resource_name]);
  126. }
  127. /**
  128. * Unregisters a variablefilter function
  129. *
  130. * @param callback $function_name
  131. */
  132. function variableFilter($function_name)
  133. {
  134. unset($this->smarty->registered_filters['variable'][$this->smarty->_get_filter_name($function_name)]);
  135. }
  136. }