本文整理汇总了PHP中Device::dropdownTypes方法的典型用法代码示例。如果您正苦于以下问题:PHP Device::dropdownTypes方法的具体用法?PHP Device::dropdownTypes怎么用?PHP Device::dropdownTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Device
的用法示例。
在下文中一共展示了Device::dropdownTypes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showForm
function showForm($target, $ID = '')
{
global $DB, $CFG_GLPI, $LANG;
if ($ID != '') {
$this->getFromDB($ID);
} else {
$this->getEmpty();
}
$this->showTabs($ID, "", $_SESSION['glpi_tab']);
echo "<div align='center'><form method='post' name='' id='' action=\"" . $target . "\">";
echo "<table class='tab_cadre' cellpadding='5' width='950'>";
echo "<tr>";
echo "<th colspan='2'>";
echo $LANG['plugin_fusioninventory']["constructdevice"][0];
echo " :</th>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['common'][5] . ": \t</td><td>";
Dropdown::show("Manufacturer", array('name' => "FK_glpi_enterprise", 'value' => $this->fields["FK_glpi_enterprise"]));
echo "</td>";
echo "<tr>";
echo "<td>" . $LANG['setup'][71] . ": \t</td><td>\n";
Dropdown::show("NetworkEquipmentFirmware", array('name' => "firmware", 'value' => $this->fields["firmware"]));
echo "</td>";
echo "</tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['common'][25] . "</td>";
echo "<td>";
echo "<textarea name='sysdescr' cols='110' rows='4' />" . $this->fields["sysdescr"] . "</textarea>";
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['common'][17] . " :</td>";
echo "<td>";
$type_list = array();
$type_list[] = COMPUTER_TYPE;
$type_list[] = NETWORKING_TYPE;
$type_list[] = PRINTER_TYPE;
$type_list[] = PERIPHERAL_TYPE;
$type_list[] = PHONE_TYPE;
// GENERIC OBJECT : Search types in generic object
$plugin = new Plugin();
if ($plugin->isActivated('genericobject')) {
if (TableExists("glpi_plugin_genericobject_types")) {
$query = "SELECT * FROM `glpi_plugin_genericobject_types`\n WHERE `status`='1' ";
if ($result = $DB->query($query)) {
while ($data = $DB->fetch_array($result)) {
$type_list[] = $data['device_type'];
}
}
}
}
// END GENERIC OBJECT
Device::dropdownTypes('type', $this->fields["type"], $type_list);
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'><td align='center' colspan='3'>";
if ($ID == '') {
echo "<div align='center'><input type='submit' name='add' value=\"" . $LANG["buttons"][8] . "\" class='submit' >";
} else {
echo "<input type='hidden' name='ID' value='" . $ID . "'/>";
echo "<div align='center'><input type='submit' name='update' value=\"" . $LANG["buttons"][7] . "\" class='submit' >";
echo " <input type='submit' name='delete' value=\"" . $LANG["buttons"][6] . "\" class='submit'>";
}
echo "</td></tr>";
echo "</table></form></div>";
}
示例2: showForm
function showForm($target, $ID = '')
{
global $DB, $CFG_GLPI, $LANG;
PluginFusioninventoryAuth::checkRight("snmp_networking", "r");
$CommonItem = new CommonItem();
if ($ID != '') {
$this->getFromDB($ID);
} else {
$this->getEmpty();
}
echo "<div align='center'><form method='post' name='' id='' action=\"" . $target . "\">";
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th colspan='4'>";
echo $LANG['plugin_fusioninventory']["menu"][4] . " ( " . $LANG['plugin_fusioninventory']["unknown"][3] . " ";
$CommonItem->getFromDB(PLUGIN_FUSIONINVENTORY_SNMP_AGENTS, $this->fields["FK_agent"]);
echo $CommonItem->getLink(1);
echo ") :</th></tr>";
$datestring = $LANG["common"][26] . ": ";
$date = convDateTime($this->fields["date_mod"]);
echo "<tr>";
echo "<th align='center' width='450' colspan='2'>";
echo $LANG["common"][2] . " " . $this->fields["ID"];
echo "</th>";
echo "<th align='center' colspan='2' width='50'>";
echo $datestring . $date;
echo "</th>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td align='center'>" . $LANG["common"][16] . " :</td>";
echo "<td align='center'>";
echo "<input type='text' name='name' value='" . $this->fields["name"] . "' size='35'/>";
echo "</td>";
if (isMultiEntitiesMode()) {
echo "<td align='center'>" . $LANG['entity'][0] . " : </td>";
echo "</td>";
echo "<td align='center'>";
Dropdown::show("Entity", array('name' => 'FK_entities', 'value' => $this->fields["FK_entities"]));
echo "</td>";
echo "</tr>";
echo "</tr>";
} else {
echo "<td align='center'></td>";
echo "</td>";
echo "<td align='center'></td>";
echo "</tr>";
echo "</tr>";
}
echo "<tr class='tab_bg_1'>";
echo "<td align='center'>" . $LANG['plugin_fusioninventory']["unknown"][0] . " :</td>";
echo "<td align='center'>";
echo "<input type='text' name='dnsname' value='" . $this->fields["dnsname"] . "' size='35'/>";
echo "</td>";
echo "<td align='center'>" . $LANG['common'][18] . " : </td>";
echo "</td>";
echo "<td align='center'>";
echo "<input type='text' name='contact' value='" . $this->fields["contact"] . "' size='35'/>";
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td align='center'>" . $LANG['common'][17] . " :</td>";
echo "<td align='center'>";
$type_list[] = COMPUTER_TYPE;
$type_list[] = NETWORKING_TYPE;
$type_list[] = PRINTER_TYPE;
$type_list[] = PERIPHERAL_TYPE;
$type_list[] = PHONE_TYPE;
// GENERIC OBJECT : Search types in generic object
$plugin = new Plugin();
if ($plugin->isActivated('genericobject')) {
if (TableExists("glpi_plugin_genericobject_types")) {
$query = "SELECT * FROM `glpi_plugin_genericobject_types`\n WHERE `status`='1' ";
if ($result = $DB->query($query)) {
while ($data = $DB->fetch_array($result)) {
$type_list[] = $data['device_type'];
}
}
}
}
// END GENERIC OBJECT
Device::dropdownTypes('type', $this->fields["type"], $type_list);
echo "</td>";
echo "<td align='center'>" . $LANG['setup'][89] . " : </td>";
echo "</td>";
echo "<td align='center'>";
Dropdown::show("Domain", array('name' => "domain", 'value' => $this->fields["domain"]));
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td align='center'>" . $LANG['common'][15] . " :</td>";
echo "<td align='center'>";
Dropdown::show("Location", array('name' => "location", 'value' => $this->fields["location"]));
echo "</td>";
echo "<td align='center'>" . $LANG['common'][19] . " : </td>";
echo "</td>";
echo "<td align='center'>";
echo "<input type='text' name='serial' value='" . $this->fields["serial"] . "' size='35'/>";
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td align='center'>" . $LANG['plugin_fusioninventory']["unknown"][2] . " :</td>";
//.........这里部分代码省略.........
示例3: plugin_fusioninventory_MassiveActionsFieldsDisplay
function plugin_fusioninventory_MassiveActionsFieldsDisplay($type, $table, $field, $linkfield)
{
global $LINK_ID_TABLE, $LANG;
// Table fields
//echo $table.".".$field."<br/>";
switch ($table . "." . $field) {
case 'glpi_plugin_fusioninventory_snmpauths.name':
Dropdown::show("PluginFusioninventorySnmpauth", array('name' => $linkfield));
return true;
break;
case 'glpi_plugin_fusioninventory_model_infos.name':
Dropdown::show("PluginFusioninventoryModelInfos", array('name' => $linkfield, 'comments' => false));
return true;
break;
case 'glpi_plugin_fusioninventory_unknown_device.type':
$type_list = array();
$type_list[] = COMPUTER_TYPE;
$type_list[] = NETWORKING_TYPE;
$type_list[] = PRINTER_TYPE;
$type_list[] = PERIPHERAL_TYPE;
$type_list[] = PHONE_TYPE;
Device::dropdownTypes('type', $linkfield, $type_list);
return true;
break;
case 'glpi_plugin_fusioninventory_agents.ID':
Dropdown::show("PluginFusioninventoryAgents", array('name' => $linkfield, 'comments' => false));
return true;
break;
case 'glpi_plugin_fusioninventory_agents.nb_process_query':
Dropdown::showInteger("nb_process_query", $linkfield, 1, 200);
return true;
break;
case 'glpi_plugin_fusioninventory_agents.nb_process_discovery':
Dropdown::showInteger("nb_process_discovery", $linkfield, 1, 400);
return true;
break;
case 'glpi_plugin_fusioninventory_agents.logs':
$ArrayValues[] = $LANG["choice"][0];
$ArrayValues[] = $LANG["choice"][1];
$ArrayValues[] = $LANG["setup"][137];
Dropdown::showFromArray('logs', $ArrayValues, array('value' => $linkfield));
return true;
break;
case 'glpi_plugin_fusioninventory_agents.core_discovery':
Dropdown::showInteger("core_discovery", $linkfield, 1, 32);
return true;
break;
case 'glpi_plugin_fusioninventory_agents.core_query':
Dropdown::showInteger("core_query", $linkfield, 1, 32);
return true;
break;
case 'glpi_plugin_fusioninventory_agents.threads_discovery':
Dropdown::showInteger("threads_discovery", $linkfield, 1, 400);
return true;
break;
case 'glpi_plugin_fusioninventory_agents.threads_query':
Dropdown::showInteger("threads_query", $linkfield, 1, 400);
return true;
break;
case 'glpi_plugin_fusioninventory_discovery.FK_snmp_connection':
$plugin_fusioninventory_snmp = new PluginFusioninventorySnmpauth();
echo $plugin_fusioninventory_snmp->selectbox();
return true;
break;
case 'glpi_plugin_fusioninventory_model_infos.device_type':
$type_list = array();
$type_list[] = COMPUTER_TYPE;
$type_list[] = NETWORKING_TYPE;
$type_list[] = PRINTER_TYPE;
$type_list[] = PERIPHERAL_TYPE;
$type_list[] = PHONE_TYPE;
Device::dropdownTypes('type', $linkfield, $type_list);
return true;
break;
}
return false;
}