dolibarr  18.0.6
Public Member Functions | List of all members
FormSetupItem Class Reference

This class help to create item for class formSetup. More...

Public Member Functions

 __construct ($confKey)
 Constructor. More...
 
 loadValueFromConf ()
 load conf value from databases More...
 
 reloadValueFromConf ()
 reload conf value from databases is an aliase of loadValueFromConf More...
 
 saveConfValue ()
 Save const value based on htdocs/core/actions_setmoduleoptions.inc.php. More...
 
 setSaveCallBack (callable $callBack)
 Set an override function for saving data. More...
 
 setValueFromPostCallBack (callable $callBack)
 Set an override function for get data from post. More...
 
 setValueFromPost ()
 Save const value based on htdocs/core/actions_setmoduleoptions.inc.php. More...
 
 getHelpText ()
 Get help text or generate it. More...
 
 getNameText ()
 Get field name text or generate it. More...
 
 generateInputField ()
 generate input field More...
 
 generateInputFieldText ()
 generatec default input field More...
 
 generateInputFieldTextarea ()
 generate input field for textarea More...
 
 generateInputFieldHtml ()
 generate input field for html More...
 
 generateInputFieldCategories ()
 generate input field for categories More...
 
 generateInputFieldEmailTemplate ()
 generate input field for email template selector More...
 
 generateInputFieldSecureKey ()
 generate input field for secure key More...
 
 generateInputFieldMultiSelect ()
 
 generateInputFieldSelect ()
 
 generateInputFieldSelectUser ()
 
 getType ()
 get the type : used for old module builder setup conf style conversion and tests because this two class will quickly evolve it's important to not set or get directly $this->type (will be protected) so this method exist to be sure we can manage evolution easily More...
 
 setTypeFromTypeString ($type)
 set the type from string : used for old module builder setup conf style conversion and tests because this two class will quickly evolve it's important to not set directly $this->type (will be protected) so this method exist to be sure we can manage evolution easily More...
 
 setErrors ($errors)
 Add error. More...
 
 generateOutputField ()
 generateOutputField More...
 
 generateOutputFieldMultiSelect ()
 generateOutputFieldMultiSelect More...
 
 generateOutputFieldColor ()
 generateOutputFieldColor More...
 
 generateInputFieldColor ()
 generateInputFieldColor More...
 
 generateOutputFieldSelect ()
 generateOutputFieldSelect More...
 
 generateOutputFieldSelectUser ()
 generateOutputFieldSelectUser More...
 
 setAsString ()
 Set type of input as string. More...
 
 setAsColor ()
 Set type of input as color. More...
 
 setAsTextarea ()
 Set type of input as textarea. More...
 
 setAsHtml ()
 Set type of input as html editor. More...
 
 setAsEmailTemplate ($templateType)
 Set type of input as emailtemplate selector. More...
 
 setAsThirdpartyType ()
 Set type of input as thirdparty_type selector. More...
 
 setAsYesNo ()
 Set type of input as Yes. More...
 
 setAsSecureKey ()
 Set type of input as secure key. More...
 
 setAsProduct ()
 Set type of input as product. More...
 
 setAsCategory ($catType)
 Set type of input as a category selector TODO add default value. More...
 
 setAsTitle ()
 Set type of input as a simple title. More...
 
 setAsMultiSelect ($fieldOptions)
 Set type of input as a simple title. More...
 
 setAsSelect ($fieldOptions)
 Set type of input as a simple title. More...
 
 setAsSelectUser ()
 Set type of input as a simple title. More...
 

Detailed Description

This class help to create item for class formSetup.

Definition at line 573 of file html.formsetup.class.php.

Constructor & Destructor Documentation

◆ __construct()

FormSetupItem::__construct (   $confKey)

Constructor.

Parameters
string$confKeythe conf key used in database

Definition at line 650 of file html.formsetup.class.php.

Member Function Documentation

◆ generateInputField()

FormSetupItem::generateInputField ( )

generate input field

Returns
bool|string

Definition at line 818 of file html.formsetup.class.php.

◆ generateInputFieldCategories()

FormSetupItem::generateInputFieldCategories ( )

generate input field for categories

Returns
string

Definition at line 922 of file html.formsetup.class.php.

◆ generateInputFieldColor()

FormSetupItem::generateInputFieldColor ( )

generateInputFieldColor

Returns
string

Definition at line 1199 of file html.formsetup.class.php.

◆ generateInputFieldEmailTemplate()

FormSetupItem::generateInputFieldEmailTemplate ( )

generate input field for email template selector

Returns
string

Definition at line 939 of file html.formsetup.class.php.

◆ generateInputFieldHtml()

FormSetupItem::generateInputFieldHtml ( )

generate input field for html

Returns
string

Definition at line 910 of file html.formsetup.class.php.

◆ generateInputFieldMultiSelect()

FormSetupItem::generateInputFieldMultiSelect ( )
Returns
string

Definition at line 990 of file html.formsetup.class.php.

◆ generateInputFieldSecureKey()

FormSetupItem::generateInputFieldSecureKey ( )

generate input field for secure key

Returns
string

Definition at line 971 of file html.formsetup.class.php.

◆ generateInputFieldSelect()

FormSetupItem::generateInputFieldSelect ( )
Returns
string

Definition at line 1004 of file html.formsetup.class.php.

◆ generateInputFieldSelectUser()

FormSetupItem::generateInputFieldSelectUser ( )
Returns
string

Definition at line 1012 of file html.formsetup.class.php.

◆ generateInputFieldText()

FormSetupItem::generateInputFieldText ( )

generatec default input field

Returns
string

Definition at line 888 of file html.formsetup.class.php.

◆ generateInputFieldTextarea()

FormSetupItem::generateInputFieldTextarea ( )

generate input field for textarea

Returns
string

Definition at line 898 of file html.formsetup.class.php.

◆ generateOutputField()

FormSetupItem::generateOutputField ( )

generateOutputField

Returns
bool|string Generate the output html for this item

Definition at line 1069 of file html.formsetup.class.php.

◆ generateOutputFieldColor()

FormSetupItem::generateOutputFieldColor ( )

generateOutputFieldColor

Returns
string

Definition at line 1189 of file html.formsetup.class.php.

◆ generateOutputFieldMultiSelect()

FormSetupItem::generateOutputFieldMultiSelect ( )

generateOutputFieldMultiSelect

Returns
string

Definition at line 1166 of file html.formsetup.class.php.

◆ generateOutputFieldSelect()

FormSetupItem::generateOutputFieldSelect ( )

generateOutputFieldSelect

Returns
string

Definition at line 1210 of file html.formsetup.class.php.

◆ generateOutputFieldSelectUser()

FormSetupItem::generateOutputFieldSelectUser ( )

generateOutputFieldSelectUser

Returns
string

Definition at line 1225 of file html.formsetup.class.php.

◆ getHelpText()

FormSetupItem::getHelpText ( )

Get help text or generate it.

Returns
int|string

Definition at line 798 of file html.formsetup.class.php.

◆ getNameText()

FormSetupItem::getNameText ( )

Get field name text or generate it.

Returns
false|int|string

Definition at line 808 of file html.formsetup.class.php.

◆ getType()

FormSetupItem::getType ( )

get the type : used for old module builder setup conf style conversion and tests because this two class will quickly evolve it's important to not set or get directly $this->type (will be protected) so this method exist to be sure we can manage evolution easily

Returns
string

Definition at line 1024 of file html.formsetup.class.php.

◆ loadValueFromConf()

FormSetupItem::loadValueFromConf ( )

load conf value from databases

Returns
bool

Definition at line 672 of file html.formsetup.class.php.

◆ reloadValueFromConf()

FormSetupItem::reloadValueFromConf ( )

reload conf value from databases is an aliase of loadValueFromConf

Deprecated:
Returns
bool

Definition at line 689 of file html.formsetup.class.php.

◆ saveConfValue()

FormSetupItem::saveConfValue ( )

Save const value based on htdocs/core/actions_setmoduleoptions.inc.php.

Returns
int -1 if KO, 1 if OK

Definition at line 700 of file html.formsetup.class.php.

◆ setAsCategory()

FormSetupItem::setAsCategory (   $catType)

Set type of input as a category selector TODO add default value.

Parameters
int$catTypeType of category ('customer', 'supplier', 'contact', 'product', 'member'). Old mode (0, 1, 2, ...) is deprecated.
Returns
self

Definition at line 1345 of file html.formsetup.class.php.

References type.

◆ setAsColor()

FormSetupItem::setAsColor ( )

