Code

Removed smarty packages from references
[gosa.git] / gosa-core / include / smarty / plugins / function.html_image.php
index e2714a67eb3628b49cc2d652e19681b9f369f16b..2f1ef6413c3780c9cdb415c7bab7972a22debcb6 100644 (file)
  * Name:     html_image<br>
  * Date:     Feb 24, 2003<br>
  * Purpose:  format HTML tags for the image<br>
- * Examples: {html_image file="/images/masthead.gif"}
- * Output:   <img src="/images/masthead.gif" width=400 height=23>
+ * Examples: {html_image file="/images/masthead.gif"}<br>
+ * Output:   <img src="/images/masthead.gif" width=400 height=23><br>
+ * Params:
+ * <pre>
+ * - file        - (required) - file (and path) of image
+ * - height      - (optional) - image height (default actual height)
+ * - width       - (optional) - image width (default actual width)
+ * - basedir     - (optional) - base directory for absolute paths, default is environment variable DOCUMENT_ROOT
+ * - path_prefix - prefix for path output (optional, default empty)
+ * </pre>
  * 
- * @link http://smarty.php.net/manual/en/language.function.html.image.php {html_image}
+ * @link http://www.smarty.net/manual/en/language.function.html.image.php {html_image}
  *      (Smarty online manual)
  * @author Monte Ohrt <monte at ohrt dot com> 
  * @author credits to Duda <duda@big.hu> 
  * @version 1.0
- * @param array $params parameters
- * Input:<br>
- *          - file = file (and path) of image (required)
- *          - height = image height (optional, default actual height)
- *          - width = image width (optional, default actual width)
- *          - basedir = base directory for absolute paths, default
- *                      is environment variable DOCUMENT_ROOT
- *          - path_prefix = prefix for path output (optional, default empty)
- * @param object $smarty Smarty object
- * @param object $template template object
+ * @param array                    $params   parameters
+ * @param Smarty_Internal_Template $template template object
  * @return string 
  * @uses smarty_function_escape_special_chars()
  */
-function smarty_function_html_image($params, $smarty, $template)
+function smarty_function_html_image($params, $template)
 {
     require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
-    //$smarty->loadPlugin('Smarty_shared_escape_special_chars');
-
     $alt = '';
     $file = '';
     $height = '';
@@ -47,7 +46,7 @@ function smarty_function_html_image($params, $smarty, $template)
     $prefix = '';
     $suffix = '';
     $path_prefix = '';
-    $server_vars = ($smarty->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS'];
+    $server_vars = $_SERVER;
     $basedir = isset($server_vars['DOCUMENT_ROOT']) ? $server_vars['DOCUMENT_ROOT'] : '';
     foreach($params as $_key => $_val) {
         switch ($_key) {
@@ -108,8 +107,8 @@ function smarty_function_html_image($params, $smarty, $template)
                 return;
             } 
         } 
-        if ($template->security) {
-            if (!$smarty->security_handler->isTrustedResourceDir($_image_path)) {
+        if (isset($template->smarty->security_policy)) {
+            if (!$template->smarty->security_policy->isTrustedResourceDir($_image_path)) {
                 return;
             } 
         }