index 21813350df90975a6d736eae9f2b96a658cba1d3..aeb543b7e0c7e89c3243e312f90c2284b6ec1769 100644 (file)
/* Return an image description using the path */
-function image($path, $label= null, $action= "", $title= "", $align= "middle")
+function image($path, $action= "", $title= "", $align= "middle")
{
global $config;
global $BASE_DIR;
+ $label= null;
// Bail out, if there's no style file
if(!session::global_is_set("img-styles")){
@@ -3544,6 +3545,11 @@ function image($path, $label= null, $action= "", $title= "", $align= "middle")
}
$styles= session::global_get('img-styles');
+ /* Extract labels from path */
+ if (preg_match("/\.png\[(.*)\]$/", $path, $matches)) {
+ $label= $matches[1];
+ }
+
$lbl= "";
if ($label) {
if (isset($styles["images/label-".$label.".png"])) {
@@ -3551,6 +3557,8 @@ function image($path, $label= null, $action= "", $title= "", $align= "middle")
} else {
die("Invalid label specified: $label\n");
}
+
+ $path= preg_replace("/\[.*\]$/", "", $path);
}
// Non middle layout?