Code

Updated class filter and listing.
[gosa.git] / gosa-core / include / class_listing.inc
index 53d50519d5507bfc91c0059c862e5243582844f3..d4f972d3da2c5357fdb2f11ed6fe0c502125e3f3 100644 (file)
@@ -123,6 +123,7 @@ class listing {
 
   function setFilter($filter)
   {
+    $filter->setCategories($this->categories);
     $this->filter= &$filter;
     if ($this->departmentBrowser){
       $this->departments= $this->getDepartments();
@@ -245,14 +246,14 @@ class listing {
         $link= "href='?plug=".$_GET['plug']."&PID=".$this->pid."&act=SORT_$index'";
         if (isset($config['label'])) {
           if ($sortable) {
-            $this->header[$index]= "<td class='listheader' ".$this->colprops[$index]."><a $link>"._($config['label'])."$sorter</a></td>";
+            $this->header[$index]= "<td class='listheader' ".$this->colprops[$index]."><a $link>"._($config['label'])."</a>$sorter</td>";
           } else {
             $this->header[$index]= "<td class='listheader' ".$this->colprops[$index].">"._($config['label'])."</td>";
           }
           $this->plainHeader[]= _($config['label']);
         } else {
           if ($sortable) {
-            $this->header[$index]= "<td class='listheader' ".$this->colprops[$index]."><a $link>&nbsp;$sorter</a></td>";
+            $this->header[$index]= "<td class='listheader' ".$this->colprops[$index]."><a $link>&nbsp;</a>$sorter</td>";
           } else {
             $this->header[$index]= "<td class='listheader' ".$this->colprops[$index].">&nbsp;</td>";
           }
@@ -839,6 +840,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)) {
@@ -1454,7 +1460,7 @@ class listing {
       if($restore){
         $result.= "<li$separator><a href='#' onClick='document.getElementById(\"actionmenu\").value= \"restore\";document.getElementById(\"exec_act\").click();'>".image('images/lists/restore.png')."&nbsp;"._("Restore snapshots")."</a></li>";
       }else{
-        $result.= "<li$separator><a href='#'>".image('images/lists/restore_grey.png')."&nbsp;"._("Restore snapshots")."</a></li>";
+        $result.= "<li$separator><a href='#'>".image('images/lists/restore-grey.png')."&nbsp;"._("Restore snapshots")."</a></li>";
       }
     }
 
@@ -1504,7 +1510,7 @@ class listing {
         if($this->snapshotHandler->hasSnapshots($dn)){
           $result.= image('images/lists/restore.png', "listing_restore_$row", _("Restore snapshot"));
         } else {
-          $result.= image('images/lists/restore_grey.png');
+          $result.= image('images/lists/restore-grey.png');
         }
       }