Code

Updated smarty image function
[gosa.git] / gosa-core / include / functions.inc
index 447e9a1aa75f1fa089127b8b46fd0bb27f037b26..aeb543b7e0c7e89c3243e312f90c2284b6ec1769 100644 (file)
@@ -3546,9 +3546,8 @@ function image($path, $action= "", $title= "", $align= "middle")
   $styles= session::global_get('img-styles');
 
   /* Extract labels from path */
-  if (preg_match("/(-[a-z0-9]+)\.png$/", $path, $matches)) {
-    print_a($matches);
-    exit;
+  if (preg_match("/\.png\[(.*)\]$/", $path, $matches)) {
+    $label= $matches[1];
   }
 
   $lbl= "";
@@ -3558,6 +3557,8 @@ function image($path, $action= "", $title= "", $align= "middle")
     } else {
       die("Invalid label specified: $label\n");
     }
+
+    $path= preg_replace("/\[.*\]$/", "", $path);
   }
 
   // Non middle layout?