Update smarty from 3.0.5 to 3.0.7
See http://smarty-php.googlecode.com/svn/trunk/distribution/change_log.txt for a list of all changes. New files: libs/sysplugins/smarty_internal_get_include_path.php libs/plugins/shared.mb_str_replace.php Deleted files (no longer shipped with smarty): libs/plugins/function.popup.php libs/plugins/function.popup_init.php git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@972 a1433add-5e2c-0410-b055-b7f2511e0802pull/2/head
parent
476035efd1
commit
82778dba1e
@ -1,118 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Smarty plugin
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage PluginsFunction
|
||||
*/
|
||||
|
||||
/**
|
||||
* Smarty {popup} function plugin
|
||||
*
|
||||
* Type: function<br>
|
||||
* Name: popup<br>
|
||||
* Purpose: make text pop up in windows via overlib
|
||||
* @link http://smarty.php.net/manual/en/language.function.popup.php {popup}
|
||||
* (Smarty online manual)
|
||||
* @author Monte Ohrt <monte at ohrt dot com>
|
||||
* @param array $params parameters
|
||||
* @param object $template template object
|
||||
* @return string
|
||||
*/
|
||||
function smarty_function_popup($params, $template)
|
||||
{
|
||||
$append = '';
|
||||
foreach ($params as $_key=>$_value) {
|
||||
switch ($_key) {
|
||||
case 'text':
|
||||
case 'trigger':
|
||||
case 'function':
|
||||
case 'inarray':
|
||||
$$_key = (string)$_value;
|
||||
if ($_key == 'function' || $_key == 'inarray')
|
||||
$append .= ',' . strtoupper($_key) . ",'$_value'";
|
||||
break;
|
||||
|
||||
case 'caption':
|
||||
case 'closetext':
|
||||
case 'status':
|
||||
$append .= ',' . strtoupper($_key) . ",'" . str_replace("'","\'",$_value) . "'";
|
||||
break;
|
||||
|
||||
case 'fgcolor':
|
||||
case 'bgcolor':
|
||||
case 'textcolor':
|
||||
case 'capcolor':
|
||||
case 'closecolor':
|
||||
case 'textfont':
|
||||
case 'captionfont':
|
||||
case 'closefont':
|
||||
case 'fgbackground':
|
||||
case 'bgbackground':
|
||||
case 'caparray':
|
||||
case 'capicon':
|
||||
case 'background':
|
||||
case 'frame':
|
||||
$append .= ',' . strtoupper($_key) . ",'$_value'";
|
||||
break;
|
||||
|
||||
case 'textsize':
|
||||
case 'captionsize':
|
||||
case 'closesize':
|
||||
case 'width':
|
||||
case 'height':
|
||||
case 'border':
|
||||
case 'offsetx':
|
||||
case 'offsety':
|
||||
case 'snapx':
|
||||
case 'snapy':
|
||||
case 'fixx':
|
||||
case 'fixy':
|
||||
case 'padx':
|
||||
case 'pady':
|
||||
case 'timeout':
|
||||
case 'delay':
|
||||
$append .= ',' . strtoupper($_key) . ",$_value";
|
||||
break;
|
||||
|
||||
case 'sticky':
|
||||
case 'left':
|
||||
case 'right':
|
||||
case 'center':
|
||||
case 'above':
|
||||
case 'below':
|
||||
case 'noclose':
|
||||
case 'autostatus':
|
||||
case 'autostatuscap':
|
||||
case 'fullhtml':
|
||||
case 'hauto':
|
||||
case 'vauto':
|
||||
case 'mouseoff':
|
||||
case 'followmouse':
|
||||
case 'closeclick':
|
||||
case 'wrap':
|
||||
if ($_value) $append .= ',' . strtoupper($_key);
|
||||
break;
|
||||
|
||||
default:
|
||||
trigger_error("[popup] unknown parameter $_key", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($text) && !isset($inarray) && empty($function)) {
|
||||
trigger_error("overlib: attribute 'text' or 'inarray' or 'function' required",E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (empty($trigger)) { $trigger = "onmouseover"; }
|
||||
|
||||
$retval = $trigger . '="return overlib(\''.preg_replace(array("!'!",'!"!',"![\r\n]!"),array("\'","\'",'\r'),$text).'\'';
|
||||
$retval .= $append . ');"';
|
||||
if ($trigger == 'onmouseover')
|
||||
$retval .= ' onmouseout="nd();"';
|
||||
|
||||
|
||||
return $retval;
|
||||
}
|
||||
|
||||
?>
|
@ -1,39 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Smarty plugin
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage PluginsFunction
|
||||
*/
|
||||
|
||||
/**
|
||||
* Smarty {popup_init} function plugin
|
||||
*
|
||||
* Type: function<br>
|
||||
* Name: popup_init<br>
|
||||
* Purpose: initialize overlib
|
||||
* @link http://smarty.php.net/manual/en/language.function.popup.init.php {popup_init}
|
||||
* (Smarty online manual)
|
||||
* @author Monte Ohrt <monte at ohrt dot com>
|
||||
* @param array $params parameters
|
||||
* @param object $template template object
|
||||
* @return string
|
||||
*/
|
||||
|
||||
function smarty_function_popup_init($params, $template)
|
||||
{
|
||||
$zindex = 1000;
|
||||
|
||||
if (!empty($params['zindex'])) {
|
||||
$zindex = $params['zindex'];
|
||||
}
|
||||
|
||||
if (!empty($params['src'])) {
|
||||
return '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:'.$zindex.';"></div>' . "\n"
|
||||
. '<script type="text/javascript" language="JavaScript" src="'.$params['src'].'"></script>' . "\n";
|
||||
} else {
|
||||
trigger_error("popup_init: missing src parameter",E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
if(!function_exists('smarty_mb_str_replace')) {
|
||||
function smarty_mb_str_replace($search, $replace, $subject, &$count=0) {
|
||||
if (!is_array($search) && is_array($replace)) {
|
||||
return false;
|
||||
}
|
||||
if (is_array($subject)) {
|
||||
// call mb_replace for each single string in $subject
|
||||
foreach ($subject as &$string) {
|
||||
$string = &smarty_mb_str_replace($search, $replace, $string, $c);
|
||||
$count += $c;
|
||||
}
|
||||
} elseif (is_array($search)) {
|
||||
if (!is_array($replace)) {
|
||||
foreach ($search as &$string) {
|
||||
$subject = smarty_mb_str_replace($string, $replace, $subject, $c);
|
||||
$count += $c;
|
||||
}
|
||||
} else {
|
||||
$n = max(count($search), count($replace));
|
||||
while ($n--) {
|
||||
$subject = smarty_mb_str_replace(current($search), current($replace), $subject, $c);
|
||||
$count += $c;
|
||||
next($search);
|
||||
next($replace);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$parts = mb_split(preg_quote($search), $subject);
|
||||
$count = count($parts)-1;
|
||||
$subject = implode($replace, $parts);
|
||||
}
|
||||
return $subject;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Smarty read include path plugin
|
||||
*
|
||||
* @package Smarty
|
||||
* @subpackage PluginsInternal
|
||||
* @author Monte Ohrt
|
||||
*/
|
||||
|
||||
/**
|
||||
* Smarty Internal Read Include Path Class
|
||||
*/
|
||||
class Smarty_Internal_Get_Include_Path {
|
||||
/**
|
||||
* Return full file path from PHP include_path
|
||||
*
|
||||
* @param string $filepath filepath
|
||||
* @return mixed full filepath or false
|
||||
*/
|
||||
public static function getIncludePath($filepath)
|
||||
{
|
||||
static $_path_array = null;
|
||||
|
||||
if(!isset($_path_array)) {
|
||||
$_ini_include_path = ini_get('include_path');
|
||||
|
||||
if(strstr($_ini_include_path,';')) {
|
||||
// windows pathnames
|
||||
$_path_array = explode(';',$_ini_include_path);
|
||||
} else {
|
||||
$_path_array = explode(':',$_ini_include_path);
|
||||
}
|
||||
}
|
||||
foreach ($_path_array as $_include_path) {
|
||||
if (file_exists($_include_path . DS . $filepath)) {
|
||||
return $_include_path . DS . $filepath;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue