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


PHP CommonGLPI::isDynamic方法代码示例

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


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

示例1: displayTabContentForItem

 /**
  * @param $item            CommonGLPI object
  * @param $tabnum          (default 1)
  * @param $withtemplate    (default 0)
  **/
 static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0)
 {
     if ($item->isDynamic()) {
         self::showForItem($item);
     }
     return true;
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:12,代码来源:lock.class.php

示例2: showForItem

 static function showForItem(CommonGLPI $item, $withtemplate = 0)
 {
     global $CFG_GLPI;
     $is_device = $item instanceof CommonDevice;
     $ID = $item->getField('id');
     if (!$item->can($ID, READ)) {
         return false;
     }
     $canedit = $withtemplate != 2 && $item->canEdit($ID) && Session::haveRightsOr('device', array(UPDATE, PURGE));
     echo "<div class='spaced'>";
     $rand = mt_rand();
     if ($canedit) {
         echo "\n<form id='form_device_add{$rand}' name='form_device_add{$rand}'\n                  action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "' method='post'>\n";
         echo "\t<input type='hidden' name='items_id' value='{$ID}'>\n";
         echo "\t<input type='hidden' name='itemtype' value='" . $item->getType() . "'>\n";
     }
     $table = new HTMLTableMain();
     $table->setTitle(_n('Component', 'Components', Session::getPluralNumber()));
     if ($canedit) {
         $delete_all_column = $table->addHeader('delete all', Html::getCheckAllAsCheckbox("form_device_action{$rand}", '__RAND__'));
         $delete_all_column->setHTMLClass('center');
     } else {
         $delete_all_column = NULL;
     }
     $column_label = $is_device ? _n('Item', 'Items', Session::getPluralNumber()) : __('Type of component');
     $common_column = $table->addHeader('common', $column_label);
     $specific_column = $table->addHeader('specificities', __('Specificities'));
     $specific_column->setHTMLClass('center');
     $dynamic_column = '';
     if ($item->isDynamic()) {
         $dynamic_column = $table->addHeader('is_dynamic', __('Automatic inventory'));
         $dynamic_column->setHTMLClass('center');
     }
     if ($canedit) {
         $massiveactionparams = array('container' => "form_device_action{$rand}", 'fixed' => false, 'display_arrow' => false);
         $content = array(array('function' => 'Html::showMassiveActions', 'parameters' => array($massiveactionparams)));
         $delete_column = $table->addHeader('delete one', $content);
         $delete_column->setHTMLClass('center');
     } else {
         $delete_column = NULL;
     }
     $table_options = array('canedit' => $canedit, 'rand' => $rand);
     if ($is_device) {
         Session::initNavigateListItems(static::getType(), sprintf(__('%1$s = %2$s'), $item->getTypeName(1), $item->getName()));
         foreach (array_merge(array(''), self::getConcernedItems()) as $itemtype) {
             $table_options['itemtype'] = $itemtype;
             $link = getItemForItemtype(static::getType());
             $link->getTableGroup($item, $table, $table_options, $delete_all_column, $common_column, $specific_column, $delete_column, $dynamic_column);
         }
     } else {
         $devtypes = array();
         foreach (self::getItemAffinities($item->getType()) as $link_type) {
             $devtypes[] = $link_type::getDeviceType();
             $link = getItemForItemtype($link_type);
             Session::initNavigateListItems($link_type, sprintf(__('%1$s = %2$s'), $item->getTypeName(1), $item->getName()));
             $link->getTableGroup($item, $table, $table_options, $delete_all_column, $common_column, $specific_column, $delete_column, $dynamic_column);
         }
     }
     if ($canedit) {
         echo "<table class='tab_cadre_fixe'><tr class='tab_bg_1'><td>";
         echo __('Add a new component') . "</td><td class=left width='70%'>";
         if ($is_device) {
             Dropdown::showNumber('number_devices_to_add', array('value' => 0, 'min' => 0, 'max' => 10));
         } else {
             Dropdown::showSelectItemFromItemtypes(array('itemtype_name' => 'devicetype', 'items_id_name' => 'devices_id', 'itemtypes' => $devtypes, 'entity_restrict' => $item->getEntityID(), 'showItemSpecificity' => $CFG_GLPI['root_doc'] . '/ajax/selectUnaffectedOrNewItem_Device.php'));
         }
         echo "</td><td>";
         echo "<input type='submit' class='submit' name='add' value='" . _sx('button', 'Add') . "'>";
         echo "</td></tr></table>";
         Html::closeForm();
     }
     if ($canedit) {
         echo "\n<form id='form_device_action{$rand}' name='form_device_action{$rand}'\n                  action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "' method='post'>\n";
         echo "\t<input type='hidden' name='items_id' value='{$ID}'>\n";
         echo "\t<input type='hidden' name='itemtype' value='" . $item->getType() . "'>\n";
     }
     $table->display(array('display_super_for_each_group' => false, 'display_title_for_each_group' => false));
     if ($canedit) {
         //          echo "<input type='submit' class='submit' name='updateall' value='" .
         //               _sx('button', 'Save')."'>";
         Html::closeForm();
     }
     echo "</div>";
     // Force disable selected items
     $_SESSION['glpimassiveactionselected'] = array();
 }
开发者ID:pvasener,项目名称:glpi,代码行数:86,代码来源:item_devices.class.php

示例3: showForItem

 static function showForItem(CommonGLPI $item, $withtemplate = 0)
 {
     $ID = $item->getField('id');
     if (!$item->can($ID, 'r')) {
         return false;
     }
     $canedit = $withtemplate != 2 && $item->can($ID, 'w');
     echo "<div class='spaced'>";
     $rand = mt_rand();
     if ($canedit) {
         echo "\n<form id='form_device_action{$rand}' name='form_device_action{$rand}'\n                  action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "' method='post'>\n";
         echo "\t<input type='hidden' name='items_id' value='{$ID}'>\n";
         echo "\t<input type='hidden' name='itemtype' value='" . $item->getType() . "'>\n";
     }
     $table = new HTMLTableMain();
     $table->setTitle(_n('Component', 'Components', 2));
     if ($canedit) {
         $delete_all_column = $table->addHeader('delete all', Html::getCheckAllAsCheckbox("form_device_action{$rand}", '__RAND__'));
         $delete_all_column->setHTMLClass('center');
     } else {
         $delete_all_column = NULL;
     }
     $common_column = $table->addHeader('common', __('Type of component'));
     $specific_column = $table->addHeader('specificities', __('Specificities'));
     $specific_column->setHTMLClass('center');
     $dynamic_column = '';
     if ($item->isDynamic()) {
         $dynamic_column = $table->addHeader('is_dynamic', __('Automatic inventory'));
         $dynamic_column->setHTMLClass('center');
     }
     if ($canedit) {
         $content = "<input type='submit' class='submit' name='delete' value='" . _sx('button', 'Delete permanently') . "'>";
         $delete_column = $table->addHeader('delete one', $content);
         $delete_column->setHTMLClass('center');
     } else {
         $delete_column = NULL;
     }
     $table_options = array('canedit' => $canedit);
     $devtypes = array();
     foreach (self::getDeviceTypes() as $link_type) {
         $devtypes[] = $link_type::getDeviceType();
         $link_type::getTableGroup($item, $table, $table_options, $delete_all_column, $common_column, $specific_column, $delete_column, $dynamic_column);
     }
     if ($canedit) {
         echo "<table class='tab_cadre_fixe'><tr class='tab_bg_1'><td>";
         echo __('Add a new component') . "</td><td class=left width='70%'>";
         Dropdown::showAllItems('devices_id', '', 0, -1, $devtypes, false, false, 'devicetype');
         echo "</td><td>";
         echo "<input type='submit' class='submit' name='add' value='" . _sx('button', 'Add') . "'>";
         echo "</td></tr></table>";
     }
     $table->display(array('display_super_for_each_group' => false, 'display_title_for_each_group' => false));
     if ($canedit) {
         echo "<input type='submit' class='submit' name='updateall' value='" . _sx('button', 'Save') . "'>";
         Html::closeForm();
     }
     echo "</div>";
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:58,代码来源:item_devices.class.php


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