PHP Класс Html, glpi

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

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

Метод Описание
addConfirmationOnAction ( $string, $additionalactions = '' ) : nothing Add confirmation on button or link before action
ajaxFooter ( ) Display Ajax Footer for debug
ajaxForm ( $selector, $success = "console.log(html);" ) This function provides a mecanism to send html form by ajax
autocompletionTextField ( CommonDBTM $item, $field, $options = [] ) : nothing Show div with auto completion
back ( ) : nothing Redirection to $_SERVER['HTTP_REFERER'] page
changeProgressBarMessage ( $msg = " " ) : nothing Change the Message under the Progress Bar
changeProgressBarPosition ( $crt, $tot, $msg = "" ) : nothing Change the Progress Bar Position
checkAllAsCheckbox ( $container_id, $rand = '' ) : nothing Display "check All as" checkbox
clean ( $value, $striptags = true, $keep_bad = 2 ) : clean Clean display value deleting html tags
cleanId ( $id ) : String Clean ID used for HTML elements
cleanInputText ( $string ) : clean Clean string for input text field
cleanParametersURL ( $url ) : clean Clean all parameters of an URL. Get a clean URL
cleanPostForTextArea ( $value ) : clean Clean post value for display in textarea
cleanSQLDisplay ( $request ) Clean Display of Request
closeArrowMassives ( $actions, $confirm = [] ) show arrow for massives actions : closing
closeForm ( $display = true ) : String Create a close form part including CSRF token
computeGenericDateTimeSearch ( $val, $force_day = false, $specifictime = '' ) : computed Compute date / datetime value resulting of showGenericDateTimeSearch
convDate ( $time, $format = null ) Convert a date YY-MM-DD to DD-MM-YY for calendar
convDateTime ( $time, $format = null ) Convert a date YY-MM-DD HH:MM to DD-MM-YY HH:MM for display in a html table
createProgressBar ( $msg = " " ) : nothing Create a Dynamic Progress Bar
css ( $url, $options = [] ) : string Creates a link element for CSS stylesheets.
displayAjaxMessageAfterRedirect ( )
displayBackLink ( ) Display a Link to the last page using http_referer if available else use history.back
displayDebugInfos ( $with_session = true, $ajax = false ) Display Debug Information
displayErrorAndDie ( $message, $minimal = false ) : nothing Simple Error message page
displayMenuAll ( $menu = [] ) Display responsive menu
displayMessageAfterRedirect ( ) Display a div containing messages set in session in the previous page
displayNotFoundError ( ) : Nothing Display common message for item not found
displayProgressBar ( $width, $percent, $options = [] ) : nothing Display a simple progress bar
displayRightError ( ) : Nothing Display common message for privileges errors
displayTitle ( $ref_pic_link = "", $ref_pic_text = "", $ref_title = "", $ref_btts = "" ) : nothing Common Title Function
entities_deep ( $value ) : array Recursivly execute htmlentities on an Array
entity_decode_deep ( $value ) : array Recursivly execute html_entity_decode on an Array
file ( $options = [] ) : string Creates an input file field. Send file names in _$name field as array.
fileScript ( $options = [] ) : nothing fileScript : file upload script
footer ( $keepDB = false ) Print footer for every page
formatAttribute ( $key, $value ) : string Formats an individual attribute, and returns the string value of the composed attribute.
formatNumber ( $number, $edit = false, $forcedecimal ) : formatted Convert a number to correct display
generateImageName ( ) : string
getCheckAllAsCheckbox ( $container_id, $rand = '' ) : Get Get "check All as" checkbox
getCheckbox ( array $options ) : the Get a checkbox.
getConfirmationOnActionScript ( $string, $additionalactions = '' ) : confirmation Get confirmation on button or link before action
getCopyrightMessage ( ) : text Get copyright message as HTML (used in footers)
getCriterionForMassiveCheckboxes ( array $options ) : the Get the jquery criterion for massive checkbox update We can filter checkboxes by a container or by a tag. We can also select checkboxes that have a given tag and that are contained inside a container
getGenericDateTimeSearchItems ( $options ) : array Get items to display for showGenericDateTimeSearch
getMassiveActionCheckBox ( $itemtype, $id, array $options = [] ) : get Get the massive action checkbox
getMenuInfos ( ) : string
getOpenMassiveActionsForm ( $name = '' ) : open Get open form for massive action string
getSimpleForm ( $action, $btname, $btlabel, array $fields = [], $btimage = '', $btoption = '', $confirm = '' ) create a minimal form for simple action
glpi_flush ( ) Flush the current displayed items (do not works really fine)
header ( $title, $url = '', $sector = "none", $item = "none", $option = "" ) Print a nice HTML head for every page
header_nocache ( ) Set page not to use the cache
helpFooter ( ) Print footer for help page
helpHeader ( $title, $url = '' ) Print a nice HTML head for help page
hidden ( $fieldName, $options = [] ) : string Creates a hidden input field.
image ( $path, $options = [] ) : string Creates a formatted IMG element.
imagePaste ( $options = [] ) : nothing imagePaste : Show image paste for an item, with TinyMce
includeHeader ( $title = '' ) : nothing Include common HTML headers
initEditorSystem ( $name, $rand = '', $display = true ) : nothing Init the Editor System to a textarea
initImagePasteSystem ( $name, $rand ) : nothing Init the Image paste System for tiny mce
input ( $fieldName, $options = [] ) : string Creates a text input field.
jsAdaptDropdown ( $id, $params = [] ) : String Adapt dropdown to clean JS
jsAjaxDropdown ( $name, $field_id, $url, $params = [] ) : String Create Ajax dropdown to clean JS
jsAlertCallback ( $msg, $title, $okCallback = null ) Summary of jsAlertCallback Is a replacement for Javascript native alert function Beware that native alert is synchronous by nature (will block browser waiting an answer from user, but that this is emulating the alert behaviour by using a callback function when user presses 'Ok' button.
jsConfirmCallback ( $msg, $title, $yesCallback = null, $noCallback = null ) Summary of confirmCallback Is a replacement for Javascript native confirm function Beware that native confirm is synchronous by nature (will block browser waiting an answer from user, but that this is emulating the confirm behaviour by using callbacks functions when user presses 'Yes' or 'No' buttons.
jsDisable ( $id ) : String Get javascript code for disable an item
jsEnable ( $id ) : String Get javascript code for enable an item
jsGetDropdownValue ( $id ) : string Get item value
jsGetElementbyID ( $id ) : String Get javascript code to get item by id
jsHide ( $id ) : String Get javascript code for hide an item
jsSetDropdownValue ( $id, $value ) : string Set dropdown value
jsShow ( $id ) : String Get javascript code for hide an item
link ( $text, $url, $options = [] ) : string Creates an HTML link.
makeTitle ( $string, $num, $tot ) : String Create a title for list, as "List (5 on 35)"
nl2br_deep ( $value ) : array Recursivly execute nl2br on an Array
nullFooter ( ) Print footer for null page
nullHeader ( $title, $url = '' ) Print a nice HTML head with no controls
openArrowMassives ( $formname, $fixed = false, $ontop = false, $onright = false ) show arrow for massives actions : opening
openMassiveActionsForm ( $name = '' ) : nothing Display open form for massive action
parseAttributes ( $options = [] ) : string Returns a space-delimited string with items of the $options array.
popFooter ( ) Print footer for a modal window
popHeader ( $title, $url = '', $iframed = false ) Print a nice HTML head for modal window (nothing to display)
printAjaxPager ( $title, $start, $numrows, $additional_info = '' ) : nothing Print Ajax pager for list in tab panel
printCleanArray ( $tab, $pad, $jsexpand = false ) : nothing Clean Printing of and array in a table ONLY FOR DEBUG
printPager ( $start, $numrows, $target, $parameters, $item_type_output, $item_type_output_param, $additional_info = '' ) : nothing Print pager for search option (first/previous/next/last)
printPagerForm ( $action = "" ) : nothing Display the list_limit combo choice
progressBar ( $id, array $options = [] ) : nothing Manage progresse bars
redefineAlert ( ) In this function, we redefine 'window.alert' javascript function by a jquery-ui dialog equivalent (but prettier).
redefineConfirm ( ) In this function, we redefine 'window.confirm' javascript function by a jquery-ui dialog equivalent (but prettier).
redirect ( $dest ) : nothing Redirection hack
redirectToLogin ( $params = '' ) : nothing Redirection to Login page
resume_name ( $string, $length = 255 ) : cut Resume a name for display
resume_text ( $string, $length = 255 ) : cut Resume text for followup
script ( $url ) : String Returns one or many script tags depending on the number of scripts given.
scriptBlock ( $script ) : string Wrap $script in a script tag.
scriptEnd ( ) : mixed End a Buffered section of Javascript capturing.
scriptStart ( ) Begin a script block that captures output until HtmlHelper::scriptEnd() is called. This capturing block will capture all output between the methods and create a scriptBlock from it.
showCheckbox ( array $options = [] ) : nothing
showCheckboxMatrix ( array $columns, array $rows, array $options = [] ) : random Display choice matrix
showColorField ( $name, $options = [] ) Display Color field
showDateField ( $name, $options = [] ) : rand Display Date form with calendar
showDateFormItem ( $element, $value = '', $maybeempty = true, $can_edit = true, $minDate = '', $maxDate = '', $displayYear = true ) : rand Display Date form with calendar
showDateTimeField ( $name, $options = [] ) : rand Display DateTime form with calendar
showDateTimeFormItem ( $element, $value = '', $time_step, $maybeempty = true, $can_edit = true, $minDate = '', $maxDate = '', $minTime = '', $maxTime = '' ) : rand Display DateTime form with calendar
showGenericDateTimeSearch ( $element, $value = '', $options = [] ) : rand Show generic date search
showMassiveActionCheckBox ( $itemtype, $id, array $options = [] ) : show Show the massive action checkbox
showMassiveActions ( $options = [] ) : nothing Display massive actions
showProfileSelecter ( $target ) : nothing Print the form used to select profile if several are available
showSimpleForm ( $action, $btname, $btlabel, array $fields = [], $btimage = '', $btoption = '', $confirm = '' ) create a minimal form for simple action
showToolTip ( $content, $options = [] ) : nothing Show a tooltip on an item
simpleHeader ( $title, $links = [] ) Print a simple HTML head with links
submit ( $caption, $options = [] ) : string Creates a submit button element. This method will generate input elements that can be used to submit, and reset forms by using $options. Image submits can be created by supplying an image option
timestampToString ( $time, $display_sec = true, $use_days = true ) : string Make a good string from the unix timestamp $sec
weblink_extract ( $value ) : clean Extract url from web link

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

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

Add confirmation on button or link before action
static public addConfirmationOnAction ( $string, $additionalactions = '' ) : nothing
$string string to display or array of string for using multilines
$additionalactions string additional actions to do on success confirmation (default '')
Результат nothing

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

Display Ajax Footer for debug
static public ajaxFooter ( )

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

This function provides a mecanism to send html form by ajax
static public ajaxForm ( $selector, $success = "console.log(html);" )

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

Show div with auto completion
static public autocompletionTextField ( CommonDBTM $item, $field, $options = [] ) : nothing
$item CommonDBTM item object used for create dropdown
$field field to search for autocompletion
$options array of possible options: - name : string / name of the select (default is field parameter) - value : integer / preselected value (default value of the item object) - size : integer / size of the text field - entity : integer / restrict to a defined entity (default entity of the object if define) set to -1 not to take into account - user : integer / restrict to a defined user (default -1 : no restriction) - option : string / options to add to text field - display : boolean / if false get string
Результат nothing (print out an HTML div)

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

Redirection to $_SERVER['HTTP_REFERER'] page
static public back ( ) : nothing
Результат nothing

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

Change the Message under the Progress Bar
static public changeProgressBarMessage ( $msg = " " ) : nothing
$msg message under the bar (default ' ')
Результат nothing

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

Change the Progress Bar Position
static public changeProgressBarPosition ( $crt, $tot, $msg = "" ) : nothing
$crt Current Value (less then $max)
$tot Maximum Value
$msg message inside the bar (default is %) (default '')
Результат nothing

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

Display "check All as" checkbox
static public checkAllAsCheckbox ( $container_id, $rand = '' ) : nothing
$container_id string html of the container of checkboxes link to this check all checkbox
$rand string rand value to use (default is auto generated) (default ''))
Результат nothing / display item

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

Clean display value deleting html tags
static public clean ( $value, $striptags = true, $keep_bad = 2 ) : clean
$value string: string value
$striptags bool: strip all html tags
$keep_bad int: 1 : neutralize tag anb content, 2 : remove tag and neutralize content
Результат clean value

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

Clean ID used for HTML elements
static public cleanId ( $id ) : String
$id string id of the dom element
Результат String

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

Clean string for input text field
static public cleanInputText ( $string ) : clean
$string string: input text
Результат clean string

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

Clean all parameters of an URL. Get a clean URL
static public cleanParametersURL ( $url ) : clean
$url string URL
Результат clean URL

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

Clean post value for display in textarea
static public cleanPostForTextArea ( $value ) : clean
$value string: string value
Результат clean value

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

Clean Display of Request
static public cleanSQLDisplay ( $request )
$request SQL request

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

show arrow for massives actions : closing
static public closeArrowMassives ( $actions, $confirm = [] )
$actions array of action : $name -> $label
$confirm array of confirmation string (optional) \deprecated since 0.84

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

Create a close form part including CSRF token
static public closeForm ( $display = true ) : String
$display boolean Display or return string (default true)
Результат String

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

Compute date / datetime value resulting of showGenericDateTimeSearch
См. также: showGenericDateTimeSearch
static public computeGenericDateTimeSearch ( $val, $force_day = false, $specifictime = '' ) : computed
$val date / datetime value passed
$force_day boolean force computation in days (false by default)
$specifictime timestamp set specific timestamp (default '')
Результат computed date / datetime value

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

Convert a date YY-MM-DD to DD-MM-YY for calendar
static public convDate ( $time, $format = null )
$time date date to convert
$format (default null)

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

Convert a date YY-MM-DD HH:MM to DD-MM-YY HH:MM for display in a html table
static public convDateTime ( $time, $format = null )
$time datetime datetime to convert @param $format (default null)

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

Create a Dynamic Progress Bar
static public createProgressBar ( $msg = " " ) : nothing
$msg initial message (under the bar) (default ' ')
Результат nothing

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

Creates a link element for CSS stylesheets.
static public css ( $url, $options = [] ) : string
$url String of javascript file to include
$options Array of HTML attributes.
Результат string CSS link tag

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

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

Display Debug Information
static public displayDebugInfos ( $with_session = true, $ajax = false )
$with_session with session information (true by default)

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

Simple Error message page
static public displayErrorAndDie ( $message, $minimal = false ) : nothing
$message string displayed before dying
$minimal set to true do not display app menu (false by default)
Результат nothing as function kill script

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

Display responsive menu
С версии: 0.90.1
static public displayMenuAll ( $menu = [] )
$menu array of menu items - key : plugin system name - value : array of options * id : html id attribute * default : defaul url * title : displayed label * content : menu sub items, array with theses options : - page : url - title : displayed label - shortcut : keyboard shortcut letter

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

Display a div containing messages set in session in the previous page
static public displayMessageAfterRedirect ( )

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

Display common message for item not found
static public displayNotFoundError ( ) : Nothing
Результат Nothing

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

Display a simple progress bar
static public displayProgressBar ( $width, $percent, $options = [] ) : nothing
$width Width of the progress bar
$percent Percent of the progress bar
$options array of possible options: - title : string title to display (default Progesssion) - simple : display a simple progress bar (no title / only percent) - forcepadding : boolean force str_pad to force refresh (default true)
Результат nothing

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

Display common message for privileges errors
static public displayRightError ( ) : Nothing
Результат Nothing (die)

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

Common Title Function
static public displayTitle ( $ref_pic_link = "", $ref_pic_text = "", $ref_title = "", $ref_btts = "" ) : nothing
$ref_pic_link Path to the image to display (default '')
$ref_pic_text Alt text of the icon (default '')
$ref_title Title to display (default '')
$ref_btts Extra items to display array(link=>text...) (default '')
Результат nothing

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

Recursivly execute htmlentities on an Array
static public entities_deep ( $value ) : array
$value string or array
Результат array of value (same struct as input)

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

Recursivly execute html_entity_decode on an Array
static public entity_decode_deep ( $value ) : array
$value string or array
Результат array of value (same struct as input)

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

Files are uploaded in files/_tmp/ directory
static public file ( $options = [] ) : string
$options array of options - name string field name (default filename) - multiple boolean allow multiple file upload (default false) - onlyimages boolean restrict to image files (default false) - showfilecontainer string DOM ID of the container showing file uploaded: use selector to display - showfilesize boolean show file size with file name - rand string already computed rand value - pasteZone string DOM ID of the paste zone - dropZone string DOM ID of the drop zone
Результат string input file field

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

fileScript : file upload script
static public fileScript ( $options = [] ) : nothing
$options array of possible options: - imagePaste boolean image paste with tinyMce - name string field name (default filename) - multiple boolean allow multiple file upload (default false) - onlyimages boolean restrict to image files (default false) - showfilecontainer string DOM ID of the container showing file uploaded: use selector to display - pasteZone string DOM ID of the paste zone - dropZone string DOM ID of the drop zone - rand string already computed rand value
Результат nothing (print the image paste)

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

Formats an individual attribute, and returns the string value of the composed attribute.
static public formatAttribute ( $key, $value ) : string
$key The name of the attribute to create
$value The value of the attribute to create.
Результат string The composed attribute.

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

Convert a number to correct display
static public formatNumber ( $number, $edit = false, $forcedecimal ) : formatted
$number float Number to display
$edit boolean display number for edition ? (id edit use . in all case) (false by default)
$forcedecimal integer Force decimal number (do not use default value) (default -1)
Результат formatted number

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

static public generateImageName ( ) : string
Результат string

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

Get "check All as" checkbox
static public getCheckAllAsCheckbox ( $container_id, $rand = '' ) : Get
$container_id string html of the container of checkboxes link to this check all checkbox
$rand string rand value to use (default is auto generated)(default '')
Результат Get checkbox string

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

Get a checkbox.
static public getCheckbox ( array $options ) : the
$options array array of parameters: - title its title - name its name - id its id - value the value to set when checked - readonly can we edit it ? - massive_tags the tag to set for massive checkbox update - checked is it checked or not ? - zero_on_empty do we send 0 on submit when it is not checked ? - specific_tags HTML5 tags to add - criterion the criterion for massive checkbox
Результат the HTML code for the checkbox

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

Get confirmation on button or link before action
static public getConfirmationOnActionScript ( $string, $additionalactions = '' ) : confirmation
$string string to display or array of string for using multilines
$additionalactions string additional actions to do on success confirmation (default '')
Результат confirmation script

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

Get copyright message as HTML (used in footers)
С версии: 9.1
static public getCopyrightMessage ( ) : text
Результат text

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

Get the jquery criterion for massive checkbox update We can filter checkboxes by a container or by a tag. We can also select checkboxes that have a given tag and that are contained inside a container
static public getCriterionForMassiveCheckboxes ( array $options ) : the
$options array array of parameters: - tag_for_massive tag of the checkboxes to update - container_id if of the container of the checkboxes
Результат the javascript code for jquery criterion or empty string if it is not a massive update checkbox

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

Get items to display for showGenericDateTimeSearch
См. также: showGenericDateTimeSearch
static public getGenericDateTimeSearchItems ( $options ) : array
$options array of possible options: - with_time display with time selection ? (default false) - with_future display with future date selection ? (default false) - with_days display specific days selection TODAY, BEGINMONTH, LASTMONDAY... ? (default true)
Результат array of posible values

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

Get the massive action checkbox
static public getMassiveActionCheckBox ( $itemtype, $id, array $options = [] ) : get
$itemtype Massive action itemtype
$id ID of the item
$options array array
Результат get checkbox

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

static public getMenuInfos ( ) : string
Результат string

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

Get open form for massive action string
static public getOpenMassiveActionsForm ( $name = '' ) : open
$name given name/id to the form (default '')
Результат open form string

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

create a minimal form for simple action
static public getSimpleForm ( $action, $btname, $btlabel, array $fields = [], $btimage = '', $btoption = '', $confirm = '' )
$action String URL to call on submit
$btname String button name (maybe if name <> value)
$btlabel String button label
$fields array Array field name => field value
$btimage String button image uri (optional) (default '')
$btoption String optional button option (default '')
$confirm String optional confirm message (default '')

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

Flush the current displayed items (do not works really fine)
static public glpi_flush ( )

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

Print a nice HTML head for every page
static public header ( $title, $url = '', $sector = "none", $item = "none", $option = "" )
$title title of the page
$url not used anymore (default '')
$sector sector in which the page displayed is (default 'none')
$item item corresponding to the page displayed (default 'none')
$option option corresponding to the page displayed (default '')

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

Set page not to use the cache
static public header_nocache ( )

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

Print footer for help page
static public helpFooter ( )

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

Print a nice HTML head for help page
static public helpHeader ( $title, $url = '' )
$title title of the page
$url not used anymore (default '')

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

If value of options is an array then recursively parse it to generate as many hidden input as necessary
static public hidden ( $fieldName, $options = [] ) : string
$fieldName Name of a field
$options Array of HTML attributes.
Результат string A generated hidden input

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

This method will set an empty alt attribute if no alt and no title is not supplied
static public image ( $path, $options = [] ) : string
$path Path to the image file
$options Array of HTML attributes - `url` If provided an image link will be generated and the link will point at `$options['url']`.
Результат string completed img tag

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

imagePaste : Show image paste for an item, with TinyMce
static public imagePaste ( $options = [] ) : nothing
$options array of options - name string field name (default filename) - multiple boolean allow multiple file upload (default false - onlyimages boolean restrict to image files (default false) - showfilecontainer string DOM ID of the container showing file uploaded: use selector to display - imagePaste boolean image paste with tinyMce - dropZone string DOM ID of the drop zone - rand string already computed rand value - pasteZone string DOM ID of the paste zone
Результат nothing (print the image paste)

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

Include common HTML headers
static public includeHeader ( $title = '' ) : nothing
$title title used for the page (default '')
Результат nothing

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

Init the Editor System to a textarea
static public initEditorSystem ( $name, $rand = '', $display = true ) : nothing
$name name of the html textarea to use
$rand rand of the html textarea to use (if empty no image paste system)(default '')
$display boolean display or get js script (true by default)
Результат nothing

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

Init the Image paste System for tiny mce
static public initImagePasteSystem ( $name, $rand ) : nothing
$name name of the html textarea to use
$rand rand of the html textarea to use
Результат nothing

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

Creates a text input field.
static public input ( $fieldName, $options = [] ) : string
$fieldName Name of a field
$options Array of HTML attributes.
Результат string A generated hidden input

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

Adapt dropdown to clean JS
static public jsAdaptDropdown ( $id, $params = [] ) : String
$id string id of the dom element
$params array of parameters
Результат String

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

Create Ajax dropdown to clean JS
static public jsAjaxDropdown ( $name, $field_id, $url, $params = [] ) : String
$name
$field_id string id of the dom element
$url string URL to get datas
$params array of parameters must contains : - 'value' : default value selected - 'valuename' : default name of selected value
Результат String

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

Summary of jsAlertCallback Is a replacement for Javascript native alert function Beware that native alert is synchronous by nature (will block browser waiting an answer from user, but that this is emulating the alert behaviour by using a callback function when user presses 'Ok' button.
static public jsAlertCallback ( $msg, $title, $okCallback = null )
$msg string message to be shown
$title string title for dialog box
$okCallback string function that will be called when 'Ok' is pressed (default null)

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

Summary of confirmCallback Is a replacement for Javascript native confirm function Beware that native confirm is synchronous by nature (will block browser waiting an answer from user, but that this is emulating the confirm behaviour by using callbacks functions when user presses 'Yes' or 'No' buttons.
static public jsConfirmCallback ( $msg, $title, $yesCallback = null, $noCallback = null )
$msg string message to be shown
$title string title for dialog box
$yesCallback string function that will be called when 'Yes' is pressed (default null)
$noCallback string function that will be called when 'No' is pressed (default null)

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

Get javascript code for disable an item
static public jsDisable ( $id ) : String
$id string id of the dom element
Результат String

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

Get javascript code for enable an item
static public jsEnable ( $id ) : String
$id string id of the dom element
Результат String

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

Get item value
static public jsGetDropdownValue ( $id ) : string
$id string id of the dom element
Результат string

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

Get javascript code to get item by id
static public jsGetElementbyID ( $id ) : String
$id string id of the dom element
Результат String

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

Get javascript code for hide an item
static public jsHide ( $id ) : String
$id string id of the dom element
Результат String

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

Set dropdown value
static public jsSetDropdownValue ( $id, $value ) : string
$id string id of the dom element
$value string value to set
Результат string

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

Get javascript code for hide an item
static public jsShow ( $id ) : String
$id string id of the dom element
Результат String

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

Create a title for list, as "List (5 on 35)"
static public makeTitle ( $string, $num, $tot ) : String
$string String text for title
$num Integer number of item displayed
$tot Integer number of item existing
Результат String

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

Recursivly execute nl2br on an Array
static public nl2br_deep ( $value ) : array
$value string or array
Результат array of value (same struct as input)

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

Print footer for null page
static public nullFooter ( )

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

Print a nice HTML head with no controls
static public nullHeader ( $title, $url = '' )
$title title of the page
$url not used anymore (default '')

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

show arrow for massives actions : opening
static public openArrowMassives ( $formname, $fixed = false, $ontop = false, $onright = false )
$formname string
$fixed boolean used tab_cadre_fixe in both tables (false by default)
$ontop display on top of the list (false by default)
$onright display on right of the list (false by default) \deprecated since 0.84

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

Display open form for massive action
static public openMassiveActionsForm ( $name = '' ) : nothing
$name given name/id to the form (default '')
Результат nothing / display item

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

Returns a space-delimited string with items of the $options array.
static public parseAttributes ( $options = [] ) : string
$options Array of options.
Результат string Composed attributes.

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

Print footer for a modal window
static public popFooter ( )

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

Print a nice HTML head for modal window (nothing to display)
static public popHeader ( $title, $url = '', $iframed = false )
$title title of the page
$url not used anymore (default '')
$iframed indicate if page loaded in iframe - css target (default false)

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

Print Ajax pager for list in tab panel
static public printAjaxPager ( $title, $start, $numrows, $additional_info = '' ) : nothing
$title displayed above
$start from witch item we start
$numrows total items
$additional_info Additional information to display (default '')
Результат nothing (print a pager)

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

Clean Printing of and array in a table ONLY FOR DEBUG
static public printCleanArray ( $tab, $pad, $jsexpand = false ) : nothing
$tab the array to display
$pad Pad used (default 0)
$jsexpand Expand using JS ? (default false)
Результат nothing

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

Print pager for search option (first/previous/next/last)
static public printPager ( $start, $numrows, $target, $parameters, $item_type_output, $item_type_output_param, $additional_info = '' ) : nothing
$start from witch item we start
$numrows total items
$target page would be open when click on the option (last,previous etc)
$parameters parameters would be passed on the URL.
$item_type_output item type display - if >0 display export PDF et Sylk form (default 0)
$item_type_output_param item type parameter for export (default 0)
$additional_info Additional information to display (default '')
Результат nothing (print a pager)

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

Display the list_limit combo choice
static public printPagerForm ( $action = "" ) : nothing
$action page would be posted when change the value (URL + param) (default '') ajax Pager will be displayed if empty
Результат nothing (print a combo)

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

Manage progresse bars
static public progressBar ( $id, array $options = [] ) : nothing
$id HTML ID of the progress bar
$options array array progress status - create do we have to create it ? - message add or change the message - percent current level
Результат nothing (display)

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

In this function, we redefine 'window.alert' javascript function by a jquery-ui dialog equivalent (but prettier).
static public redefineAlert ( )

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

This dialog is normally asynchronous and can't return a boolean like naive window.confirm. We manage this behavior with a global variable 'confirmed' who watchs the acceptation of dialog. In this case, we trigger a new click on element to return the value (and without display dialog)
static public redefineConfirm ( )

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

Redirection hack
static public redirect ( $dest ) : nothing
$dest string: Redirection destination
Результат nothing

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

Redirection to Login page
static public redirectToLogin ( $params = '' ) : nothing
$params param to add to URL (default '')
Результат nothing

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

Resume a name for display
static public resume_name ( $string, $length = 255 ) : cut
$string string string to resume
$length integer resume length (default 255)
Результат cut string

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

Resume text for followup
static public resume_text ( $string, $length = 255 ) : cut
$string string string to resume
$length integer resume length (default 255)
Результат cut string

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

Returns one or many script tags depending on the number of scripts given.
static public script ( $url ) : String
$url String of javascript file to include
Результат String of script tags

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

Wrap $script in a script tag.
static public scriptBlock ( $script ) : string
$script The script to wrap
Результат string

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

Generates a script tag inline
static public scriptEnd ( ) : mixed
Результат mixed depending on the settings of scriptStart() either a script tag or null

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

Begin a script block that captures output until HtmlHelper::scriptEnd() is called. This capturing block will capture all output between the methods and create a scriptBlock from it.
static public scriptStart ( )

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

См. также: Html::getCheckbox()
static public showCheckbox ( array $options = [] ) : nothing
$options array array
Результат nothing (display only)

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

Display choice matrix
static public showCheckboxMatrix ( array $columns, array $rows, array $options = [] ) : random
$columns array array of column field name => column label
$rows array array of field name => array( 'label' the label of the row 'columns' an array of specific information regaring current row and given column indexed by column field_name * a string if only have to display a string * an array('value' => ???, 'readonly' => ???) that is used to Dropdown::showYesNo()
$options array array possible: 'title' of the matrix 'first_cell' the content of the upper-left cell 'row_check_all' set to true to display a checkbox to check all elements of the row 'col_check_all' set to true to display a checkbox to check all elements of the col 'rand' random number to use for ids
Результат random value used to generate the ids

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

Display Color field
static public showColorField ( $name, $options = [] )
$name name of the element
$options array of possible options: - value : default value to display (default '') - display : boolean display or get string (default true) - rand : specific random value (default generated one)

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

Display Date form with calendar
static public showDateField ( $name, $options = [] ) : rand
$name name of the element
$options array of possible options: - value : default value to display (default '') - maybeempty : may be empty ? (true by default) - canedit : could not modify element (true by default) - min : minimum allowed date (default '') - max : maximum allowed date (default '') - showyear : should we set/diplay the year? (true by default) - display : boolean display of return string (default true) - rand : specific rand value (default generated one) - yearrange : set a year range to show in drop-down (default '')
Результат rand value used if displayes else string

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

Display Date form with calendar
static public showDateFormItem ( $element, $value = '', $maybeempty = true, $can_edit = true, $minDate = '', $maxDate = '', $displayYear = true ) : rand
$element name of the element
$value default value to display (default '')
$maybeempty may be empty ? (true by default)
$can_edit could not modify element (true by default)
$minDate minimum allowed date (default '')
$maxDate maximum allowed date (default '')
$displayYear should we set/diplay the year? (true by default)
Результат rand value used \deprecated since 0.84 used Html::showDateField instead

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

Display DateTime form with calendar
static public showDateTimeField ( $name, $options = [] ) : rand
$name name of the element
$options array of possible options: - value : default value to display (default '') - timestep : step for time in minute (-1 use default config) (default -1) - maybeempty : may be empty ? (true by default) - canedit : could not modify element (true by default) - mindate : minimum allowed date (default '') - maxdate : maximum allowed date (default '') - mintime : minimum allowed time (default '') - maxtime : maximum allowed time (default '') - showyear : should we set/diplay the year? (true by default) - display : boolean display or get string (default true) - rand : specific random value (default generated one)
Результат rand value used if displayes else string

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

Display DateTime form with calendar
static public showDateTimeFormItem ( $element, $value = '', $time_step, $maybeempty = true, $can_edit = true, $minDate = '', $maxDate = '', $minTime = '', $maxTime = '' ) : rand
$element name of the element
$value default value to display (default '')
$time_step step for time in minute (-1 use default config) (default -1)
$maybeempty may be empty ? (true by default)
$can_edit could not modify element (true by default)
$minDate minimum allowed date (default '')
$maxDate maximum allowed date (default '')
$minTime minimum allowed time (default '')
$maxTime maximum allowed time (default '')
Результат rand value used \deprecated since 0.84 used Html::showDateTimeField instead

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

Show generic date search
static public showGenericDateTimeSearch ( $element, $value = '', $options = [] ) : rand
$element name of the html element
$value default value (default '')
$options array of possible options: - with_time display with time selection ? (default false) - with_future display with future date selection ? (default false) - with_days display specific days selection TODAY, BEGINMONTH, LASTMONDAY... ? (default true)
Результат rand value of dropdown

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

Show the massive action checkbox
static public showMassiveActionCheckBox ( $itemtype, $id, array $options = [] ) : show
$itemtype Massive action itemtype
$id ID of the item
$options array array
Результат show checkbox

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

Display massive actions
С версии: 0.84 (before Search::displayMassiveActions)
static public showMassiveActions ( $options = [] ) : nothing
$options array of parameters must contains : - container : DOM ID of the container of the item checkboxes (since version 0.85) may contains : - num_displayed : integer number of displayed items. Permit to check suhosin limit. (default -1 not to check) - ontop : boolean true if displayed on top (default true) - fixed : boolean true if used with fixed table display (default true) - forcecreate : boolean force creation of modal window (default = false). Modal is automatically created when displayed the ontop item. If only a bottom one is displayed use it - check_itemtype : string alternate itemtype to check right if different from main itemtype (default empty) - check_items_id : integer ID of the alternate item used to check right / optional (default empty) - is_deleted : boolean is massive actions for deleted items ? - extraparams : string extra URL parameters to pass to massive actions (default empty) if ([extraparams]['hidden'] is set : add hidden fields to post) - specific_actions : array of specific actions (do not use standard one) - add_actions : array of actions to add (do not use standard one) - confirm : string of confirm message before massive action - item : CommonDBTM object that has to be passed to the actions - tag_to_send : the tag of the elements to send to the ajax window (default: common)
Результат nothing

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

Print the form used to select profile if several are available
static public showProfileSelecter ( $target ) : nothing
$target target of the form
Результат nothing

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

create a minimal form for simple action
static public showSimpleForm ( $action, $btname, $btlabel, array $fields = [], $btimage = '', $btoption = '', $confirm = '' )
$action String URL to call on submit
$btname String button name
$btlabel String button label
$fields array Array field name => field value
$btimage String button image uri (optional) (default '')
$btoption String optional button option (default '')
$confirm String optional confirm message (default '')

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

Show a tooltip on an item
static public showToolTip ( $content, $options = [] ) : nothing
$content string data to put in the tooltip
$options array of possible options: - applyto : string / id of the item to apply tooltip (default empty). If not set display an icon - title : string / title to display (default empty) - contentid : string / id for the content html container (default auto generated) (used for ajax) - link : string / link to put on displayed image if contentid is empty - linkid : string / html id to put to the link link (used for ajax) - linktarget : string / target for the link - popup : string / popup action : link not needed to use it - img : string / url of a specific img to use - display : boolean / display the item : false return the datas - autoclose : boolean / autoclose the item : default true (false permit to scroll)
Результат nothing (print out an HTML div)

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

Print a simple HTML head with links
static public simpleHeader ( $title, $links = [] )
$title title of the page
$links array of links to display

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

Creates a submit button element. This method will generate input elements that can be used to submit, and reset forms by using $options. Image submits can be created by supplying an image option
static public submit ( $caption, $options = [] ) : string
$caption caption of the input
$options Array of options. - image : will use a submit image input - `confirm` JavaScript confirmation message. - `confirmaction` optional action to do on confirmation
Результат string A HTML submit button

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

Make a good string from the unix timestamp $sec
static public timestampToString ( $time, $display_sec = true, $use_days = true ) : string
$time integer timestamp
$display_sec boolean display seconds ? (true by default)
$use_days boolean use days for display ? (true by default)
Результат string