Beispiel #1
0
function renderPopupIPv4Selector()
{
    assertPermission('ipv4space', 'default');
    echo '<h2>Choose a port:</h2><br><br>';
    echo '<form action="javascript:;">';
    echo '<input type=hidden id=ip>';
    echo '<select size=' . getConfigVar('MAXSELSIZE') . ' id=addresses>';
    $addresses = getAllIPv4Allocations();
    usort($addresses, 'sortObjectAddressesAndNames');
    foreach ($addresses as $address) {
        echo "<option value='{$address['ip']}' onclick='getElementById(\"ip\").value=\"{$address['ip']}\";'>" . "{$address['object_name']} {$address['name']} {$address['ip']}</option>\n";
    }
    echo '</select><br><br>';
    echo "<input type=submit value='Proceed' onclick='" . "if (getElementById(\"ip\")!=\"\") {" . " opener.document.getElementById(\"remoteip\").value=getElementById(\"ip\").value;" . " window.close();}'>";
    echo '</form>';
}
Beispiel #2
0
function renderPopupIPv4Selector()
{
    echo '<div style="background-color: #f0f0f0; border: 1px solid #3c78b5; padding: 10px; height: 100%; text-align: center; margin: 5px;">';
    echo '<h2>Choose a port:</h2><br><br>';
    echo '<form action="javascript:;">';
    echo '<input type=hidden id=ip>';
    echo '<select size=' . getConfigVar('MAXSELSIZE') . ' id=addresses>';
    $addresses = getAllIPv4Allocations();
    usort($addresses, 'sortObjectAddressesAndNames');
    foreach ($addresses as $address) {
        echo "<option value='{$address['ip']}' onclick='getElementById(\"ip\").value=\"{$address['ip']}\";'>" . "{$address['object_name']} {$address['name']} {$address['ip']}</option>\n";
    }
    echo '</select><br><br>';
    echo "<input type=submit value='Proceed' onclick='" . "if (getElementById(\"ip\")!=\"\") {" . " opener.document.getElementById(\"remoteip\").value=getElementById(\"ip\").value;" . " window.close();}'>";
    echo '</form></div>';
}