Upgraded to latest version of Smarty 2.6.9
This commit is contained in:
@@ -9,23 +9,22 @@
|
||||
/**
|
||||
* Smarty {html_image} function plugin
|
||||
*
|
||||
* Type: function<br />
|
||||
* Name: html_image<br />
|
||||
* Date: Feb 24, 2003<br />
|
||||
* Purpose: format HTML tags for the image<br />
|
||||
* Input:<br />
|
||||
* Type: function<br>
|
||||
* Name: html_image<br>
|
||||
* Date: Feb 24, 2003<br>
|
||||
* Purpose: format HTML tags for the image<br>
|
||||
* Input:<br>
|
||||
* - file = file (and path) of image (required)
|
||||
* - border = border width (optional, default 0)
|
||||
* - height = image height (optional, default actual height)
|
||||
* - image =image width (optional, default actual width)
|
||||
* - width = image width (optional, default actual width)
|
||||
* - basedir = base directory for absolute paths, default
|
||||
* is environment variable DOCUMENT_ROOT
|
||||
*
|
||||
* Examples: {html_image file="images/masthead.gif"}
|
||||
* Output: <img src="images/masthead.gif" border=0 width=400 height=23>
|
||||
* Output: <img src="images/masthead.gif" width=400 height=23>
|
||||
* @link http://smarty.php.net/manual/en/language.function.html.image.php {html_image}
|
||||
* (Smarty online manual)
|
||||
* @author Monte Ohrt <monte@ispi.net>
|
||||
* @author Monte Ohrt <monte at ohrt dot com>
|
||||
* @author credits to Duda <[email protected]> - wrote first image function
|
||||
* in repository, helped with lots of functionality
|
||||
* @version 1.0
|
||||
@@ -40,7 +39,6 @@ function smarty_function_html_image($params, &$smarty)
|
||||
|
||||
$alt = '';
|
||||
$file = '';
|
||||
$border = 0;
|
||||
$height = '';
|
||||
$width = '';
|
||||
$extra = '';
|
||||
@@ -51,7 +49,6 @@ function smarty_function_html_image($params, &$smarty)
|
||||
foreach($params as $_key => $_val) {
|
||||
switch($_key) {
|
||||
case 'file':
|
||||
case 'border':
|
||||
case 'height':
|
||||
case 'width':
|
||||
case 'dpi':
|
||||
@@ -97,7 +94,7 @@ function smarty_function_html_image($params, &$smarty)
|
||||
if(!isset($params['width']) || !isset($params['height'])) {
|
||||
if ($smarty->security &&
|
||||
($_params = array('resource_type' => 'file', 'resource_name' => $_image_path)) &&
|
||||
(require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.is_secure.php')) &&
|
||||
(require_once(SMARTY_CORE_DIR . 'core.is_secure.php')) &&
|
||||
(!smarty_core_is_secure($_params, $smarty)) ) {
|
||||
$smarty->trigger_error("html_image: (secure) '$_image_path' not in secure directory", E_USER_NOTICE);
|
||||
|
||||
@@ -134,7 +131,7 @@ function smarty_function_html_image($params, &$smarty)
|
||||
$height = round($height * $_resize);
|
||||
}
|
||||
|
||||
return $prefix . '<img src="'.$file.'" alt="'.$alt.'" border="'.$border.'" width="'.$width.'" height="'.$height.'"'.$extra.' />' . $suffix;
|
||||
return $prefix . '<img src="'.$file.'" alt="'.$alt.'" width="'.$width.'" height="'.$height.'"'.$extra.' />' . $suffix;
|
||||
}
|
||||
|
||||
/* vim: set expandtab: */
|
||||
|
||||
Reference in New Issue
Block a user