dolibarr  21.0.0-alpha
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=null)
 Constructor. More...
 
 generateOutput ($editMode=false, $hideTitle=false)
 Generate the form (in read or edit mode depending on $editMode) More...
 
 generateTableOutput ($editMode=false, $hideTitle=false)
 generateTableOutput More...
 
 saveConfFromPost ($noMessageInUpdate=false)
 saveConfFromPost More...
 
 generateLineOutput ($item, $editMode=false)
 generateLineOutput More...
 
 addItemsFromParamsArray ($params)
 Method used to test module builder conversion to this form usage. More...
 
 addItemFromParams ($confKey, $params)
 From old Method was used to test module builder conversion to this form usage. More...
 
 exportItemsAsParamsArray ()
 Used to export param array for /core/actions_setmoduleoptions.inc.php template Method exists only for manage setup conversion. More...
 
 reloadConfs ()
 Reload for each item default conf note: this will override custom configuration. More...
 
 newItem ($confKey, $targetItemKey='', $insertAfterTarget=false)
 Create a new item The target 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 = null 
)

Constructor.

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

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

Member Function Documentation

◆ addItemFromParams()

FormSetup::addItemFromParams (   $confKey,
  $params 
)

From old Method was used to test module builder conversion 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 382 of file html.formsetup.class.php.

◆ addItemsFromParamsArray()

FormSetup::addItemsFromParamsArray (   $params)

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

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

Definition at line 362 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 conversion.

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

Definition at line 424 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 122 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 317 of file html.formsetup.class.php.

◆ generateOutput()

FormSetup::generateOutput (   $editMode = false,
  $hideTitle = false 
)

Generate the form (in read or edit mode depending on $editMode)

Parameters
bool$editModetrue will display output on edit mod
bool$hideTitleTrue to hide the first title line
Returns
string Html output

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

◆ generateTableOutput()

FormSetup::generateTableOutput (   $editMode = false,
  $hideTitle = false 
)

generateTableOutput

Parameters
bool$editModeTrue will display output on edit modECM
bool$hideTitleTrue to hide the first title line
Returns
string Html output

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

◆ getCurentItemMaxRank()

FormSetup::getCurentItemMaxRank (   $cache = true)

getCurentItemMaxRank

Parameters
bool$cacheTo use cache or not
Returns
int

Definition at line 517 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 554 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 570 of file html.formsetup.class.php.

◆ newItem()

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

Create a new item The target 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 465 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 443 of file html.formsetup.class.php.

◆ saveConfFromPost()

FormSetup::saveConfFromPost (   $noMessageInUpdate = false)

saveConfFromPost

Parameters
bool$noMessageInUpdatedisplay event message on errors and success
Returns
int|null Return -1 if KO, 1 if OK, null if no items

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

◆ sortingItems()

FormSetup::sortingItems ( )

Sort items according to rank.

Returns
bool

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


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