Mixin_NextGen_Basic_Templates

Class Mixin_NextGen_Basic_Templates.

Defined (1)

The class is defined in the following location(s).

/products/photocrati_nextgen/modules/nextgen_basic_templates/package.module.nextgen_basic_templates.php  
  1. class Mixin_NextGen_Basic_Templates extends Mixin 
  2. /** 
  3. * Renders NextGen-Legacy style templates 
  4. * @param string $template_name File name 
  5. * @param array $vars Specially formatted array of parameters 
  6. * @param bool $callback 
  7. * @param bool $return 
  8. */ 
  9. function legacy_render($template_name, $vars = array(), $return = FALSE, $prefix = NULL) 
  10. $retval = "[Not a valid template]"; 
  11. $template_locator = C_Legacy_Template_Locator::get_instance(); 
  12. // search first for files with their prefix 
  13. $template_abspath = $template_locator->find($prefix . '-' . $template_name); 
  14. if (!$template_abspath) { 
  15. $template_abspath = $template_locator->find($template_name); 
  16. if ($template_abspath) { 
  17. // render the template 
  18. extract($vars); 
  19. if ($return) { 
  20. ob_start(); 
  21. include $template_abspath; 
  22. if ($return) { 
  23. $retval = ob_get_contents(); 
  24. ob_end_clean(); 
  25. return $retval;