Code

Added filter possibility for buttons
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 17 Sep 2009 12:43:47 +0000 (12:43 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 17 Sep 2009 12:43:47 +0000 (12:43 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14269 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_listing.inc

index 3152261315bf622e870a439b4cde30fcc47ca6a5..8139214dfb19efb0e0a962a14f7ed576f2568f2a 100644 (file)
@@ -772,9 +772,20 @@ class listing {
     foreach($actions as $action) {
       // Skip the entry completely if there's no permission to execute it
       if (!$this->hasActionPermission($action, $dn)) {
+        $result.= "<img src='images/empty.png' alt=' ' class='center' style='padding:1px'>";
         continue;
       }
 
+      // Skip entry if the pseudo filter does not fit
+      if (isset($action['filter']) && preg_match('/^[a-z0-9_]+=[a-z0-9_]+$/i', $action['filter'])) {
+        list($fa, $fv)= split('=', $action['filter']);
+        if (!isset($this->entries[$row][$fa]) && !$this->entries[$row][$fa][0] == $fv) {
+          $result.= "<img src='images/empty.png' alt=' ' class='center' style='padding:1px'>";
+          continue;
+        }
+      }
+
+
       // If there's an objectclass definition and we don't have it
       // add an empty picture here.
       if (isset($action['objectclass'])){