From ebcd4c6fdd11354367833481b2f159091d6ace77 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 26 Jul 2010 08:13:20 +0000 Subject: [PATCH] Updated system listing git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19098 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/class_systemManagement.inc | 34 +++++++++++++++++-- .../systems/admin/systems/system-list.xml | 2 +- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc index d6518ad9a..d49555a2a 100644 --- a/gosa-plugins/systems/admin/systems/class_systemManagement.inc +++ b/gosa-plugins/systems/admin/systems/class_systemManagement.inc @@ -99,6 +99,7 @@ class systemManagement extends management $headpage = new listing(get_template_path("system-list.xml", true)); $headpage->registerElementFilter("systemRelease", "systemManagement::systemRelease"); $headpage->registerElementFilter("filterSystemDescription", "systemManagement::filterSystemDescription"); + $headpage->registerElementFilter("filterLink", "systemManagement::filterLink"); $headpage->setFilter($filter); $filter->setConverter('systemManagement::incomingFilterConverter'); @@ -1367,7 +1368,8 @@ class systemManagement extends management static function filterSystemDescription($row,$dn,$pid,$state,$description=array()) { $dn= LDAP::fix(func_get_arg(1)); - $desc = isset($description[0])?$description[0]:""; + $desc = isset($description[0])?set_post($description[0]):""; + $rc = ""; switch($state){ case 'locked' : $rc = ""; break; @@ -1375,9 +1377,37 @@ class systemManagement extends management case 'busy' : $rc = ""; break; case 'warning' : $rc = ""; break; } - return("".set_post($desc)."{$rc}"); + return("".$desc."{$rc}"); } + + static function filterLink() + { + $result= " "; + $row= func_get_arg(0); + $pid= func_get_arg(4); + $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 e719021e7..146537b70 100644 --- a/gosa-plugins/systems/admin/systems/system-list.xml +++ b/gosa-plugins/systems/admin/systems/system-list.xml @@ -169,7 +169,7 @@ cn string - %{filter:link(row,dn,"%s",cn)} + %{filter:filterLink(row,dn,"%s",cn,pid)} true -- 2.30.2