X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Ffai%2Fclass_faiPackageEntry.inc;h=a8c78aeb39310843101f8bf0606c40f84ca6aab6;hb=90cb0cbd940168e234d506e42644e52fc7af5c4d;hp=741a076fb1c87f8c57fa723b6158c0587de48748;hpb=2e5c2c0d8a0200c27b6fe01d6197b1672eaeaed0;p=gosa.git diff --git a/plugins/admin/fai/class_faiPackageEntry.inc b/plugins/admin/fai/class_faiPackageEntry.inc index 741a076fb..a8c78aeb3 100644 --- a/plugins/admin/fai/class_faiPackageEntry.inc +++ b/plugins/admin/fai/class_faiPackageEntry.inc @@ -46,11 +46,12 @@ class faiPackageEntry extends plugin $divlist = new divlist("PackageEntry"); $divlist->SetSummary(_("This list displays all assigned package names for this repository settings.")); - $divlist->SetEntriesPerPage(20); - $divlist->SetHeader(array(array("string"=>" "), - array("string"=>"Name"), - array("string"=>"Version"), - array("string"=>"Description","attach"=>"style='border-right:0px;'"))); + $divlist->SetEntriesPerPage(0); + $divlist->SetHeight("650px;"); + $divlist->SetHeader(array(array("string" => " ", "attach" => "style='text-align:center;width:20px;'"), + array("string" => "Name", "attach" => "style='width:180px;'"), + array("string" => "Version", "attach" ), + array("string" => "Description", "attach" => "style='width:240px;border-right:0px;text-align:left;'"))); if(isset($_GET['search'])){ $this->searchStrPKG= $_GET['search']."*"; @@ -76,10 +77,16 @@ class faiPackageEntry extends plugin } } - ksort($this->categories); + $this->searchStrPKG = preg_replace("/^\+/","",$this->searchStrPKG); + if(empty($this->searchStrPKG)){ + $this->searchStrPKG = "*"; + } + + @ksort($this->categories); - $CHKS = ""; - $i = 0; +$CHKS = "
"; + $i = 0; + if(is_array($this->categories)) foreach($this->categories as $cat => $selected){ if($i == 3){ $CHKS .=""; @@ -92,7 +99,7 @@ class faiPackageEntry extends plugin $CHKS .=""; } } - $CHKS .= "
 ".$cat." 
"; + $CHKS .= ""; foreach($_POST as $name => $value){ @@ -113,6 +120,10 @@ class faiPackageEntry extends plugin $cnt = 0; foreach($pkgs as $pkg){ + if($cnt > 200) { + print_red(sprintf(_("Your specified search string '%s' returned too many results. Only the first 200 entries are shown, to keep the memory usage low."),$this->searchStrPKG)); + break; + } if((preg_match("/^".str_replace("*",".*",$this->searchStrPKG)."/i",$pkg[0]))|| (preg_match("/^".str_replace("*",".*",$this->searchStrPKG)."/i",$pkg[3]))){ if($this->categories[$pkg[2]]){ @@ -122,12 +133,12 @@ class faiPackageEntry extends plugin $check = ""; } $cnt ++ ; - $chkbox = " + $chkbox = " "; - $divlist->AddEntry(array(array("string"=>$chkbox), - array("string"=>$pkg[0]), - array("string"=>$pkg[1]), - array("string"=>$pkg[3],"attach"=>"style='border-right:0px'"))); + $divlist->AddEntry(array(array("string"=>$chkbox, "attach" => "style='text-align:center;width:20px;'"), + array("string"=>$pkg[0], "attach" => "style='width:180px;'"), + array("string"=>htmlentities($pkg[1])), + array("string"=>htmlentities($pkg[3]), "attach" => "style='width:221px;border-right:0px;text-align:left;'"))); } } } @@ -170,7 +181,9 @@ class faiPackageEntry extends plugin /* Check supplied data */ function check() { - $message= array(); + /* Call common method to give check the hook */ + $message= plugin::check(); + return ($message); }