Changeset 3953 for trunk/include
- Timestamp:
- Oct 1, 2009, 5:11:58 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/template.class.php
r3951 r3953 432 432 function set_prefilter($handle, $callback, $weight=50) 433 433 { 434 $this->external_filters[$handle][$weight][] = array('pre ', $callback);434 $this->external_filters[$handle][$weight][] = array('prefilter', $callback); 435 435 ksort($this->external_filters[$handle]); 436 436 } … … 438 438 function set_postfilter($handle, $callback, $weight=50) 439 439 { 440 $this->external_filters[$handle][$weight][] = array('post ', $callback);440 $this->external_filters[$handle][$weight][] = array('postfilter', $callback); 441 441 ksort($this->external_filters[$handle]); 442 442 } … … 444 444 function set_outputfilter($handle, $callback, $weight=50) 445 445 { 446 $this->external_filters[$handle][$weight][] = array('output ', $callback);446 $this->external_filters[$handle][$weight][] = array('outputfilter', $callback); 447 447 ksort($this->external_filters[$handle]); 448 448 } … … 464 464 list($type, $callback) = $filter; 465 465 $compile_id .= $type.( is_array($callback) ? implode('', $callback) : $callback ); 466 switch ($type) 467 { 468 case 'pre': 469 $this->smarty->register_prefilter($callback); 470 break; 471 case 'post': 472 $this->smarty->register_postfilter($callback); 473 break; 474 case 'output': 475 $this->smarty->register_outputfilter($callback); 476 break; 477 } 466 call_user_func(array($this->smarty, 'register_'.$type), $callback); 478 467 } 479 468 } … … 491 480 { 492 481 list($type, $callback) = $filter; 493 switch ($type) 494 { 495 case 'pre': 496 $this->smarty->unregister_prefilter($callback); 497 break; 498 case 'post': 499 $this->smarty->unregister_postfilter($callback); 500 break; 501 case 'output': 502 $this->smarty->unregister_outputfilter($callback); 503 break; 504 } 482 call_user_func(array($this->smarty, 'unregister_'.$type), $callback); 505 483 } 506 484 }
Note: See TracChangeset
for help on using the changeset viewer.