replace dropdown with radio, if short
This commit is contained in:
@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
|
|||||||
$Id$
|
$Id$
|
||||||
$Source$
|
$Source$
|
||||||
|
|
||||||
|
2001-05-08 Korakot Chaovavanich <korakot@iname.com>
|
||||||
|
* In edit page, replace dropdown with radio if short enough
|
||||||
|
|
||||||
2001-05-08 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
2001-05-08 Lo<4C>c Chapeaux <lolo@phpheaven.net>
|
||||||
* db_readdump.php3, line 14 and sql.php3, line 112: two warnings were
|
* db_readdump.php3, line 14 and sql.php3, line 112: two warnings were
|
||||||
displayed with the phpMyBookmark path if the error reporting level
|
displayed with the phpMyBookmark path if the error reporting level
|
||||||
|
@@ -92,16 +92,31 @@ for($i=0;$i<mysql_num_rows($table_def);$i++)
|
|||||||
$set = ereg_replace("\\)$", "", $set);
|
$set = ereg_replace("\\)$", "", $set);
|
||||||
$set = explode(",", $set);
|
$set = explode(",", $set);
|
||||||
|
|
||||||
echo "<td><select name=fields[$field]>\n";
|
// show dropdown or radio depend on length
|
||||||
echo "<option value=\"\">\n";
|
if (strlen($row_table_def["Type"]) > 20) {
|
||||||
for($j=0; $j<count($set);$j++)
|
echo "<td><select name=fields[$field]>\n";
|
||||||
{
|
echo "<option value=\"\">\n";
|
||||||
echo '<option value="'.substr($set[$j], 1, -1).'"';
|
for($j=0; $j<count($set);$j++)
|
||||||
if($data == substr($set[$j], 1, -1) || ($data == "" && substr($set[$j], 1, -1) == $row_table_def["Default"]))
|
{
|
||||||
echo " selected";
|
echo '<option value="'.substr($set[$j], 1, -1).'"';
|
||||||
echo ">".htmlspecialchars(substr($set[$j], 1, -1))."\n";
|
if($data == substr($set[$j], 1, -1) || ($data == "" && substr($set[$j], 1, -1) == $row_table_def["Default"]))
|
||||||
}
|
echo " selected";
|
||||||
echo "</select></td>";
|
echo ">".htmlspecialchars(substr($set[$j], 1, -1))."\n";
|
||||||
|
}
|
||||||
|
echo "</select></td>";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo "<td>\n";
|
||||||
|
for($j=0; $j<count($set);$j++)
|
||||||
|
{
|
||||||
|
echo "<input type=radio name=fields[$field] ";
|
||||||
|
echo 'value="'.substr($set[$j], 1, -1).'"';
|
||||||
|
if($data == substr($set[$j], 1, -1) || ($data == "" && substr($set[$j], 1, -1) == $row_table_def["Default"]))
|
||||||
|
echo " checked";
|
||||||
|
echo ">".htmlspecialchars(substr($set[$j], 1, -1))."\n";
|
||||||
|
}
|
||||||
|
echo "</td>";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
elseif(strstr($row_table_def["Type"], "set"))
|
elseif(strstr($row_table_def["Type"], "set"))
|
||||||
|
Reference in New Issue
Block a user