nliautaud / p01contact

Create contact forms by writing simple tags. Also a plugin for GetSimple and Pico CMS.
MIT License
16 stars 15 forks source link

sent_copy #7

Closed backit closed 8 years ago

backit commented 8 years ago

Hi, if you use askcopy field, after filling the form, a message appear on top of the site: "Sent_copy" both youi check or uncheck askcopyfield, just because there is A askcopy field. Imho this is an error. "Sent_copy" should be displayed only if user checked askcopy field, so i modified source file p01-contact.php at line 696 where previous was: $askcopy = True; now is: $askcopy =in_array("selected",$value[0]) ? TRUE : FALSE; so if "selected" is in array value[0] then askcopy is true and Sent_copy is displayed, otherwise askcopy is false and "email sent" is displayed instead.

Piece of code is in:

case 'askcopy' : 
              $askcopy =in_array("selected",$value[0]) ? TRUE : FALSE; 
              $content .= '<p><b>' . $this->lang('askedcopy').'.</b></p>';
              break;
default :
             $content .=  $value;

Thanks

nliautaud commented 8 years ago

Done, thanks.