NEW Can set a class on the tr lines of form setup lines

This commit is contained in:
Laurent Destailleur 2024-07-19 12:06:37 +02:00
parent 7fef62e5e0
commit c4f29dca59
2 changed files with 5 additions and 0 deletions

View File

@ -81,11 +81,13 @@ foreach ($arrayofia as $ia => $ialabel) {
$item->nameText = $langs->trans("AI_API_KEY").' ('.$ialabel.')';
$item->defaultFieldValue = '';
$item->fieldParams['hideGenerateButton'] = 1;
$item->fieldParams['trClass'] = $ia;
$item->cssClass = 'minwidth500 text-security';
$item = $formSetup->newItem('AI_API_'.strtoupper($ia).'_URL'); // Name of constant must end with _KEY so it is encrypted when saved into database.
$item->nameText = $langs->trans("AI_API_URL").' ('.$ialabel.')';
$item->defaultFieldValue = '';
$item->fieldParams['trClass'] = $ia;
$item->cssClass = 'minwidth500';
}

View File

@ -322,6 +322,9 @@ class FormSetup
if ($item->getType() == 'title') {
$trClass = 'liste_titre';
}
if (!empty($item->fieldParams['trClass'])) {
$trClass .= ' '.$item->fieldParams['trClass'];
}
$this->setupNotEmpty++;
$out .= '<tr class="'.$trClass.'">';