From 4422a4580f46e49a3b7459c0a02ecb3f8062d768 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 3 Mar 2010 11:40:56 +0000 Subject: [PATCH] Updated smarty image function 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 | 5 +++++ gosa-core/include/smarty/plugins/function.image.php | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gosa-core/include/class_listing.inc b/gosa-core/include/class_listing.inc index a1f6a3c80..2bf9e3b59 100644 --- a/gosa-core/include/class_listing.inc +++ b/gosa-core/include/class_listing.inc @@ -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)) { diff --git a/gosa-core/include/smarty/plugins/function.image.php b/gosa-core/include/smarty/plugins/function.image.php index b20be0cfe..62573a279 100644 --- a/gosa-core/include/smarty/plugins/function.image.php +++ b/gosa-core/include/smarty/plugins/function.image.php @@ -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); + } } ?> -- 2.30.2