Code

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