FormBuilder-submission templates

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
chrisl
Forum Members
Forum Members
Posts: 57
Joined: Fri Dec 30, 2005 10:08 am
Location: London

FormBuilder-submission templates

Post by chrisl »

Formbuilder version 0.4.4

If you use submission templates for forms with file uploads the FileUpload fields take the field names/aliases and not the user input values.

As a quick hack to correct this for email forms with attachment fields for example.

Go to FormBuilder/action.default.php

find the smarty->assigns for the submissions template around line 132 and look for

Code: Select all

          $this->smarty->assign($aeform->MakeVar($field->GetName()),
                  $replVal);
           $this->smarty->assign('fld_'.$field->GetId(),$replVal); 
		   $this->smarty->assign($aeform->MakeVar($field->GetName()).'_array',
                  $replVals);
           $this->smarty->assign('fld_'.$field->GetId().'_array',$replVals);
and IMMEDIATELY above add

Code: Select all

  if( isset( $_FILES[$replVal] ) && $_FILES[$replVal]['size'] > 0 )
	        {
	    	$thisFile =& $_FILES[$replVal]; 
		  $replVal = $thisFile[name];
		}
rocket
Forum Members
Forum Members
Posts: 25
Joined: Tue May 29, 2007 8:37 pm

Re: FormBuilder-submission templates

Post by rocket »

Thanks this was exactly what I wanted to do and it works great :D
Post Reply

Return to “Modules/Add-Ons”