diff --git a/plugins/admin/fai/class_faiPackageEntry.inc b/plugins/admin/fai/class_faiPackageEntry.inc
index 1a5c784e0995ab910941e8e986902b07366192d2..ce2b6e98a361189bb65abbb1fd434a0ac6a66684 100644 (file)
var $buffer = array();
var $categories = array();
- var $searchStrPKG = "Please enter your search string here";
+ var $searchStrPKG = "";
var $selected = array();
/* Array with available class names */
$this->searchStrPKG=$_SESSION['searchStrPKG'];
}
$this->selected=$selected;
+
+ $this->searchStrPKG= _("Please enter your search string here");
}
function execute()
{
+ /* Call parent execute */
+ plugin::execute();
+
/* Fill templating stuff */
$smarty = get_smarty();
$display = "";
$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']."*";
}
}
- ksort($this->categories);
+ $this->searchStrPKG = preg_replace("/^\+/","",$this->searchStrPKG);
+ if(empty($this->searchStrPKG)){
+ $this->searchStrPKG = "*";
+ }
+
+ @ksort($this->categories);
- $CHKS = "<table><tr><input type='hidden' value='chkchange' name='chkchange'>";
- $i = 0;
+$CHKS = "<input type='hidden' value='chkchange' name='chkchange'><table summary=''><tr>";
+ $i = 0;
+ if(is_array($this->categories))
foreach($this->categories as $cat => $selected){
if($i == 3){
$CHKS .="</tr><tr>";
$CHKS .="<td><input type='checkbox' value='1' name='CAT".$cat."' onclick='document.mainform.submit()'> ".$cat." </td>";
}
}
- $CHKS .= "</td></tr></table>";
+ $CHKS .= "</tr></table>";
foreach($_POST as $name => $value){
}
}
+ /* Prepare search filter */
+ $search_str = preg_replace("/\\\\\*/",".*",normalizePreg($this->searchStrPKG));
+
+ $cnt = 0;
foreach($pkgs as $pkg){
- if((preg_match("/^".str_replace("*",".*",$this->searchStrPKG)."/i",$pkg[0]))||
- (preg_match("/^".str_replace("*",".*",$this->searchStrPKG)."/i",$pkg[3]))){
+ 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("/^".$search_str."/i",$pkg[0]))||
+ (preg_match("/^".$search_str."/i",$pkg[3]))){
if($this->categories[$pkg[2]]){
if(in_array($pkg[0],$this->selected)){
$check = " checked ";
}else{
$check = "";
}
- $chkbox = "<input type='checkbox' value='1' name='use_".base64_encode($pkg[0])."' ".$check." onclick='document.mainform.submit()'>
+ $cnt ++ ;
+ $chkbox = "<input type='checkbox' value='1' name='use_".base64_encode($pkg[0])."' ".$check.">
<input type='hidden' value='1' name='wasonpage_".base64_encode($pkg[0])."'>";
- $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;'")));
}
}
}
/* Check supplied data */
function check()
{
- $message= array();
+ /* Call common method to give check the hook */
+ $message= plugin::check();
+
return ($message);
}