Code

Updated smarty image function
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 3 Mar 2010 11:40:56 +0000 (11:40 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 3 Mar 2010 11:40:56 +0000 (11:40 +0000)
Fixed listing class. Single actiontrigger entries will now be rendered .

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15911 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_listing.inc
gosa-core/include/smarty/plugins/function.image.php

index a1f6a3c80ef7e763d757f44651823348ec0b4042..2bf9e3b5935c9a597b6cb69e705c3f4126132004 100644 (file)
@@ -839,6 +839,11 @@ class listing {
     // Go thru all actions
     $result= "";
     $actions= $this->xmlData['actiontriggers']['action'];
+
+    // Ensure we've a valid actions array, if there is only one action in the actiontriggers col
+    //  then we've to create a valid array here.
+    if(isset($actions['name'])) $actions = array($actions);
+
     foreach($actions as $action) {
       // Skip the entry completely if there's no permission to execute it
       if (!$this->hasActionPermission($action, $dn, $classes)) {
index b20be0cfe7b46b86c7a61df4868576e2e3618b1a..62573a27948a989564dd08ebf138ec421adb252d 100644 (file)
@@ -7,7 +7,12 @@ function smarty_function_image($params, &$smarty)
   $title = (isset($params['title']))? $params['title'] :"";
   $align = (isset($params['align']))? $params['align'] :"";
   //print_a(array($path,$label,$action,$title,$align));
-  echo image($path,$action,$title,$align);
+
+  if(!empty($align)){
+    echo image($path,$action,$title,$align);
+  }else{
+    echo image($path,$action,$title);
+  }
 }
   
 ?>