| 1: | <?php
|
| 2: |
|
| 3: | |
| 4: | |
| 5: | |
| 6: | |
| 7: | |
| 8: | |
| 9: | |
| 10: | |
| 11: |
|
| 12: | class Smarty_Internal_Method_UnregisterFilter extends Smarty_Internal_Method_RegisterFilter
|
| 13: | {
|
| 14: | |
| 15: | |
| 16: | |
| 17: | |
| 18: | |
| 19: | |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | |
| 25: | |
| 26: | |
| 27: |
|
| 28: | public function unregisterFilter(Smarty_Internal_TemplateBase $obj, $type, $callback)
|
| 29: | {
|
| 30: | $smarty = $obj->_getSmartyObj();
|
| 31: | $this->_checkFilterType($type);
|
| 32: | if (isset($smarty->registered_filters[ $type ])) {
|
| 33: | $name = is_string($callback) ? $callback : $this->_getFilterName($callback);
|
| 34: | if (isset($smarty->registered_filters[ $type ][ $name ])) {
|
| 35: | unset($smarty->registered_filters[ $type ][ $name ]);
|
| 36: | if (empty($smarty->registered_filters[ $type ])) {
|
| 37: | unset($smarty->registered_filters[ $type ]);
|
| 38: | }
|
| 39: | }
|
| 40: | }
|
| 41: | return $obj;
|
| 42: | }
|
| 43: | }
|
| 44: | |