PHP Класс Dropdown, glpi

Наследование: extends database
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
addNewCondition ( $condition )
dropdownIcons ( $myname, $value, $store_path, $display = true ) : nothing Make a select box for icons
dropdownUsedItemTypes ( $name, $itemtype_ref, $options = [] ) : nothing Make a select box for device type
getDeviceItemTypes ( ) : array Get the Device list name the user is allowed to edit
getDropdownArrayNames ( $table, $ids ) : array Get values of a dropdown for a list of item
getDropdownName ( $table, $id, $withcomment, $translate = true, $tooltip = true ) : string Get the value of a dropdown
getGlobalSwitch ( $value ) : the Get the label associated with a management type
getLanguageName ( $value )
getStandardDropdownItemTypes ( ) : array Get the dropdown list name the user is allowed to edit
getValueWithUnit ( $value, $unit ) Get value with unit / Automatic management of standar unit (year, month, %, .
getYesNo ( $value ) : string Get Yes No string
import ( $itemtype, $input ) : the Import a dropdown - check if already exists
importExternal ( $itemtype, $value, $entities_id, $external_params = [], $comment = '', $add = true ) : integer Import a value in a dropdown table.
show ( $itemtype, $options = [] ) : boolean Print out an HTML "
showAdvanceDateRestrictionSwitch ( $enabled ) Toggle view in LDAP user import/synchro between no restriction and date restriction
showAllItems ( $myname, $value_type, $value, $entity_restrict, $types = '', $onlyglobal = false, $checkright = false, $itemtypename = 'itemtype' ) : nothing Make a select box for all items
showFromArray ( $name, array $elements, $options = [] ) Dropdown of values in an array
showGMT ( $name, $value = '' ) Dropdown for GMT selection
showGlobalSwitch ( $ID, $attrs = [] ) Dropdown for global item management
showHours ( $name, $options = [] ) : Nothing Print a select with hours
showInteger ( $myname, $value, $min, $max = 100, $step = 1, $toadd = [], $options = [] ) Dropdown integers
showItemType ( $types = '', $options = [] ) : integer show a dropdown to selec a type
showItemTypeList ( $optgroup ) Display a list to select a itemtype with link to search form
showItemTypeMenu ( $title, $optgroup, $value = '' ) Display a menu to select a itemtype which open the search form
showItemTypes ( $name, $types = [], $options = [] ) : nothing Make a select box for device type
showLanguages ( $myname, $options = [] ) Dropdown available languages
showListLimit ( $onchange = '' ) show dropdown to select list limit
showNumber ( $myname, $options = [] ) Dropdown numbers
showOutputFormat ( ) show dropdown for output format
showPrivatePublicSwitch ( $is_private, $entity, $is_recursive ) Private / Public switch for items which may be assign to a user and/or an entity
showSelectItemFromItemtypes ( array $options = [] ) : randomized Make a select box for all items
showTimeStamp ( $myname, $options = [] ) Dropdown integers
showYesNo ( $name, $value, $restrict_to, $params = [] ) : rand Make a select box for a boolean choice (Yes/No) or display a checkbox. Add a 'use_checkbox' = true to the $params array to display a checkbox instead a select box

Описание методов

addNewCondition() статический публичный Метод

static public addNewCondition ( $condition )

dropdownIcons() статический публичный Метод

Make a select box for icons
static public dropdownIcons ( $myname, $value, $store_path, $display = true ) : nothing
$myname the name of the HTML select
$value the preselected value we want
$store_path path where icons are stored
$display boolean display of get string ? (true by default)
Результат nothing (print out an HTML select box)

dropdownUsedItemTypes() статический публичный Метод

Make a select box for device type
static public dropdownUsedItemTypes ( $name, $itemtype_ref, $options = [] ) : nothing
$name name of the select box
$itemtype_ref string itemtype reference where to search in itemtype field
$options array of possible options: - may be value (default value) / field (used field to search itemtype)
Результат nothing (print out an HTML select box)

getDeviceItemTypes() статический публичный Метод

Get the Device list name the user is allowed to edit
static public getDeviceItemTypes ( ) : array
Результат array (group of dropdown) of array (itemtype => localized name)

getDropdownArrayNames() статический публичный Метод

Get values of a dropdown for a list of item
static public getDropdownArrayNames ( $table, $ids ) : array
$table the dropdown table from witch we want values on the select
$ids array containing the ids to get
Результат array containing the value of the dropdown or   if not exists

getDropdownName() статический публичный Метод

Returns the value of the dropdown from $table with ID $id.
static public getDropdownName ( $table, $id, $withcomment, $translate = true, $tooltip = true ) : string
$table the dropdown table from witch we want values on the select
$id id of the element to get
$withcomment give array with name and comment (default 0)
$translate (true by default)
$tooltip boolean (true by default) returns a tooltip, else returns only 'comment'
Результат string the value of the dropdown or   if not exists

getGlobalSwitch() статический публичный Метод

Get the label associated with a management type
static public getGlobalSwitch ( $value ) : the
Результат the label corresponding to it, or ""

getLanguageName() статический публичный Метод

static public getLanguageName ( $value )
$value

getStandardDropdownItemTypes() статический публичный Метод

Get the dropdown list name the user is allowed to edit
static public getStandardDropdownItemTypes ( ) : array
Результат array (group of dropdown) of array (itemtype => localized name)

getValueWithUnit() статический публичный Метод

..)
static public getValueWithUnit ( $value, $unit )
$value integer number of item
$unit string of unit (maybe year, month, day, hour, % for standard management)

getYesNo() статический публичный Метод

Get Yes No string
static public getYesNo ( $value ) : string
$value Yes No value
Результат string

import() статический публичный Метод

Import a dropdown - check if already exists
static public import ( $itemtype, $input ) : the
$itemtype string name of the class
$input array of value to import
Результат the ID of the new

importExternal() статический публичный Метод

This import a new dropdown if it doesn't exist - Play dictionnary if needed
static public importExternal ( $itemtype, $value, $entities_id, $external_params = [], $comment = '', $add = true ) : integer
$itemtype string name of the class
$value string Value of the new dropdown. (need to be addslashes)
$entities_id integer entity in case of specific dropdown (default -1)
$external_params array (need to be addslashes)
$comment (default '') (need to be addslashes)
$add if true, add it if not found. if false, just check if exists (true by default)
Результат integer : dropdown id.

show() статический публичный Метод

Print out an HTML "