#370 Add Description as parameter to XoopsFormElement constructor

XOOPS_2.6
open
MusS
Core (214)
5
2012-09-25
2012-04-01
Michael Beck
No

Currently, in order to add Description to form element we have to use three lines:
$lang_code = new XoopsFormText(_AM_XLANG_CODE, 'lang_charset', 50, 255, $lang_code);
$lang_code->setDescription(_AM_XLANG_CODE_DESC);
$sform->addElement($lang_code, true);

instead of taking advantage of:

$sform->addElement(new XoopsFormText(_AM_XLANG_CODE, 'lang_code', 50, 255, $lang_code), true);

we should be able to expand it by adding _AM_XLANG_CODE_DESC to the constructor as follow:

$sform->addElement(new XoopsFormText(_AM_XLANG_CODE, _AM_XLANG_CODE_DESC, 'lang_code', 50, 255, $lang_code), true);

Discussion