本文整理汇总了PHP中IPAddress::showChildsForItemForm方法的典型用法代码示例。如果您正苦于以下问题:PHP IPAddress::showChildsForItemForm方法的具体用法?PHP IPAddress::showChildsForItemForm怎么用?PHP IPAddress::showChildsForItemForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPAddress
的用法示例。
在下文中一共展示了IPAddress::showChildsForItemForm方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showFormForNetworkPort
/**
* @param $networkPortID
**/
static function showFormForNetworkPort($networkPortID)
{
global $DB, $CFG_GLPI;
$name = new self();
$number_names = 0;
if ($networkPortID > 0) {
$query = "SELECT `id`\n FROM `" . $name->getTable() . "`\n WHERE `itemtype` = 'NetworkPort'\n AND `items_id` = '{$networkPortID}'\n AND `is_deleted` = '0'";
$result = $DB->query($query);
if ($DB->numrows($result) > 1) {
echo "<tr class='tab_bg_1'><th colspan='4'>" . __("Several network names available! Go to the tab 'Network Name' to manage them.") . "</th></tr>\n";
return;
}
switch ($DB->numrows($result)) {
case 1:
$nameID = $DB->fetch_assoc($result);
$name->getFromDB($nameID['id']);
break;
case 0:
$name->getEmpty();
break;
}
} else {
$name->getEmpty();
}
echo "<tr class='tab_bg_1'><th colspan='4'>";
// If the networkname is defined, we must be able to edit it. So we make a link
if ($name->getID() > 0) {
echo "<a href='" . $name->getLinkURL() . "'>" . self::getTypeName(1) . "</a>";
echo "<input type='hidden' name='NetworkName_id' value='" . $name->getID() . "'> \n";
Html::showSimpleForm($name->getFormURL(), 'unaffect', _sx('button', 'Dissociate'), array('id' => $name->getID()), $CFG_GLPI["root_doc"] . '/pics/sub_dropdown.png');
} else {
echo self::getTypeName(1);
}
echo "</th>\n";
echo "</tr><tr class='tab_bg_1'>";
echo "<td>" . self::getTypeName(1) . "</td><td>\n";
Html::autocompletionTextField($name, "name", array('name' => 'NetworkName_name'));
echo "</td>\n";
echo "<td>" . FQDN::getTypeName(1) . "</td><td>";
Dropdown::show(getItemTypeForTable(getTableNameForForeignKeyField("fqdns_id")), array('value' => $name->fields["fqdns_id"], 'name' => 'NetworkName_fqdns_id', 'entity' => $name->getEntityID(), 'displaywith' => array('view')));
echo "</td>\n";
echo "</tr><tr class='tab_bg_1'>\n";
echo "<td>" . IPAddress::getTypeName(Session::getPluralNumber());
IPAddress::showAddChildButtonForItemForm($name, 'NetworkName__ipaddresses');
echo "</td>";
echo "<td>";
IPAddress::showChildsForItemForm($name, 'NetworkName__ipaddresses');
echo "</td>";
// MoYo : really need to display it here ?
// make confure because not updatable
// echo "<td>".IPNetwork::getTypeName(Session::getPluralNumber())." ";
// Html::showToolTip(__('IP network is not included in the database. However, you can see current available networks.'));
// echo "</td><td>";
// IPNetwork::showIPNetworkProperties($name->getEntityID());
// echo "</td>\n";
echo "<td colspan='2'> </td>";
echo "</tr>\n";
}