[TYPO3-project-formidable] New renderlet SUBMITIMAGE
Manuel Rego Casasnovas
mrego at igalia.com
Tue Aug 7 10:28:34 CEST 2007
Hello everyone,
in my company we need to use an input image instead of a submit button.
We've developed the next class:
class tx_rdtsubmitimage extends tx_rdtsubmit {
function _render() {
$sLabel = $this->oForm->_getLLLabel($this->aElement["label"]);
if(!($path = $this->oForm->_navConf("/path", $this->aElement))) {
$this->oForm->mayday('Path for SUBMITIMAGE renderlet is
required');
}
$sInput = "<input type=\"image\" src=\"" . $path . "\" name=\""
. $this->_getElementHtmlName() . "\" id=\"" . $this->_getElementHtmlId()
. "\" value=\"" . $sLabel . "\"" . $this->_getAddInputParams() . " />";
$aHtmlBag = array(
"__compiled" =>
$this->oForm->oRenderer->_displayLabel($sLabel) . $sInput,
"input" => $sInput,
);
return $aHtmlBag;
}
}
if (defined("TYPO3_MODE") &&
$TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/ameos_formidable/api/base/rdt_submitimage/api/class.tx_rdtsubmitimage.php"])
{
include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/ameos_formidable/api/base/rdt_submitimage/api/class.tx_rdtsubmitimage.php"]);
}
Line to add in the ext_localconf.php file:
"SUBMITIMAGE" => array("key" => "rdt_submitimage",
"base" => TRUE),
Example:
<renderlet:SUBMITIMAGE name="btnsearch" label="Search">
<path>fileadmin/img/search.png</path>
<custom>class="search"</custom>
</renderlet:SUBMITIMAGE>
I think that you can add this new renderlet to Ameos FORMidable.
Best regards,
Rego
--
Manuel Rego Casasnovas
Computer Science Engineer
mailto:mrego at igalia.com
Tel: +34 986 10 76 10
Fax: +34 981 91 39 49
Igalia - http://www.igalia.com
More information about the TYPO3-project-formidable
mailing list