Toggle navigation
Hot Examples
FR
EN
RU
DE
FR
ES
PT
IT
JP
ZH
KO
PHP
PHP
C#
Java
Go
C++
Python
JS
TS
Rechercher
Accueil
Netpoint
dropdownNetpoint
Netpoint::dropdownNetpoint PHP Méthode
Netpoint Class Documentation
Usage Examples Of Netpoint::dropdownNetpoint
Afficher le fichier
Open project: glpi-project/glpi
dropdownNetpoint()
static
public
méthode
Print out an HTML "
" for a dropdown with preselected value static public dropdownNetpoint ( $myname, $value, $locations_id, $display_comment = 1, $entity_restrict, $devtype = '' ) : nothing $myname the name of the HTML select $value the preselected value we want (default 0) $locations_id default location ID for search (default -1) $display_comment display the comment near the dropdown (default 1) $entity_restrict Restrict to a defined entity(default -1) $devtype (default '') Résultat nothing (display the select box) static function dropdownNetpoint($myname, $value = 0, $locations_id = -1, $display_comment = 1, $entity_restrict = -1, $devtype = '') { global $CFG_GLPI; $rand = mt_rand(); $name = Dropdown::EMPTY_VALUE; $comment = ""; if (empty($value)) { $value = 0; } if ($value > 0) { $tmpname = Dropdown::getDropdownName("glpi_netpoints", $value, 1); if ($tmpname["name"] != " ") { $name = $tmpname["name"]; $comment = $tmpname["comment"]; } } $field_id = Html::cleanId("dropdown_" . $myname . $rand); $param = array('value' => $value, 'valuename' => $name, 'entity_restrict' => $entity_restrict, 'devtype' => $devtype, 'locations_id' => $locations_id); echo Html::jsAjaxDropdown($myname, $field_id, $CFG_GLPI['root_doc'] . "/ajax/getDropdownNetpoint.php", $param); // Display comment if ($display_comment) { $comment_id = Html::cleanId("comment_" . $myname . $rand); Html::showToolTip($comment, array('contentid' => $comment_id)); $item = new self(); if ($item->canCreate()) { echo "<img alt='' title=\"" . __s('Add') . "\" src='" . $CFG_GLPI["root_doc"] . "/pics/add_dropdown.png' style='cursor:pointer; margin-left:2px;' " . "onClick=\"" . Html::jsGetElementbyID('netpoint' . $rand) . ".dialog('open');\">"; Ajax::createIframeModalWindow('netpoint' . $rand, $item->getFormURL()); } $paramscomment = array('value' => '__VALUE__', 'table' => "glpi_netpoints"); echo Ajax::updateItemOnSelectEvent($field_id, $comment_id, $CFG_GLPI["root_doc"] . "/ajax/comments.php", $paramscomment, false); } return $rand; } Usage Example Exemple #1 0 Afficher le fichier Fichier : networkportinstantiation.class.php Projet : stweil/glpi /** * Display the Netpoint field. Used by Ethernet, and Migration * * @param $netport NetworkPort object :the port that owns this instantiation * (usefull, for instance to get network port attributs * @param $options array of options given to NetworkPort::showForm * @param $recursiveItems list of the items on which this port is attached **/ function showNetpointField(NetworkPort $netport, $options = array(), $recursiveItems) { echo "<td>" . __('Network outlet') . "</td>\n"; echo "<td>"; if (count($recursiveItems) > 0) { $lastItem = $recursiveItems[count($recursiveItems) - 1]; Netpoint::dropdownNetpoint("netpoints_id", $this->fields["netpoints_id"], $lastItem->fields['locations_id'], 1, $lastItem->getEntityID(), $netport->fields["itemtype"]); } else { _e('item not linked to an object'); } echo "</td>"; } All Usage Examples Of Netpoint::dropdownNetpoint Netpoint displayTabContentForItem dropdownNetpoint executeAddMulti findID getAdditionalFields getHTMLTableCellsForItem getHTMLTableHeader getSearchOptions getTabNameForItem getTypeName post_addItem post_deleteFromDB showForLocation Fonctions les mieux classées | Classes les mieux classées | Documentation | Politique de confidentialité | Advertise with us PHP | C# (CSharp) | Java | Golang | C++ (Cpp) | Python | JavaScript | TypeScript EN | RU | DE | FR | ES | PT | IT | JP | ZH | KO