class CustomForm extends Form (View source)

CustomForm class

Properties

object $other

Methods

__construct(DoliDB $db)

Constructor

string
checkBox($name, $value = '', $id = '', $class = '', $checked = false, $disabled = false)

Return a checkbox

string
textInput($name, $value, $size = 8)

Return a text input

string
textArea($name, $value, $rows = '3')

Return a text area

string
textEditor($name, $value, $toolbarname = 'dolibarr_details', $height = 100)

Return a text area with editor (if WYSIWYG editor module is activated)

string
fileInput($name, $accept = '')

Return a file input

string
numberInput($name, $value, $min, $max = 100)

Return a number input

string
rangeInput($name, $value, $min, $max = 100)

Return a range input

string
dateInput($name, $value, $addnowlink = true)

Return a date input

string
datetimeInput($name, $value, $addnowlink = true)

Return a datetime input

string
listInput($name, $values, $selected, $show_empty, $translate = true)

Return a list

string
multiSelectListInput($name, $values, $selected, $translate = true, $width = '100%')

Return a multi select list

string
radioList($name, $values, $selected)

Return a radio list

string
checkList($name, $values, $selected)

Return a check list

string
colorInput($name, $value)

Return a color input

string
productList($name, $value, $show_empty = '1')

Return products list

Details

__construct(DoliDB $db)

Constructor

Parameters

DoliDB $db Database handler

string checkBox($name, $value = '', $id = '', $class = '', $checked = false, $disabled = false)

Return a checkbox

Parameters

$name checkbox name
$value checkbox value
$id checkbox id
$class checkbox class
$checked checkbox is checked or not
$disabled checkbox is disabled or not

Return Value

string checkbox HTML

string textInput($name, $value, $size = 8)

Return a text input

Parameters

$name input name
$value input value
$size input size

Return Value

string input HTML

string textArea($name, $value, $rows = '3')

Return a text area

Parameters

$name text area name
$value text area value
$rows text area rows

Return Value

string text area HTML

string textEditor($name, $value, $toolbarname = 'dolibarr_details', $height = 100)

Return a text area with editor (if WYSIWYG editor module is activated)

Parameters

$name text area name
$value text area value
$toolbarname toolbar name, possible values: 'dolibarr_details', 'dolibarr_readonly', 'dolibarr_notes', 'dolibarr_mailings'
$height text area height

Return Value

string text area HTML

string fileInput($name, $accept = '')

Return a file input

Parameters

$name input name
$accept input accept attribute

Return Value

string input HTML

string numberInput($name, $value, $min, $max = 100)

Return a number input

Parameters

$name input name
$value input value
$min input minimum number
$max input maximum number

Return Value

string input HTML

string rangeInput($name, $value, $min, $max = 100)

Return a range input

Parameters

$name input name
$value input value
$min input minimum value
$max input maximum value

Return Value

string input HTML

string dateInput($name, $value, $addnowlink = true)

Return a date input

Parameters

$name input name
$value input value
$addnowlink add now link

Return Value

string input HTML

string datetimeInput($name, $value, $addnowlink = true)

Return a datetime input

Parameters

$name input name
$value input value
$addnowlink add now link

Return Value

string input HTML

string listInput($name, $values, $selected, $show_empty, $translate = true)

Return a list

Parameters

$name list name
$values list values
$selected list selected value
$show_empty show empty value, 0 no empty value allowed, 1 or string to add an empty value into list (key is -1 and value is '' or ' ' if 1, key is -1 and value is text if string), <0 to add an empty value with key that is this value.
$translate translate values

Return Value

string list HTML

string multiSelectListInput($name, $values, $selected, $translate = true, $width = '100%')

Return a multi select list

Parameters

$name list name
$values list values
$selected list selected value
$translate translate values
$width list width

Return Value

string list HTML

string radioList($name, $values, $selected)

Return a radio list

Parameters

$name list name
$values list values
$selected list selected value

Return Value

string list HTML

string checkList($name, $values, $selected)

Return a check list

Parameters

$name list name
$values list values
$selected list selected value(s)

Return Value

string list HTML

string colorInput($name, $value)

Return a color input

Parameters

$name input name
$value input value

Return Value

string input HTML

string productList($name, $value, $show_empty = '1')

Return products list

Parameters

$name list name
$value list value
$show_empty show empty line or not, '1' if yes '' if no, 'Your text' if you wanna show some text

Return Value

string list HTML