Smarty v5 update test, initial code setup
This commit is contained in:
44
test/plugins/function.popup_init.php
Normal file
44
test/plugins/function.popup_init.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Smarty plugin
|
||||
* @package Smarty
|
||||
* @subpackage plugins
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Smarty {popup_init} function plugin
|
||||
*
|
||||
* Type: function<br>
|
||||
* Name: popup_init<br>
|
||||
* Purpose: initialize overlib
|
||||
* @author Monte Ohrt <monte at ohrt dot com>
|
||||
* @author 2024 Clemens Schwaighofer <gullevek at gullevek dot org>
|
||||
* @param array
|
||||
* @param Smarty
|
||||
* @return string
|
||||
*/
|
||||
function smarty_function_popup_init($params, &$smarty)
|
||||
{
|
||||
/* $zindex = 1000;
|
||||
|
||||
if (!empty($params['zindex'])) {
|
||||
$zindex = $params['zindex'];
|
||||
} */
|
||||
|
||||
if (!empty($params['src'])) {
|
||||
return str_replace(
|
||||
[/*"{ZINDEX}", */"{SCRIPT_SOURCE}"],
|
||||
[/*$zindex, */$params['src']],
|
||||
// <!-- <div id="overDiv" style="position:absolute; visibility:hidden; z-index:{ZINDEX};"></div> -->
|
||||
<<<HTML
|
||||
<script type="text/javascript" language="JavaScript" src="{SCRIPT_SOURCE}"></script>
|
||||
HTML
|
||||
);
|
||||
} else {
|
||||
$smarty->trigger_error("popup_init: missing src parameter");
|
||||
}
|
||||
}
|
||||
|
||||
// __END__
|
||||
Reference in New Issue
Block a user