dolibarr 18.0.6
FormAdmin Class Reference

Class to generate html code for admin pages. More...

Public Member Functions

 __construct ($db)
 Constructor.
 
 select_language ($selected='', $htmlname='lang_id', $showauto=0, $filter=array(), $showempty='', $showwarning=0, $disabled=0, $morecss='', $showcode=0, $forcecombo=0, $multiselect=0, $onlykeys=array(), $mainlangonly=0)
 Return html select list with available languages (key='en_US', value='United States' for example)
 
 select_menu ($selected, $htmlname, $dirmenuarray, $moreattrib='')
 Return list of available menus (eldy_backoffice, ...)
 
 select_menu_families ($selected, $htmlname, $dirmenuarray)
 Return combo list of available menu families.
 
 select_timezone ($selected, $htmlname)
 Return a HTML select list of timezones.
 
 select_paper_format ($selected='', $htmlname='paperformat_id', $filter=0, $showempty=0, $forcecombo=0)
 Return html select list with available languages (key='en_US', value='United States' for example)
 

Detailed Description

Class to generate html code for admin pages.

Definition at line 30 of file html.formadmin.class.php.

Constructor & Destructor Documentation

◆ __construct()

FormAdmin::__construct ( $db)

Constructor.

Parameters
DoliDB | null$dbDatabase handler

Definition at line 41 of file html.formadmin.class.php.

Member Function Documentation

◆ select_language()

FormAdmin::select_language ( $selected = '',
$htmlname = 'lang_id',
$showauto = 0,
$filter = array(),
$showempty = '',
$showwarning = 0,
$disabled = 0,
$morecss = '',
$showcode = 0,
$forcecombo = 0,
$multiselect = 0,
$onlykeys = array(),
$mainlangonly = 0 )

Return html select list with available languages (key='en_US', value='United States' for example)

Parameters
string | array$selectedLanguage pre-selected. Can be an array if $multiselect is 1.
string$htmlnameName of HTML select
int$showautoShow 'auto' choice
array$filterArray of keys to exclude in list (opposite of $onlykeys)
int | string$showempty'1'=Add empty value or 'string to show'
int$showwarningShow a warning if language is not complete
int$disabledDisable edit of select
string$morecssAdd more css styles
int$showcode1=Add language code into label at begining, 2=Add language code into label at end
int$forcecomboForce to use combo box (so no ajax beautify effect)
int$multiselectMake the combo a multiselect
array$onlykeysArray of language keys to restrict list with the following keys (opposite of $filter). Example array('fr', 'es', ...)
int$mainlangonly1=Show only main languages ('fr_FR' no' fr_BE', 'es_ES' not 'es_MX', ...)
Returns
string Return HTML select string with list of languages

Definition at line 65 of file html.formadmin.class.php.

References ajax_combobox(), dol_escape_htmltag(), getLanguageCodeFromCountryCode(), and picto_from_langcode().

◆ select_menu()

FormAdmin::select_menu ( $selected,
$htmlname,
$dirmenuarray,
$moreattrib = '' )

Return list of available menus (eldy_backoffice, ...)

Parameters
string$selectedPreselected menu value
string$htmlnameName of html select
array$dirmenuarrayArray of directories to scan
string$moreattribMore attributes on html select tag
Returns
integer|null

Definition at line 182 of file html.formadmin.class.php.

References getDolGlobalInt().

◆ select_menu_families()

FormAdmin::select_menu_families ( $selected,
$htmlname,
$dirmenuarray )

Return combo list of available menu families.

Parameters
string$selectedMenu pre-selected
string$htmlnameName of html select
string[]$dirmenuarrayDirectories to scan
Returns
void

Definition at line 287 of file html.formadmin.class.php.

References ajax_combobox(), and getDolGlobalInt().

◆ select_paper_format()

FormAdmin::select_paper_format ( $selected = '',
$htmlname = 'paperformat_id',
$filter = 0,
$showempty = 0,
$forcecombo = 0 )

Return html select list with available languages (key='en_US', value='United States' for example)

Parameters
string$selectedPaper format pre-selected
string$htmlnameName of HTML select field
string$filterValue to filter on code
int$showemptyAdd empty value
int$forcecomboForce to load all values and output a standard combobox (with no beautification)
Returns
string Return HTML output

Definition at line 424 of file html.formadmin.class.php.

References ajax_combobox(), and dol_print_error().

◆ select_timezone()

FormAdmin::select_timezone ( $selected,
$htmlname )

Return a HTML select list of timezones.

Parameters
string$selectedMenu pre-selectionnee
string$htmlnameNom de la zone select
Returns
void

Definition at line 366 of file html.formadmin.class.php.


The documentation for this class was generated from the following file: