dolibarr 20.0.0
ExtraLanguages Class Reference

Class to manage standard extra languages. More...

Public Member Functions

 __construct ($db)
 Constructor.
 
 fetch_name_extralanguages ($elementtype, $forceload=false)
 Load array this->attributes with list of fields per object that need an alternate translation.
 
 showInputField ($key, $value, $extrafieldsobjectkey, $moreparam='', $keysuffix='', $keyprefix='', $morecss='', $objectid=0, $mode=0)
 Return HTML string to put an input field into a page Code very similar with showInputField of common object.
 
 showOutputField ($key, $value, $extrafieldsobjectkey, $moreparam='')
 Return HTML string to put an output field into a page.
 

Detailed Description

Class to manage standard extra languages.

Definition at line 28 of file extralanguages.class.php.

Constructor & Destructor Documentation

◆ __construct()

ExtraLanguages::__construct ( $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 61 of file extralanguages.class.php.

Member Function Documentation

◆ fetch_name_extralanguages()

ExtraLanguages::fetch_name_extralanguages ( $elementtype,
$forceload = false )

Load array this->attributes with list of fields per object that need an alternate translation.

The object and field must be managed with the widgetForTranslation() method. You must set variable MAIN_USE_ALTERNATE_TRANSLATION_FOR=elementA:fieldname,fieldname2;elementB:... Example: MAIN_USE_ALTERNATE_TRANSLATION_FOR=societe:name,town;contact:firstname,lastname

Parameters
string$elementtypeType of element ('' = all, 'adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...).
boolean$forceloadForce load of extra fields whatever is status of cache.
Returns
array Array of attributes keys+label for all extra fields.

Definition at line 81 of file extralanguages.class.php.

References getDolGlobalString().

◆ showInputField()

ExtraLanguages::showInputField ( $key,
$value,
$extrafieldsobjectkey,
$moreparam = '',
$keysuffix = '',
$keyprefix = '',
$morecss = '',
$objectid = 0,
$mode = 0 )

Return HTML string to put an input field into a page Code very similar with showInputField of common object.

Parameters
string$keyKey of attribute
string$valuePreselected value to show (for date type it must be in timestamp format, for amount or price it must be a php numeric value)
string$extrafieldsobjectkeyIf defined (for example $object->table_element), use the new method to get extrafields data
string$moreparamTo add more parameters on html input tag
string$keysuffixPrefix string to add after name and id of field (can be used to avoid duplicate names)
string$keyprefixSuffix string to add before name and id of field (can be used to avoid duplicate names)
string$morecssMore css (to defined size of field. Old behaviour: may also be a numeric)
int$objectidCurrent object id
int$mode1=Used for search filters
Returns
string

Definition at line 140 of file extralanguages.class.php.

◆ showOutputField()

ExtraLanguages::showOutputField ( $key,
$value,
$extrafieldsobjectkey,
$moreparam = '' )

Return HTML string to put an output field into a page.

Parameters
string$keyKey of attribute
string$valueValue to show
string$extrafieldsobjectkeyIf defined (for example $object->table_element), function uses the new method to get extrafields data
string$moreparamTo add more parameters on html input tag (only checkbox use html input for output rendering)
Returns
string Formatted value

Definition at line 168 of file extralanguages.class.php.


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