[TYPO3-project-formidable] Renderonly CHECKSINGLE renderlet
Manuel Rego Casasnovas
mrego at igalia.com
Mon May 21 10:44:22 CEST 2007
Hello.
I've been more changes in the class tx_rdtchecksingle.
I've added two new functions, and now I can internationalize the labes
in the renderlet CHECKSINGLE.
The source code is the next:
-------
function _getCheckedLabel() {
$mCheckedLabel = $this->oForm->_navConf("/labels/checked/",
$this->aElement);
return ($mCheckedLabel) ?
$this->oForm->_getLLLabel($mCheckedLabel) : "Y";
}
function _getNonCheckedLabel() {
$mNonCheckedLabel = $this->oForm->_navConf("/labels/nonchecked/",
$this->aElement);
return ($mNonCheckedLabel) ?
$this->oForm->_getLLLabel($mNonCheckedLabel) : "N";
}
function _getHumanReadableValue($data) {
if ($data) {
return $this->_getCheckedLabel();
}
return $this->_getNonCheckedLabel();
}
-------
An example of a XML file:
-------
<renderlet:CHECKSINGLE name="test"
label="LLL:EXT:my_extlocallang.xml:test">
<labels>
<checked>LLL:EXT:my_extlocallang.xml:test.checked</checked>
<nonchecked>LLL:EXT:my_extlocallang.xml:test.nonchecked</nonchecked>
</labels>
<readonly>true</readonly>
</renderlet:CHECKSINGLE>
-------
Jerome if you think that this is a good solution, I'm very grateful to
you if you add this new feature to the FORMidable source code.
Best regards,
Rego
--
http://www.igalia.com
El lun, 21-05-2007 a las 09:50 +0200, Manuel Rego Casasnovas escribió:
> Hi.
>
> I've changed the line 79 in the file
> api/base/rdt_checksingle/api/class.tx_rdtchecksingle.php.
>
> I've changed the condition:
> if($data == $this->_getValue())
> For this new conditon:
> if($data)
>
> The first condition returns always true, the new condition returns true
> when the value is "1" and false when is "0".
> This is the expected behaviour for this condition but I don't know if
> this solution is correct.
>
> I'm going to try use the locallang file to translate this values.
>
> Bye,
> Rego
>
> --
> http://www.igalia.com
>
>
> El mar, 15-05-2007 a las 19:33 +0200, Manuel Rego Casasnovas escribió:
> > Hello.
> >
> > I've been using the CHECKSINGLE renderlet, and I've used the renderonly
> > option.
> >
> > The problem is that the result is always the same a "Y".
> > My label Y
> >
> > If the CHECKSINGLE has been checked this is the result expected.
> > However if it hasn't been checked the result expected would be "N".
> >
> >
> > On another hand, I need to internationalize this value, for example I
> > need to return "Yes" or "Sí" or "Oui". I don't know how to do this.
> >
> > Somebody has any idea?
> >
> >
> > Thank you very much,
> > Rego
> >
> > --
> > http://www.igalia.com
> > _______________________________________________
> > TYPO3-project-formidable mailing list
> > TYPO3-project-formidable at lists.netfielders.de
> > http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-project-formidable
> _______________________________________________
> TYPO3-project-formidable mailing list
> TYPO3-project-formidable at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-project-formidable
More information about the TYPO3-project-formidable
mailing list