r2923 - initial bracket icon
[racktables] / inc / interface.php
index 5968ad458ed6ac43d76388874b46fdbc08672763..7841681b7e4ee2d81d4a3e5e5efe12bc5d2029d3 100644 (file)
@@ -165,6 +165,12 @@ $image['VS']['height'] = 62;
 $image['router']['path'] = 'pix/router.png';
 $image['router']['width'] = 32;
 $image['router']['height'] = 32;
 $image['router']['path'] = 'pix/router.png';
 $image['router']['width'] = 32;
 $image['router']['height'] = 32;
+$image['object']['path'] = 'pix/bracket-16x16.png';
+$image['object']['width'] = 16;
+$image['object']['height'] = 16;
+$image['OBJECT']['path'] = 'pix/bracket-32x32.png';
+$image['OBJECT']['width'] = 32;
+$image['OBJECT']['height'] = 32;
 $image['ATTACH']['path'] = 'pix/crystal-attach-32x32.png';
 $image['ATTACH']['width'] = 32;
 $image['ATTACH']['height'] = 32;
 $image['ATTACH']['path'] = 'pix/crystal-attach-32x32.png';
 $image['ATTACH']['width'] = 32;
 $image['ATTACH']['height'] = 32;
@@ -2879,13 +2885,9 @@ function renderSearchResults ()
                                        echo '<tr><th>Common name</th><th>Visible label</th><th>Asset tag</th><th>Barcode</th></tr>';
                                        foreach ($what as $obj)
                                        {
                                        echo '<tr><th>Common name</th><th>Visible label</th><th>Asset tag</th><th>Barcode</th></tr>';
                                        foreach ($what as $obj)
                                        {
-                                               $tags = loadEntityTags ('object', $obj['id']);
-                                               echo "<tr class=row_${order} valign=top><td class=tdleft><a href=\"${root}?page=object&object_id=${obj['id']}\">${obj['dname']}</a>";
-                                               if (count ($tags))
-                                                       echo '<br><small>' . serializeTags ($tags) . '</small>';
-                                               echo "</td><td>${obj['label']}</td>";
-                                               echo "<td>${obj['asset_no']}</td>";
-                                               echo "<td>${obj['barcode']}</td></tr>";
+                                               echo "<tr class=row_${order} valign=top><td>";
+                                               renderCell (spotEntity ('object', $obj['id']));
+                                               echo "</td></tr>\n";
                                                $order = $nextorder[$order];
                                        }
                                        echo '</table>';
                                                $order = $nextorder[$order];
                                        }
                                        echo '</table>';
@@ -5124,6 +5126,7 @@ function renderFile ($file_id)
                                case 'rack':
                                case 'ipv4vs':
                                case 'ipv4rspool':
                                case 'rack':
                                case 'ipv4vs':
                                case 'ipv4rspool':
+                               case 'object':
                                        renderCell (spotEntity ($link['entity_type'], $link['entity_id']));
                                        break;
                                default:
                                        renderCell (spotEntity ($link['entity_type'], $link['entity_id']));
                                        break;
                                default:
@@ -5508,6 +5511,16 @@ function renderCell ($cell)
                echo count ($cell['etags']) ? ("<small>" . serializeTags ($cell['etags']) . "</small>") : '&nbsp;';
                echo "</td></tr></table>";
                break;
                echo count ($cell['etags']) ? ("<small>" . serializeTags ($cell['etags']) . "</small>") : '&nbsp;';
                echo "</td></tr></table>";
                break;
+       case 'object':
+               echo "<table class='slbcell vscell'><tr><td rowspan=2 width='5%'>";
+               printImageHREF ('OBJECT');
+               echo '</td>';
+               echo "<td><a href='${root}?page=object&object_id=${cell['id']}'>";
+               echo "<strong>" . niftyString ($cell['dname']) . "</strong></a></td></tr>";
+               echo '<td>';
+               echo count ($cell['etags']) ? ("<small>" . serializeTags ($cell['etags']) . "</small>") : '&nbsp;';
+               echo "</td></tr></table>";
+               break;
        default:
                showError ('odd data', __FUNCTION__);
                break;
        default:
                showError ('odd data', __FUNCTION__);
                break;