Code

Fixed missing images problem in group headpage
[gosa.git] / plugins / admin / fai / class_faiPackageEntry.inc
index c5c53d20d1f44dcf68ab943bccf8e19d5ea32acc..1a5c784e0995ab910941e8e986902b07366192d2 100644 (file)
@@ -11,7 +11,7 @@ class faiPackageEntry extends plugin
   var $ignore_account= TRUE;
   var $attributes   = array();
   var $objectclasses= array();
-  var $strID        = "";  
+  var $pkgs        = array();  
 
   var $buffer       = array();
   var $categories   = array();
@@ -21,15 +21,15 @@ class faiPackageEntry extends plugin
   /* Array with available class names */
   var $FAIAllclasses        = array();
 
-  function faiPackageEntry ($config, $dn= NULL,$strID=false,$selected=array())
+  function faiPackageEntry ($config, $dn= NULL,$pkgs,$selected=array())
   {
     plugin::plugin ($config, $dn);
-    $this->strID = $strID;
+    
+    $this->pkgs=$pkgs;
 
     if(isset($_SESSION['searchStrPKG'])){
       $this->searchStrPKG=$_SESSION['searchStrPKG'];
     }
-
     $this->selected=$selected;
   }
 
@@ -50,8 +50,9 @@ class faiPackageEntry extends plugin
     if(isset($_GET['search'])){
       $this->searchStrPKG= $_GET['search']."*";
     }
+    
+    $pkgs= $this->pkgs;
 
-    $pkgs = $this->genPkgs();
     unset($this->categories);
     foreach($pkgs as $name => $entry){
       $cat = $entry[2];
@@ -106,7 +107,8 @@ class faiPackageEntry extends plugin
     }
 
     foreach($pkgs as $pkg){
-      if(preg_match("/^".str_replace("*",".*",$this->searchStrPKG)."/i",$pkg[0])){
+      if((preg_match("/^".str_replace("*",".*",$this->searchStrPKG)."/i",$pkg[0]))||
+         (preg_match("/^".str_replace("*",".*",$this->searchStrPKG)."/i",$pkg[3]))){
         if($this->categories[$pkg[2]]){
           if(in_array($pkg[0],$this->selected)){
             $check = " checked ";
@@ -169,41 +171,6 @@ class faiPackageEntry extends plugin
   {
     return($this->selected);
   }
-
-    /* Generate listbox friendly SubObject list
-  */
-  function genPkgs(){
-    /* Generate a list off available packages for this mirror, section and release
-     */
-    $strID = $this->strID;    // This var contains the path to the parsed package file
-    
-    /* Open the packelist */
-    $fp = fopen($strID,"r");  
-    $a_ret = array();
-    $this->buffer = array();
-    /* Only read this file if it wasn't read before */
-    if(!isset($this->buffer[$strID])){
-      $str = "";
-      /* Parse every line and create an array */
-      while(!feof($fp)){
-        $str= fgets($fp,512);
-        $stra= split("\|",$str);
-        if(count($stra)==4){
-          $a_ret[$stra[0]] = $stra;
-          }
-        }
-        /* Save our Data, to avoid reading it again */
-      $this->buffer[$strID]=$a_ret;
-
-      ksort($a_ret);
-
-      return($a_ret);
-    }else{
-      return $this->buffer[$strID];
-    }
-  }
-
-
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>