Changeset 91167f7


Ignore:
Timestamp:
03/24/15 11:30:38 (5 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, enter/10, releng/10.1.2, releng/10.2
Children:
c9d9a7e
Parents:
b8e7174
Message:

Display message if no search results found, and add spacers to fill
out search result tables for neatness

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-webui/appweb/share/html/pages/appcafe-search.php

    rf1a655f r91167f7  
    6161 exec("$sc ". escapeshellarg("$cmd"), $pbiarray); 
    6262 $pbilist = explode(", ", $pbiarray[0]); 
     63 $found=0; 
    6364 
    6465 // Now loop through pbi origins 
    6566 $col=1; 
    6667 foreach ($pbilist as $pbiorigin) { 
     68   if ( empty($pbiorigin) ) 
     69      continue; 
     70 
     71   if ( $found > 60 ) 
     72      break; 
     73 
     74   $found++; 
    6775   if ( parse_details($pbiorigin, $jail, $col, true, false) == 0 ) { 
    6876     if ( $col == $totalCols ) 
     
    7482 } 
    7583 
     84 if ( $found == 0 ) 
     85 { 
     86    if ( $searchraw == "checked" ) 
     87      echo "<tr><td colspan=3>No PBIs / Packages found!</td></tr>"; 
     88    else 
     89      echo "<tr><td colspan=3>No PBIs found! Try searching for all available PBI / Packages.</td></tr>"; 
     90 } else { 
     91   if ($found == 1) 
     92      echo "<td width='33%'>&nbsp;</td><td width='33%'>&nbsp;</td>"; 
     93   elseif ($found == 2) 
     94      echo "<td width='%33%'>&nbsp;</td>"; 
     95   elseif($found > 3) { 
     96      $left = $found % 3; 
     97      if ($left == 1) 
     98        echo "<td width='33%'>&nbsp;</td><td width='33%'>&nbsp;</td>"; 
     99       if ($left == 2) 
     100        echo "<td width='%33%'>&nbsp;</td>"; 
     101   } 
     102 
     103   echo "</tr>"; 
     104 } 
     105 
    76106?> 
Note: See TracChangeset for help on using the changeset viewer.