From: hickert Date: Thu, 29 Apr 2010 14:54:57 +0000 (+0000) Subject: Prepared systemManagement to colour the list rows for type of systems X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cc7ef9ed541c588661d6cd594e7b5293a0a86663;p=gosa.git Prepared systemManagement to colour the list rows for type of systems git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17973 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc index 5130a1c28..94f8a7bc4 100644 --- a/gosa-plugins/systems/admin/systems/class_systemManagement.inc +++ b/gosa-plugins/systems/admin/systems/class_systemManagement.inc @@ -97,6 +97,7 @@ class systemManagement extends management // Build headpage $headpage = new listing(get_template_path("system-list.xml", true)); $headpage->registerElementFilter("systemRelease", "systemManagement::systemRelease"); + $headpage->registerElementFilter("filterSystemDescription", "systemManagement::filterSystemDescription"); $headpage->setFilter($filter); $filter->setConverter('systemManagement::incomingFilterConverter'); @@ -1362,6 +1363,33 @@ class systemManagement extends management } + static function filterSystemDescription($row,$dn,$pid,$description=array()) + { + $result= " "; + + $row= func_get_arg(0); + $dn= LDAP::fix(func_get_arg(1)); + $params= array(func_get_arg(2)); + + // Collect sprintf params + for ($i = 3;$i < func_num_args();$i++) { + $val= func_get_arg($i); + if (is_array($val)){ + $params[]= $val[0]; + continue; + } + $params[]= $val; + } + + $result= " "; + $trans= call_user_func_array("sprintf", $params); + if ($trans != "") { + return("$trans"); + } + + return $result; + } + static function systemRelease($a,$b,$c,$objectclasses= null,$class= null) { global $config; diff --git a/gosa-plugins/systems/admin/systems/system-list.xml b/gosa-plugins/systems/admin/systems/system-list.xml index b9c68c856..754f5a1f2 100644 --- a/gosa-plugins/systems/admin/systems/system-list.xml +++ b/gosa-plugins/systems/admin/systems/system-list.xml @@ -177,7 +177,7 @@ description string - %{filter:link(row,dn,"%s",description)} + %{filter:filterSystemDescription(row,dn,pid,description)} true