Dropdown::showAllItems PHP Method

showAllItems() static public method

Make a select box for all items
Deprecation: since version 0.85, replaced by self::showSelectItemFromItemtypes()
static public showAllItems ( $myname, $value_type, $value, $entity_restrict, $types = '', $onlyglobal = false, $checkright = false, $itemtypename = 'itemtype' ) : nothing
$myname select name
$value_type default value for the device type (default 0)
$value default value (default 0)
$entity_restrict Restrict to a defined entity (default -1)
$types Types used (default '')
$onlyglobal Restrict to global items (false by default)
$checkright Restrict to items with read rights (false by default)
$itemtypename name used for itemtype select
return nothing (print out an HTML select box)
    static function showAllItems($myname, $value_type = 0, $value = 0, $entity_restrict = -1, $types = '', $onlyglobal = false, $checkright = false, $itemtypename = 'itemtype')
    {
        $options = array();
        $options['itemtype_name'] = $itemtypename;
        $options['items_id_name'] = $myname;
        $options['itemtypes'] = $types;
        $options['entity_restrict'] = $entity_restrict;
        $options['onlyglobal'] = $onlyglobal;
        $options['checkright'] = $checkright;
        if ($value > 0) {
            $options['default'] = $value_type;
        }
        self::showSelectItemFromItemtypes($options);
    }

Usage Example

コード例 #1
0
ファイル: config.class.php プロジェクト: geldarr/hack-space
 function showForm($ID)
 {
     global $CFG_GLPI;
     echo "<form name='form' method='post' action='" . $CFG_GLPI["root_doc"] . "/plugins/immobilizationsheets/front/immobilizationsheet.php'>";
     echo "<div align=\"center\">";
     echo "<table class=\"tab_cadre\"  cellspacing=\"2\" cellpadding=\"2\">";
     echo "<tr><th>" . __('Generation of immobilization sheet', 'immobilizationsheets') . "</th></tr>";
     echo "<tr>";
     echo "<td class='tab_bg_2 center'>";
     $immo_item = new PluginImmobilizationsheetsItem();
     Dropdown::showAllItems("item_item", 0, 0, -1, $immo_item->getTypes());
     echo "<input type=\"submit\" name=\"massiveaction\" class=\"submit\" value=\"" . __s('Post') . "\" >";
     echo "</td>";
     echo "</tr>";
     echo "</table></div>";
     Html::closeForm();
 }
All Usage Examples Of Dropdown::showAllItems