dolibarr 21.0.0-alpha
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='', $showempty=0, $forcecombo=0)
 Return html select list with available languages (key='en_US', value='United States' for example)
 
 selectTypeOfFields ($htmlname, $type, $typewecanchangeinto=array())
 Function to show the combo select to chose a type of field (varchar, int, email, ...)
 

Detailed Description

Class to generate html code for admin pages.

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

Constructor & Destructor Documentation

◆ __construct()

FormAdmin::__construct ( $db)

Constructor.

Parameters
DoliDB | null$dbDatabase handler

Definition at line 49 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 beginning, 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 73 of file html.formadmin.class.php.

References ajax_combobox(), dol_escape_htmltag(), getDolGlobalString(), 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|void

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

References ajax_combobox(), dol_escape_htmltag(), and 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 307 of file html.formadmin.class.php.

References ajax_combobox(), and getDolGlobalInt().

◆ select_paper_format()

FormAdmin::select_paper_format ( $selected = '',
$htmlname = 'paperformat_id',
$filter = '',
$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 440 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 384 of file html.formadmin.class.php.

◆ selectTypeOfFields()

FormAdmin::selectTypeOfFields ( $htmlname,
$type,
$typewecanchangeinto = array() )

Function to show the combo select to chose a type of field (varchar, int, email, ...)

Parameters
string$htmlnameName of HTML select component
string$typeType preselected
array$typewecanchangeintoArray of possible switch combination from 1 type to another one. This will grey not possible combinations.
Returns
string The combo HTML select component

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

References ajax_combobox(), dol_escape_htmltag(), and getPictoForType().


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