dolibarr 18.0.6
FormSetup Class Reference

This class help you create setup render. More...

Public Member Functions

 __construct ($db, $outputLangs=false)
 Constructor.
 
 generateOutput ($editMode=false)
 generateOutput
 
 generateTableOutput ($editMode=false)
 generateTableOutput
 
 saveConfFromPost ($noMessageInUpdate=false)
 saveConfFromPost
 
 generateLineOutput ($item, $editMode=false)
 generateLineOutput
 
 addItemsFromParamsArray ($params)
 Method used to test module builder convertion to this form usage.
 
 addItemFromParams ($confKey, $params)
 From old Method was used to test module builder convertion to this form usage.
 
 exportItemsAsParamsArray ()
 Used to export param array for /core/actions_setmoduleoptions.inc.php template Method exists only for manage setup convertion.
 
 reloadConfs ()
 Reload for each item default conf note: this will override custom configuration.
 
 newItem ($confKey, $targetItemKey=false, $insertAfterTarget=false)
 Create a new item the tagret is useful with hooks : that allow externals modules to add setup items on good place.
 
 sortingItems ()
 Sort items according to rank.
 
 getCurentItemMaxRank ($cache=true)
 getCurentItemMaxRank
 
 setItemMaxRank ($rank)
 set new max rank if needed
 
 getLineRank ($itemKey)
 get item position rank from item key
 
 itemSort (FormSetupItem $a, FormSetupItem $b)
 uasort callback function to Sort params items
 

Static Public Member Functions

static generateAttributesStringFromArray ($attributes)
 Generate an attributes string form an input array.
 

Detailed Description

This class help you create setup render.

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

Constructor & Destructor Documentation

◆ __construct()

FormSetup::__construct ( $db,
$outputLangs = false )

Constructor.

Parameters
DoliDB$dbDatabase handler
Translate$outputLangsif needed can use another lang

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

Member Function Documentation

◆ addItemFromParams()

FormSetup::addItemFromParams ( $confKey,
$params )

From old Method was used to test module builder convertion to this form usage.

Parameters
string$confKeythe conf name to store
array$paramsan array of params from old modulBuilder params
Returns
bool

@scrutinizer ignore-deprecated

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

Referenced by addItemsFromParamsArray().

◆ addItemsFromParamsArray()

FormSetup::addItemsFromParamsArray ( $params)

Method used to test module builder convertion to this form usage.

Parameters
array$paramsan array of arrays of params from old modulBuilder params
Returns
boolean

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

References addItemFromParams().

◆ exportItemsAsParamsArray()

FormSetup::exportItemsAsParamsArray ( )

Used to export param array for /core/actions_setmoduleoptions.inc.php template Method exists only for manage setup convertion.

Returns
array $arrayofparameters for /core/actions_setmoduleoptions.inc.php

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

◆ generateAttributesStringFromArray()

static FormSetup::generateAttributesStringFromArray ( $attributes)
static

Generate an attributes string form an input array.

Parameters
array$attributesan array of attributes keys and values,
Returns
string attribute string

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

References dol_escape_htmltag().

Referenced by generateOutput().

◆ generateLineOutput()

FormSetup::generateLineOutput ( $item,
$editMode = false )

generateLineOutput

Parameters
FormSetupItem$itemthe setup item
bool$editModeDisplay as edit mod
Returns
string the html output for an setup item

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

References setEventMessages().

Referenced by generateTableOutput().

◆ generateOutput()

FormSetup::generateOutput ( $editMode = false)

generateOutput

Parameters
bool$editModetrue will display output on edit mod
Returns
string html output

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

References dol_escape_htmltag(), generateAttributesStringFromArray(), generateTableOutput(), and setEventMessages().

◆ generateTableOutput()

FormSetup::generateTableOutput ( $editMode = false)

generateTableOutput

Parameters
bool$editModetrue will display output on edit mod
Returns
string html output

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

References generateLineOutput(), setEventMessages(), and sortingItems().

Referenced by generateOutput().

◆ getCurentItemMaxRank()

FormSetup::getCurentItemMaxRank ( $cache = true)

getCurentItemMaxRank

Parameters
bool$cacheTo use cache or not
Returns
int

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

Referenced by newItem().

◆ getLineRank()

FormSetup::getLineRank ( $itemKey)

get item position rank from item key

Parameters
string$itemKeythe item key
Returns
int rank on success and -1 on error

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

◆ itemSort()

FormSetup::itemSort ( FormSetupItem $a,
FormSetupItem $b )

uasort callback function to Sort params items

Parameters
FormSetupItem$aformSetup item
FormSetupItem$bformSetup item
Returns
int Return compare result

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

◆ newItem()

FormSetup::newItem ( $confKey,
$targetItemKey = false,
$insertAfterTarget = false )

Create a new item the tagret is useful with hooks : that allow externals modules to add setup items on good place.

Parameters
string$confKeythe conf key used in database
string$targetItemKeytarget item used to place the new item beside
bool$insertAfterTargetinsert before or after target item ?
Returns
FormSetupItem the new setup item created

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

References getCurentItemMaxRank(), and setItemMaxRank().

◆ reloadConfs()

FormSetup::reloadConfs ( )

Reload for each item default conf note: this will override custom configuration.

Returns
bool

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

◆ saveConfFromPost()

FormSetup::saveConfFromPost ( $noMessageInUpdate = false)

saveConfFromPost

Parameters
bool$noMessageInUpdatedisplay event message on errors and success
Returns
int -1 if KO, 1 if OK

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

References setEventMessages().

◆ setItemMaxRank()

FormSetup::setItemMaxRank ( $rank)

set new max rank if needed

Parameters
int$rankthe item rank
Returns
int|void new max rank

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

Referenced by newItem().

◆ sortingItems()

FormSetup::sortingItems ( )

Sort items according to rank.

Returns
bool

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

Referenced by generateTableOutput().


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