function renderPatchCableHeapEditor() { function printNewitemTR() { printOpFormIntro('add'); echo '<tr>'; echo '<td class=tdleft>' . getImageHREF('create', 'create new', TRUE) . '</td>'; echo "<td> </td>"; echo '<td>' . getSelect(getPatchCableConnectorOptions(), array('name' => 'end1_conn_id')) . '</td>'; echo '<td>' . getSelect(getPatchCableTypeOptions(), array('name' => 'pctype_id')) . '</td>'; echo '<td>' . getSelect(getPatchCableConnectorOptions(), array('name' => 'end2_conn_id')) . '</td>'; echo '<td><input type=text size=6 name=length value="1.00"></td>'; echo '<td><input type=text size=48 name=description></td>'; echo '<td class=tdleft>' . getImageHREF('create', 'create new', TRUE) . '</td>'; echo '</tr></form>'; } echo '<table class=widetable border=0 cellpadding=5 cellspacing=0 align=center>'; echo '<tr><th> </th><th>Amount</th><th>End 1</th><th>Cable type</th><th>End 2</th><th>Length</th><th>Description</th><th> </th></tr>'; if (getConfigVar('ADDNEW_AT_TOP') == 'yes') { printNewitemTR(); } foreach (getPatchCableHeapSummary() as $heap) { printOpFormIntro('upd', array('id' => $heap['id'])); echo '<tr>'; echo '<td>' . getOpLink(array('op' => 'del', 'id' => $heap['id']), '', 'destroy', 'remove') . '</td>'; echo "<td class=tdright>{$heap['amount']}</td>"; echo '<td>' . getSelect(getPatchCableConnectorOptions(), array('name' => 'end1_conn_id'), $heap['end1_conn_id']) . '</td>'; echo '<td>' . getSelect(getPatchCableTypeOptions(), array('name' => 'pctype_id'), $heap['pctype_id']) . '</td>'; echo '<td>' . getSelect(getPatchCableConnectorOptions(), array('name' => 'end2_conn_id'), $heap['end2_conn_id']) . '</td>'; echo "<td><input type=text size=6 name=length value='{$heap['length']}'></td>"; echo '<td><input type=text size=48 name=description value="' . stringForTextInputValue($heap['description'], 255) . '"></td>'; echo '<td>' . getImageHREF('save', 'Save changes', TRUE) . '</td>'; echo '</tr>'; echo '</form>'; } if (getConfigVar('ADDNEW_AT_TOP') != 'yes') { printNewitemTR(); } echo '</table>'; }
function renderSimpleTableWithOriginEditor($rows, $column) { function printNewitemTR($column) { printOpFormIntro('add'); echo '<tr>'; echo '<td> </td>'; echo '<td class=tdleft>' . getImageHREF('create', 'create new', TRUE) . '</td>'; echo "<td><input type=text size={$column['width']} name={$column['value']}></td>"; echo '<td class=tdleft>' . getImageHREF('create', 'create new', TRUE) . '</td>'; echo '</tr></form>'; } echo '<table class=widetable border=0 cellpadding=5 cellspacing=0 align=center>'; echo "<tr><th>Origin</th><th> </th><th>{$column['header']}</th><th> </th></tr>"; if (getConfigVar('ADDNEW_AT_TOP') == 'yes') { printNewitemTR($column); } foreach ($rows as $row) { echo '<tr>'; if ($row['origin'] == 'default') { echo '<td>' . getImageHREF('computer', 'default') . '</td>'; echo '<td> </td>'; echo '<td>' . stringForTD($row[$column['value']], $column['width']) . '</td>'; echo '<td> </td>'; } else { printOpFormIntro('upd', array($column['key'] => $row[$column['key']])); echo '<td>' . getImageHREF('favorite', 'custom') . '</td>'; echo '<td>'; if (array_key_exists('refc', $row) && $row['refc'] > 0) { echo getImageHREF('nodestroy', "referenced {$row['refc']} times"); } else { echo getOpLink(array('op' => 'del', $column['key'] => $row[$column['key']]), '', 'destroy', 'remove'); } echo '</td>'; echo "<td><input type=text size={$column['width']} name={$column['value']} value='" . stringForTextInputValue($row[$column['value']], $column['width']) . "'></td>"; echo '<td>' . getImageHREF('save', 'Save changes', TRUE) . '</td>'; echo '</form>'; } echo '</tr>'; } if (getConfigVar('ADDNEW_AT_TOP') != 'yes') { printNewitemTR($column); } echo '</table>'; }
function renderPortOIFEditor() { function printNewitemTR() { printOpFormIntro('add'); echo '<tr>'; echo '<td> </td>'; echo '<td> </td>'; echo '<td> </td>'; echo '<td class=tdleft>' . getImageHREF('create', 'create new', TRUE) . '</td>'; echo '<td class=tdleft><input type=text size=48 name=oif_name></td>'; echo '<td class=tdleft>' . getImageHREF('create', 'create new', TRUE) . '</td>'; echo '</tr></form>'; } echo '<table class=widetable border=0 cellpadding=5 cellspacing=0 align=center>'; echo '<tr><th class=tdleft>Origin</th><th>Key</th><th>Refcnt</th><th> </th><th>Outer Interface</th><th> </th></tr>'; if (getConfigVar('ADDNEW_AT_TOP') == 'yes') { printNewitemTR(); } $refcnt = getPortOIFRefc(); foreach (getPortOIFOptions() as $oif_id => $oif_name) { echo '<tr>'; if ($oif_id < 2000) { echo '<td class=tdleft>' . getImageHREF('computer') . '</td>'; echo "<td class=tdleft>{$oif_id}</td>"; echo '<td class=tdright>' . ($refcnt[$oif_id] ? $refcnt[$oif_id] : ' ') . '</td>'; echo '<td> </td>'; echo '<td class=tdleft>' . stringForTD($oif_name, 48) . '</td>'; echo '<td> </td>'; } else { printOpFormIntro('upd', array('id' => $oif_id)); echo '<td class=tdleft>' . getImageHREF('favorite') . '</td>'; echo "<td class=tdleft>{$oif_id}</td>"; if ($refcnt[$oif_id]) { echo "<td class=tdright>{$refcnt[$oif_id]}</td>"; echo '<td class=tdleft>' . getImageHREF('nodestroy', 'cannot remove') . '</td>'; } else { echo '<td> </td>'; echo '<td class=tdleft>'; echo getOpLink(array('op' => 'del', 'id' => $oif_id), '', 'destroy', 'remove'); echo '</td>'; } echo '<td class=tdleft><input type=text size=48 name=oif_name value="' . stringForTextInputValue($oif_name, 48) . '"></td>'; echo '<td>' . getImageHREF('save', 'Save changes', TRUE) . '</td>'; echo '</form>'; } echo '</tr>'; } if (getConfigVar('ADDNEW_AT_TOP') != 'yes') { printNewitemTR(); } echo '</table>'; }