dolibarr  16.0.5
Public Member Functions | Static Public Member Functions | List of all members
FormSetup Class Reference

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

Public Member Functions

 __construct ($db, $outputLangs=false)
 Constructor. More...
 
 generateOutput ($editMode=false)
 generateOutput More...
 
 generateTableOutput ($editMode=false)
 generateTableOutput More...
 
 saveConfFromPost ($noMessageInUpdate=false)
 saveConfFromPost More...
 
 generateLineOutput ($item, $editMode=false)
 generateLineOutput More...
 
 addItemsFromParamsArray ($params)
 Method used to test module builder convertion to this form usage. More...
 
 addItemFromParams ($confKey, $params)
 From old Method was used to test module builder convertion to this form usage. More...
 
 exportItemsAsParamsArray ()
 Used to export param array for /core/actions_setmoduleoptions.inc.php template Method exists only for manage setup convertion. More...
 
 reloadConfs ()
 Reload for each item default conf note: this will override custom configuration. More...
 
 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. More...
 
 sortingItems ()
 Sort items according to rank. More...
 
 getCurentItemMaxRank ($cache=true)
 getCurentItemMaxRank More...
 
 setItemMaxRank ($rank)
 set new max rank if needed More...
 
 getLineRank ($itemKey)
 get item position rank from item key More...
 
 itemSort (FormSetupItem $a, FormSetupItem $b)
 uasort callback function to Sort params items More...
 

Static Public Member Functions

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

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

◆ 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
null

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

◆ 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 401 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 112 of file html.formsetup.class.php.

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

◆ generateOutput()

FormSetup::generateOutput (   $editMode = false)

generateOutput

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

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

◆ generateTableOutput()

FormSetup::generateTableOutput (   $editMode = false)

generateTableOutput

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

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

◆ getCurentItemMaxRank()

FormSetup::getCurentItemMaxRank (   $cache = true)

getCurentItemMaxRank

Parameters
bool$cacheTo use cache or not
Returns
int

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

◆ 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 528 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 544 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 441 of file html.formsetup.class.php.

◆ reloadConfs()

FormSetup::reloadConfs ( )

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

Returns
bool

Definition at line 420 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 245 of file html.formsetup.class.php.

◆ setItemMaxRank()

FormSetup::setItemMaxRank (   $rank)

set new max rank if needed

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

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

◆ sortingItems()

FormSetup::sortingItems ( )

Sort items according to rank.

Returns
bool

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


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