1 |
<?php |
<?php |
2 |
|
/** |
|
/* |
|
3 |
* Smarty plugin |
* Smarty plugin |
4 |
* ------------------------------------------------------------- |
* @package Smarty |
5 |
* Type: function |
* @subpackage plugins |
6 |
* Name: popup_init |
*/ |
7 |
|
|
8 |
|
|
9 |
|
/** |
10 |
|
* Smarty {popup_init} function plugin |
11 |
|
* |
12 |
|
* Type: function<br> |
13 |
|
* Name: popup_init<br> |
14 |
* Purpose: initialize overlib |
* Purpose: initialize overlib |
15 |
* ------------------------------------------------------------- |
* @link http://smarty.php.net/manual/en/language.function.popup.init.php {popup_init} |
16 |
|
* (Smarty online manual) |
17 |
|
* @param array |
18 |
|
* @param Smarty |
19 |
|
* @return string |
20 |
*/ |
*/ |
21 |
function smarty_function_popup_init($params, &$smarty) |
function smarty_function_popup_init($params, &$smarty) |
22 |
{ |
{ |
23 |
$zindex = 1000; |
$zindex = 1000; |
24 |
|
|
25 |
if (!empty($params['zindex'])) { |
if (!empty($params['zindex'])) { |
26 |
$zindex = $params['zindex']; |
$zindex = $params['zindex']; |
27 |
} |
} |
28 |
|
|
29 |
if (!empty($params['src'])) { |
if (!empty($params['src'])) { |
30 |
echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:'.$zindex.';"></div>'."\n"; |
return '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:'.$zindex.';"></div>' . "\n" |
31 |
echo '<script type="text/javascript" language="JavaScript" src="'.$params['src'].'"></script>'."\n"; |
. '<script type="text/javascript" language="JavaScript" src="'.$params['src'].'"></script>' . "\n"; |
32 |
} else { |
} else { |
33 |
$smarty->trigger_error("popup_init: missing src parameter"); |
$smarty->trigger_error("popup_init: missing src parameter"); |
34 |
} |
} |