Commit bd3f282a authored by Mike Hibler's avatar Mike Hibler

Mike's yearly dose of php/html hacking.

For the nodetype page, lookup the name of any attribute that ends in _osid
rather than just a select (and incomplete) hardwired list.

Make those os names (and image names too) links.
parent 9447b777
......@@ -114,18 +114,18 @@ if (mysql_num_rows($query_result)) {
$val = $row["attrvalue"];
$attrtype = $row["attrtype"];
if ($key == "default_osid" ||
$key == "jail_osid" ||
$key == "delay_osid") {
if (preg_match("/_osid$/", $key)) {
if ($osinfo = OSinfo::Lookup($val)) {
$val = $osinfo->osname();
$name = $osinfo->osname();
$val = "<a href=showosinfo.php3?osid=$val>$name</a>";
}
}
elseif ($key == "default_imageid") {
$inames = array();
foreach (explode(',', $val) as $imageid) {
if ($image = Image::Lookup($imageid)) {
$inames[] = $image->imagename();
$name = $image->imagename();
$inames[] = "<a href=showimageid.php3?imageid=$imageid>$name</a>";
}
}
$val = implode(',', $inames);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment