dolibarr  16.0.1
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 ()
 
 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 ()
 
 generateOutputFieldMultiSelect ()
 
 generateOutputFieldColor ()
 
 generateInputFieldColor ()
 
 generateOutputFieldSelect ()
 
 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 no data to store. More...
 
 setAsMultiSelect ($fieldOptions)
 Set type of input as a simple title no data to store. More...
 
 setAsSelect ($fieldOptions)
 Set type of input as a simple title no data to store. More...
 

Detailed Description

This class help to create item for class formSetup.

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

Constructor & Destructor Documentation

FormSetupItem::__construct (   $confKey)

Constructor.

Parameters
string$confKeythe conf key used in database

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

References db, and loadValueFromConf().

Member Function Documentation

FormSetupItem::generateInputField ( )

generate input field

Returns
bool|string

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

References db, and type.

FormSetupItem::generateInputFieldCategories ( )

generate input field for categories

Returns
string

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

References db, img_picto(), and type.

FormSetupItem::generateInputFieldColor ( )
Returns
string

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

FormSetupItem::generateInputFieldEmailTemplate ( )

generate input field for email template selector

Returns
string

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

References db, and type.

FormSetupItem::generateInputFieldHtml ( )

generate input field for html

Returns
string

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

FormSetupItem::generateInputFieldMultiSelect ( )
Returns
string

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

FormSetupItem::generateInputFieldSecureKey ( )

generate input field for secure key

Returns
string

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

References GETPOST().

FormSetupItem::generateInputFieldSelect ( )
Returns
string

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

FormSetupItem::generateInputFieldText ( )

generatec default input field

Returns
string

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

FormSetupItem::generateInputFieldTextarea ( )

generate input field for textarea

Returns
string

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

References dol_htmlentities().

FormSetupItem::generateOutputField ( )
Returns
bool|string Generate the output html for this item

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

References ajax_constantonoff(), db, dol_nl2br(), and type.

FormSetupItem::generateOutputFieldColor ( )
Returns
string

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

FormSetupItem::generateOutputFieldMultiSelect ( )
Returns
string

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

References dolGetBadge().

FormSetupItem::generateOutputFieldSelect ( )
Returns
string

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

FormSetupItem::getHelpText ( )

Get help text or generate it.

Returns
int|string

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

FormSetupItem::getNameText ( )

Get field name text or generate it.

Returns
false|int|string

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

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 1003 of file html.formsetup.class.php.

FormSetupItem::loadValueFromConf ( )

load conf value from databases

Returns
bool

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

Referenced by __construct().

FormSetupItem::reloadValueFromConf ( )

reload conf value from databases is an aliase of loadValueFromConf

Deprecated:
Returns
bool

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

FormSetupItem::saveConfValue ( )

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

Returns
int -1 if KO, 1 if OK

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

References db, dolibarr_set_const(), and type.

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 1273 of file html.formsetup.class.php.

References type.

FormSetupItem::setAsColor ( )

Set type of input as color.

Returns
self

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

References type.

FormSetupItem::setAsEmailTemplate (   $templateType)

Set type of input as emailtemplate selector.

Parameters
string$templateTypeemail template type
Returns
self

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

References type.

FormSetupItem::setAsHtml ( )

Set type of input as html editor.

Returns
self

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

References type.

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 1297 of file html.formsetup.class.php.

References type.

FormSetupItem::setAsProduct ( )

Set type of input as product.

Returns
self

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

References type.

FormSetupItem::setAsSecureKey ( )

Set type of input as secure key.

Returns
self

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

References type.

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 1313 of file html.formsetup.class.php.

References type.

FormSetupItem::setAsString ( )

Set type of input as string.

Returns
self

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

References type.

FormSetupItem::setAsTextarea ( )

Set type of input as textarea.

Returns
self

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

References type.

FormSetupItem::setAsThirdpartyType ( )

Set type of input as thirdparty_type selector.

Returns
self

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

References type.

FormSetupItem::setAsTitle ( )

Set type of input as a simple title no data to store.

Returns
self

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

References type.

FormSetupItem::setAsYesNo ( )

Set type of input as Yes.

Returns
self

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

References type.

FormSetupItem::setErrors (   $errors)

Add error.

Parameters
array | string$errorsthe error text
Returns
null

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

FormSetupItem::setSaveCallBack ( callable  $callBack)

Set an override function for saving data.

Parameters
callable$callBacka callable function
Returns
void

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

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 1016 of file html.formsetup.class.php.

References type.

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 743 of file html.formsetup.class.php.

References GETPOST(), and type.

FormSetupItem::setValueFromPostCallBack ( callable  $callBack)

Set an override function for get data from post.

Parameters
callable$callBacka callable function
Returns
void

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


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