ExtraLanguages
class ExtraLanguages (View source)
Class to manage standard extra languages
Properties
| DoliDB | $db | ||
| array<string, array<string, string>> | $attributes | ||
| string | $error | ||
| string[] | $errors | ||
| string | $errno |
Methods
Constructor
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.
Return HTML string to put an input field into a page Code very similar with showInputField of common object
Return HTML string to put an output field into a page
Details
__construct($db)
Constructor
@param DoliDB $db Database handler
fetch_name_extralanguages(string $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
string
showInputField(string $key, string $value, string $extrafieldsobjectkey, string $moreparam = '', string $keysuffix = '', string $keyprefix = '', string $morecss = '', int $objectid = 0, int $mode = 0)
Return HTML string to put an input field into a page Code very similar with showInputField of common object
string
showOutputField(string $key, string $value, string $extrafieldsobjectkey, string $moreparam = '')
Return HTML string to put an output field into a page