Location: PHPKode > projects > Batavi > batavi/ext/smarty/plugin/function.include_script.php
<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */


  /**
   * file function.include_script.php
   *
   * Smarty function include_script plugin
   *
   * Type:     function<br>
   * Name:     include_script<br>
   * Purpose:  includes files from script directory 
   * @copyright Copyright (c) 2009, ICEshop BV
   * @param array of parameters
   * @param smarty object
   * @return string
   */
  function smarty_function_include_script($params, &$smarty) {
    if (!empty($params['file'])) {
      if (file_exists('templates/'.DEFAULT_TEMPLATE.'/script/'.$params['file'])) {
        return '<script language="JavaScript" type="text/javascript" src="templates/'.DEFAULT_TEMPLATE.'/script/'.$params['file'].'"></script>';
      } else if (file_exists('templates/'.$smarty->_initial_template.'/script/'.$params['file'])) {
        return '<script language="JavaScript" type="text/javascript" src="templates/'.$smarty->_initial_template.'/script/'.$params['file'].'"></script>';
      } 
    }
    return '';
  }
?>
Return current item: Batavi