当前位置: 首页>>代码示例>>PHP>>正文


PHP NetworkPort::getFormURL方法代码示例

本文整理汇总了PHP中NetworkPort::getFormURL方法的典型用法代码示例。如果您正苦于以下问题:PHP NetworkPort::getFormURL方法的具体用法?PHP NetworkPort::getFormURL怎么用?PHP NetworkPort::getFormURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NetworkPort的用法示例。


在下文中一共展示了NetworkPort::getFormURL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getAdditionalMenuOptions

 /**
  * @see CommonGLPI::getAdditionalMenuOptions()
  *
  * @since version 0.85
  **/
 static function getAdditionalMenuOptions()
 {
     if (static::canView()) {
         $options['networkport']['title'] = NetworkPort::getTypeName(Session::getPluralNumber());
         $options['networkport']['page'] = NetworkPort::getFormURL(false);
         return $options;
     }
     return false;
 }
开发者ID:glpi-project,项目名称:glpi,代码行数:14,代码来源:networkequipment.class.php

示例2: showForm

 function showForm(CommonDBTM $item, $options = array())
 {
     global $DB, $CFG_GLPI;
     if (!Session::haveRight('plugin_fusioninventory_networkequipment', READ)) {
         NetworkPort::showForItem($item);
         return;
     }
     $canedit = FALSE;
     if (Session::haveRight('plugin_fusioninventory_networkequipment', UPDATE)) {
         $canedit = TRUE;
     }
     $id = $item->getID();
     if (!($data = $this->find("`networkequipments_id`='" . $id . "'", '', 1))) {
         // Add in database if not exist
         $input = array();
         $input['networkequipments_id'] = $id;
         $_SESSION['glpi_plugins_fusinvsnmp_table'] = 'glpi_networkequipments';
         $ID_tn = $this->add($input);
         $this->getFromDB($ID_tn);
     } else {
         foreach ($data as $datas) {
             $this->fields = $datas;
         }
     }
     if (isset($_POST['displaysnmpinfo'])) {
         $this->showNetworkEquipmentInformation($id, $options);
         return;
     }
     //$_SESSION['plugin_fusioninventory_networkportview'] = 'glpi';
     if (!isset($_SESSION['plugin_fusioninventory_networkportview'])) {
         $_SESSION['plugin_fusioninventory_networkportview'] = 'fusioninventory';
     }
     // Display glpi network port view if no fusionnetworkport
     $query = "SELECT glpi_plugin_fusioninventory_networkports.id\n      FROM glpi_plugin_fusioninventory_networkports\n      LEFT JOIN glpi_networkports\n      ON glpi_plugin_fusioninventory_networkports.networkports_id = glpi_networkports.id\n      WHERE glpi_networkports.items_id='" . $id . "'\n         AND glpi_networkports.itemtype='NetworkEquipment'";
     $result = $DB->query($query);
     if ($DB->numrows($result) == 0) {
         NetworkPort::showForItem($item);
         return;
     }
     echo "<form action='" . $CFG_GLPI['root_doc'] . "/plugins/fusioninventory/front/networkport.display.php' method='post'>";
     echo __('Display the view', 'fusioninventory');
     echo ' <i>' . $_SESSION['plugin_fusioninventory_networkportview'] . "</i>. ";
     echo __('If you prefer, you can display the view', 'fusioninventory');
     echo ' ';
     if ($_SESSION['plugin_fusioninventory_networkportview'] == 'fusioninventory') {
         echo '<input type="submit" class="submit" name="selectview" value="glpi" />';
     } else {
         echo '<input type="submit" class="submit" name="selectview" value="fusioninventory" />';
     }
     Html::closeForm();
     if ($_SESSION['plugin_fusioninventory_networkportview'] == 'glpi') {
         NetworkPort::showForItem($item);
         return;
     }
     $canedit = $item->can($item->getID(), UPDATE);
     if ($canedit) {
         $networkPort = new NetworkPort();
         echo "\n<form method='get' action='" . $networkPort->getFormURL() . "'>\n";
         echo "<input type='hidden' name='items_id' value='" . $item->getID() . "'>\n";
         echo "<input type='hidden' name='itemtype' value='" . $item->getType() . "'>\n";
         echo "<div class='firstbloc'><table class='tab_cadre_fixe'>\n";
         echo "<tr class='tab_bg_2'><td class='center'>\n";
         _e('Network port type to be added');
         echo "&nbsp;";
         Dropdown::showFromArray('instantiation_type', NetworkPort::getNetworkPortInstantiationsWithNames(), array('value' => 'NetworkPortEthernet'));
         echo "</td>\n";
         echo "<td class='tab_bg_2 center' width='50%'>";
         _e('Add several ports');
         echo "&nbsp;<input type='checkbox' name='several' value='1'></td>\n";
         echo "<td>\n";
         echo "<input type='submit' name='create' value=\"" . _sx('button', 'Add') . "\" " . "class='submit'>\n";
         echo "</td></tr></table></div>\n";
         Html::closeForm();
     }
     $monitoring = 0;
     if (class_exists("PluginMonitoringNetworkport")) {
         $monitoring = 1;
     }
     // * Get all ports compose tha aggregat
     $a_aggregated_ports = array();
     $query = "SELECT *, glpi_plugin_fusioninventory_networkports.mac as ifmacinternal\n      FROM glpi_plugin_fusioninventory_networkports\n      LEFT JOIN glpi_networkports\n      ON glpi_plugin_fusioninventory_networkports.networkports_id = glpi_networkports.id\n      WHERE glpi_networkports.items_id='" . $id . "'\n         AND glpi_networkports.itemtype='NetworkEquipment'\n         AND `instantiation_type`='NetworkPortAggregate'\n      ORDER BY logical_number ";
     $result = $DB->query($query);
     while ($data = $DB->fetch_array($result)) {
         $query_ag = "SELECT * FROM `glpi_networkportaggregates`\n            WHERE `networkports_id`='" . $data['id'] . "'\n            LIMIT 1";
         $result_ag = $DB->query($query_ag);
         if ($DB->numrows($result_ag) > 0) {
             $data_ag = $DB->fetch_assoc($result_ag);
             $a_ports = importArrayFromDB($data_ag['networkports_id_list']);
             foreach ($a_ports as $port_id) {
                 $a_aggregated_ports[$port_id] = $port_id;
             }
         }
     }
     $where = '';
     if (count($a_aggregated_ports) > 0) {
         $where = "AND `glpi_networkports`.`id` NOT IN " . "('" . implode("', '", $a_aggregated_ports) . "')";
     }
     $query = "SELECT `glpi_networkports`.`id`, `instantiation_type`,\n         `glpi_plugin_fusioninventory_networkports`.`id` as `fusionid`\n      FROM glpi_plugin_fusioninventory_networkports\n\n      LEFT JOIN glpi_networkports\n         ON glpi_plugin_fusioninventory_networkports.networkports_id = glpi_networkports.id\n      WHERE glpi_networkports.items_id='" . $id . "'\n         AND `glpi_networkports`.`itemtype`='NetworkEquipment'\n         " . $where . "\n         AND NOT (glpi_networkports.name='general'\n                     AND glpi_networkports.logical_number=0)\n      ORDER BY logical_number ";
     $nbcol = 5;
     if ($monitoring == '1') {
//.........这里部分代码省略.........
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:101,代码来源:networkequipment.class.php


注:本文中的NetworkPort::getFormURL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。