make_maintainer_rating_list() should return a string containing the html for the list. Update

users of make_maintainer_rating_list() to echo its return value.
This commit is contained in:
Alexander Nicolaysen Sørnes
2007-09-08 01:48:53 +00:00
committed by WineHQ
parent f07272f089
commit ee70aeaaa2
2 changed files with 9 additions and 7 deletions

View File

@@ -677,7 +677,7 @@ class testData{
echo '</td></tr>',"\n"; echo '</td></tr>',"\n";
// Rating // Rating
echo '<tr><td class="color0"><b>Rating</b></td><td class="color0">',"\n"; echo '<tr><td class="color0"><b>Rating</b></td><td class="color0">',"\n";
make_maintainer_rating_list("sTestedRating", $this->sTestedRating); echo make_maintainer_rating_list("sTestedRating", $this->sTestedRating);
echo '<a href="'.BASE.'/help/?sTopic=maintainer_ratings" target="_blank">Rating definitions</a></td></tr>',"\n"; echo '<a href="'.BASE.'/help/?sTopic=maintainer_ratings" target="_blank">Rating definitions</a></td></tr>',"\n";
// extra comments // extra comments
echo '<tr valign=top><td class="color1"><b>Extra comments</b></td>',"\n"; echo '<tr valign=top><td class="color1"><b>Extra comments</b></td>',"\n";

View File

@@ -200,22 +200,24 @@ function make_bugzilla_version_list($sVarname, $sSelectedValue)
return $sStr; return $sStr;
} }
// returns a string containing the html for the maintainer rating list
function make_maintainer_rating_list($varname, $cvalue) function make_maintainer_rating_list($varname, $cvalue)
{ {
$sTxt = "<select name='$varname'>\n";
echo "<select name='$varname'>\n"; $sTxt .= "<option value=\"\">Choose ...</option>\n";
echo "<option value=\"\">Choose ...</option>\n";
$aRating = array("Platinum", "Gold", "Silver", "Bronze", "Garbage"); $aRating = array("Platinum", "Gold", "Silver", "Bronze", "Garbage");
$iMax = count($aRating); $iMax = count($aRating);
for($i=0; $i < $iMax; $i++) for($i=0; $i < $iMax; $i++)
{ {
if($aRating[$i] == $cvalue) if($aRating[$i] == $cvalue)
echo "<option class=$aRating[$i] value=$aRating[$i] selected>$aRating[$i]\n"; $sTxt .= "<option class=$aRating[$i] value=$aRating[$i] selected>$aRating[$i]\n";
else else
echo "<option class=$aRating[$i] value=$aRating[$i]>$aRating[$i]\n"; $sTxt .= "<option class=$aRating[$i] value=$aRating[$i]>$aRating[$i]\n";
} }
echo "</select>\n"; $sTxt .= "</select>\n";
return $sTxt;
} }
/* Get the number of users in the database */ /* Get the number of users in the database */