Set type of input as color.

Returns
self

Definition at line 1254 of file html.formsetup.class.php.

References type.

◆ setAsEmailTemplate()

FormSetupItem::setAsEmailTemplate (   $templateType)

Set type of input as emailtemplate selector.

Parameters
string$templateTypeemail template type
Returns
self

Definition at line 1288 of file html.formsetup.class.php.

References type.

◆ setAsHtml()

FormSetupItem::setAsHtml ( )

Set type of input as html editor.

Returns
self

Definition at line 1276 of file html.formsetup.class.php.

References type.

◆ setAsMultiSelect()

FormSetupItem::setAsMultiSelect (   $fieldOptions)

Set type of input as a simple title.

No data to store

Parameters
array$fieldOptionsA table of field options
Returns
self

Definition at line 1369 of file html.formsetup.class.php.

References type.

◆ setAsProduct()

FormSetupItem::setAsProduct ( )

Set type of input as product.

Returns
self

Definition at line 1332 of file html.formsetup.class.php.

References type.

◆ setAsSecureKey()

FormSetupItem::setAsSecureKey ( )

Set type of input as secure key.

Returns
self

Definition at line 1321 of file html.formsetup.class.php.

References type.

◆ setAsSelect()

FormSetupItem::setAsSelect (   $fieldOptions)

Set type of input as a simple title.

No data to store

Parameters
array$fieldOptionsA table of field options
Returns
self

Definition at line 1385 of file html.formsetup.class.php.

References type.

◆ setAsSelectUser()

FormSetupItem::setAsSelectUser ( )

Set type of input as a simple title.

No data to store

Returns
self

Definition at line 1400 of file html.formsetup.class.php.

References type.

◆ setAsString()

FormSetupItem::setAsString ( )

Set type of input as string.

Returns
self

Definition at line 1243 of file html.formsetup.class.php.

References type.

◆ setAsTextarea()

FormSetupItem::setAsTextarea ( )

Set type of input as textarea.

Returns
self

Definition at line 1265 of file html.formsetup.class.php.

References type.

◆ setAsThirdpartyType()

FormSetupItem::setAsThirdpartyType ( )

Set type of input as thirdparty_type selector.

Returns
self

Definition at line 1299 of file html.formsetup.class.php.

References type.

◆ setAsTitle()

FormSetupItem::setAsTitle ( )

Set type of input as a simple title.

No data to store

Returns
self

Definition at line 1356 of file html.formsetup.class.php.

References type.

◆ setAsYesNo()

FormSetupItem::setAsYesNo ( )

Set type of input as Yes.

Returns
self

Definition at line 1310 of file html.formsetup.class.php.

References type.

◆ setErrors()

FormSetupItem::setErrors (   $errors)

Add error.

Parameters
array | string$errorsthe error text
Returns
null

Definition at line 1051 of file html.formsetup.class.php.

◆ setSaveCallBack()

FormSetupItem::setSaveCallBack ( callable  $callBack)

Set an override function for saving data.

Parameters
callable$callBacka callable function
Returns
void

Definition at line 739 of file html.formsetup.class.php.

◆ setTypeFromTypeString()

FormSetupItem::setTypeFromTypeString (   $type)

set the type from string : used for old module builder setup conf style conversion and tests because this two class will quickly evolve it's important to not set directly $this->type (will be protected) so this method exist to be sure we can manage evolution easily

Parameters
string$typepossible values based on old module builder setup : 'string', 'textarea', 'category:'.Categorie::TYPE_CUSTOMER', 'emailtemplate', 'thirdparty_type'
Deprecated:
yes this setTypeFromTypeString came deprecated because it exists only for manage setup convertion
Returns
bool

Definition at line 1038 of file html.formsetup.class.php.

◆ setValueFromPost()

FormSetupItem::setValueFromPost ( )

Save const value based on htdocs/core/actions_setmoduleoptions.inc.php.

Returns
int -1 if KO, 0 nothing to do , 1 if OK

Definition at line 758 of file html.formsetup.class.php.

References GETPOST(), and type.

◆ setValueFromPostCallBack()

FormSetupItem::setValueFromPostCallBack ( callable  $callBack)

Set an override function for get data from post.

Parameters
callable$callBacka callable function
Returns
void

Definition at line 749 of file html.formsetup.class.php.


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