PageRenderTime 10ms CodeModel.GetById 2ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/framework/vendor/smarty3/lib/libs/plugins/function.popup_init.php

http://zoop.googlecode.com/
PHP | 41 lines | 15 code | 6 blank | 20 comment | 3 complexity | 44cd30453848de871b44965f6674034a MD5 | raw file
 1<?php
 2/**
 3 * Smarty plugin
 4 * @package Smarty
 5 * @subpackage PluginsFunction
 6 */
 7
 8
 9/**
10 * Smarty {popup_init} function plugin
11 *
12 * Type:     function<br>
13 * Name:     popup_init<br>
14 * Purpose:  initialize overlib
15 * @link http://smarty.php.net/manual/en/language.function.popup.init.php {popup_init}
16 *          (Smarty online manual)
17 * @author   Monte Ohrt <monte at ohrt dot com>
18 * @param array $params parameters
19 * @param object $smarty Smarty object
20 * @param object $template template object
21 * @return string 
22 */
23function smarty_function_popup_init($params, $smarty, $template)
24{
25    $zindex = 1000;
26    
27    if (!empty($params['zindex'])) {
28        $zindex = $params['zindex'];
29    }
30    
31    if (!empty($params['src'])) {
32        return '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:'.$zindex.';"></div>' . "\n"
33         . '<script type="text/javascript" language="JavaScript" src="'.$params['src'].'"></script>' . "\n";
34    } else {
35        trigger_error("popup_init: missing src parameter",E_USER_WARNING);
36    }
37}
38
39/* vim: set expandtab: */
40
41?>