[TYPO3-project-formidable] New formwrap option
Jerome Schneider
j.schneider at ameos.com
Mon Jul 23 10:28:32 CEST 2007
Hi Manuel,
This is interesting, and I think there's no danger to allow this.
When you use formidable like this, do you sometime use renderlets with
events also ? And if yes, does-it work ?
Concerning the possibility to apply the same property on several
renderlets at once, I'll try to figure out what would be the best way to
achieve this.
Jerome
Manuel Rego Casasnovas a écrit :
> Hello everyone,
>
> I use FORMidable to show data a lot of times, not to make a form, with
> all my renderlets in renderonly.
>
> For this I've added a new option "/meta/formwrap" to use in my XML
> files. The default value for this option is TRUE. An exmample:
> <meta>
> <name>My form</name>
> <form formid="my_form" />
> <debug>false</debug>
> <formwrap>false</formwrap>
> </meta>
>
>
> To add this new option I've modified the class mainrenderer
> (http://test.kunstvaerker.dk/html/class_8mainrenderer_8php-source.html#l00022):
> $formWrap= (!$this->oForm->_isFalse("/meta/formwrap"));
> $this->_setFormWrap($formWrap);
>
> if($this->oForm->bSubform) {
> $this->_setFormWrap($formWrap);
> $this->_setValidation(FALSE);
> }
>
>
> And a little changes to remove some inputs in the forms in wich I
> disable this option.
>
> And these lines
> (http://test.kunstvaerker.dk/html/class_8mainrenderer_8php-source.html#l00092):
> $aHtmlBag =
> array(
> "SCRIPT" => "",
> "FORMBEGIN" => "",
> "CONTENT" => $html,
> "HIDDEN" => "",
> "FORMEND" => "",
> );
>
> if($this->bFormWrap) {
> $aHtmlBag["HIDDEN"] = $hidden_entryid . $hidden_custom .
> $sSysHidden;
>
> $formid = "";
> $formaction = "";
> $formonsubmit = "";
> $formmethod = "";
> $formcustom = "";
>
> $formid = " id=\"" . $this->oForm->formid . "\" name=\""
> . $this->oForm->formid . "\" ";
>
> if(($sAction =
> $this->oForm->_navConf("/meta/form/action")) !== FALSE) {
> $formaction = " action=\"" . htmlentities($sAction)
> . "\" ";
> } else {
> $formaction = " action=\"" .
> htmlentities(t3lib_div::getIndpEnv("TYPO3_REQUEST_URL")) . "\" ";
> }
>
> if(($sOnSubmit =
> $this->oForm->_navConf("/meta/form/onsubmit")) !== FALSE) {
> $formonsubmit = " onSubmit = \"" . $sOnSubmit . "\" ";
> }
>
> if(($sCustom =
> $this->oForm->_navConf("/meta/form/custom")) !== FALSE) {
> $formcustom = " " . $sCustom . " ";
> }
>
> $aHtmlBag["FORMBEGIN"] = "<form
> enctype=\"multipart/form-data\" " . $formid . $formaction .
> $formonsubmit . $formcustom . " method=\"post\">";
> $aHtmlBag["FORMEND"] = "</form>";
> }
>
>
> And moreover I've had to change a line in the class tx_ameosformidable:
> if($this->bFormWrap) {
> $sDomApi = '<script
> type="text/javascript">if(!Formidable.Dom.bDomApiLoaded) {
> Formidable.Dom.bDomApiLoaded = true;}</script>';
> }
> But this line doesn't exist in the last FORMidable version.
>
>
> I think that this can be a interesting option. Maybe a option to specify
> that all the form is renderonly without insert the renderonly option in
> all the rederlets of the form.
>
>
> Best regards,
> Rego
>
More information about the TYPO3-project-formidable
mailing list