Update setup.php
This commit is contained in:
parent
12b046cb68
commit
83cb6b6753
@ -78,39 +78,40 @@ $scandir = GETPOST('scan_dir', 'alpha');
|
|||||||
$type = 'myobject';
|
$type = 'myobject';
|
||||||
|
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php';
|
if ((float) DOL_VERSION >= 15) {
|
||||||
$formSetup = new FormSetup($db);
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php';
|
||||||
|
$formSetup = new FormSetup($db);
|
||||||
|
|
||||||
|
|
||||||
// Hôte
|
// Hôte
|
||||||
$item = $formSetup->newItem('NO_PARAM_JUST_TEXT');
|
$item = $formSetup->newItem('NO_PARAM_JUST_TEXT');
|
||||||
$item->fieldOverride = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'];
|
$item->fieldOverride = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'];
|
||||||
$item->cssClass = 'minwidth500';
|
$item->cssClass = 'minwidth500';
|
||||||
|
|
||||||
|
|
||||||
// Setup conf MYMODULE_MYPARAM1 as a simple string input
|
// Setup conf MYMODULE_MYPARAM1 as a simple string input
|
||||||
$item = $formSetup->newItem('MYMODULE_MYPARAM1');
|
$item = $formSetup->newItem('MYMODULE_MYPARAM1');
|
||||||
|
|
||||||
// Setup conf MYMODULE_MYPARAM1 as a simple textarea input but we replace the text of field title
|
// Setup conf MYMODULE_MYPARAM1 as a simple textarea input but we replace the text of field title
|
||||||
$item = $formSetup->newItem('MYMODULE_MYPARAM2');
|
$item = $formSetup->newItem('MYMODULE_MYPARAM2');
|
||||||
$item->nameText = $item->getNameText().' more html text ';
|
$item->nameText = $item->getNameText().' more html text ';
|
||||||
|
|
||||||
// Setup conf MYMODULE_MYPARAM3
|
// Setup conf MYMODULE_MYPARAM3
|
||||||
$item = $formSetup->newItem('MYMODULE_MYPARAM3');
|
$item = $formSetup->newItem('MYMODULE_MYPARAM3');
|
||||||
$item->setAsThirdpartyType();
|
$item->setAsThirdpartyType();
|
||||||
|
|
||||||
// Setup conf MYMODULE_MYPARAM4 : exemple of quick define write style
|
// Setup conf MYMODULE_MYPARAM4 : exemple of quick define write style
|
||||||
$formSetup->newItem('MYMODULE_MYPARAM4')->setAsYesNo();
|
$formSetup->newItem('MYMODULE_MYPARAM4')->setAsYesNo();
|
||||||
|
|
||||||
// Setup conf MYMODULE_MYPARAM5
|
// Setup conf MYMODULE_MYPARAM5
|
||||||
$formSetup->newItem('MYMODULE_MYPARAM5')->setAsEmailTemplate('thirdparty');
|
$formSetup->newItem('MYMODULE_MYPARAM5')->setAsEmailTemplate('thirdparty');
|
||||||
|
|
||||||
// Setup conf MYMODULE_MYPARAM6
|
// Setup conf MYMODULE_MYPARAM6
|
||||||
$formSetup->newItem('MYMODULE_MYPARAM6')->setAsSecureKey()->enabled = 0; // disabled
|
$formSetup->newItem('MYMODULE_MYPARAM6')->setAsSecureKey()->enabled = 0; // disabled
|
||||||
|
|
||||||
// Setup conf MYMODULE_MYPARAM7
|
|
||||||
$formSetup->newItem('MYMODULE_MYPARAM7')->setAsProduct();
|
|
||||||
|
|
||||||
|
// Setup conf MYMODULE_MYPARAM7
|
||||||
|
$formSetup->newItem('MYMODULE_MYPARAM7')->setAsProduct();
|
||||||
|
}
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
$setupnotempty = 0;
|
$setupnotempty = 0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user