Chris PeBenito 696b41
Chris PeBenito 696b41
/**
Chris PeBenito 696b41
 * Smarty plugin
Chris PeBenito 696b41
 * @package Smarty
Chris PeBenito 696b41
 * @subpackage plugins
Chris PeBenito 696b41
 */
Chris PeBenito 696b41
Chris PeBenito 696b41
Chris PeBenito 696b41
/**
Chris PeBenito 696b41
 * Smarty {popup_init} function plugin
Chris PeBenito 696b41
 *
Chris PeBenito 696b41
 * Type:     function
Chris PeBenito 696b41
 * Name:     popup_init
Chris PeBenito 696b41
 * Purpose:  initialize overlib
Chris PeBenito 696b41
 * @link http://smarty.php.net/manual/en/language.function.popup.init.php {popup_init}
Chris PeBenito 696b41
 *          (Smarty online manual)
Chris PeBenito 696b41
 * @param array
Chris PeBenito 696b41
 * @param Smarty
Chris PeBenito 696b41
 * @return string
Chris PeBenito 696b41
 */
Chris PeBenito 696b41
function smarty_function_popup_init($params, &$smarty)
Chris PeBenito 696b41
{
Chris PeBenito 696b41
    $zindex = 1000;
Chris PeBenito 696b41
    
Chris PeBenito 696b41
    if (!empty($params['zindex'])) {
Chris PeBenito 696b41
        $zindex = $params['zindex'];
Chris PeBenito 696b41
    }
Chris PeBenito 696b41
    
Chris PeBenito 696b41
    if (!empty($params['src'])) {
Chris PeBenito 696b41
        return '
' . "\n"
Chris PeBenito 696b41
         . '<script type="text/javascript" language="JavaScript" src="'.$params['src'].'"></script>' . "\n";
Chris PeBenito 696b41
    } else {
Chris PeBenito 696b41
        $smarty->trigger_error("popup_init: missing src parameter");
Chris PeBenito 696b41
    }
Chris PeBenito 696b41
}
Chris PeBenito 696b41
Chris PeBenito 696b41
/* vim: set expandtab: */
Chris PeBenito 696b41
Chris PeBenito 696b41
?>