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 32 of file html.formadmin.class.php.

Constructor & Destructor Documentation

◆ __construct()

FormAdmin::__construct ( $db)

Constructor.

Parameters
DoliDB | null$dbDatabase handler

Definition at line 50 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 | string[]$selectedLanguage pre-selected. Can be an array if $multiselect is 1.
string$htmlnameName of HTML select
int<0,1>$showauto Show 'auto' choice
string[]$filterArray of keys to exclude in list (opposite of $onlykeys)
int<1,1>|string$showempty '1'=Add empty value or 'string to show'
int<0,1>$showwarning Show a warning if language is not complete
int<0,1>$disabled Disable edit of select
string$morecssAdd more css styles
int<0,2>$showcode 1=Add language code into label at beginning, 2=Add language code into label at end
int<0,1>$forcecombo Force to use combo box (so no ajax beautify effect)
int<0,1>$multiselect Make the combo a multiselect
string[]$onlykeysArray of language keys to restrict list with the following keys (opposite of $filter). Example array('fr', 'es', ...)
int<0,1>$mainlangonly 1=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 74 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
string[]$dirmenuarrayArray of directories to scan
string$moreattribMore attributes on html select tag
Returns
integer|void

Definition at line 191 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 311 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 444 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 388 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<string,string[]>$typewecanchangeinto Array 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 512 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: