<?php
// (1) Required settings
$nName = _("Contact Form");
$nDescription = _("Adds a simple contact form with fields for subject, name, phone number and comments.  This form comes with built-in error handling and email management. Be sure to configure the settings in 'contact_form.php'.");
$nPageTypeLimit = ""; // Content, Homepage, Search
$nTemplateFile = "contactform.html";

// (2) Custom Functions (all must be prefaced with component name (e.g. function compname_functionname())
if(!function_exists("contactform_getColumnDD")){
	function contactform_getSendmailDD($nFieldID,$nCurrentFieldValue){
		// create dropdown select field
		$nHTML = "";
		$nDDValues = array();
		$nDDValues["1"] = "PHPMailer";
		$nDDValues["2"] = "SendMail";
		foreach($nDDValues AS $nFldID => $nFldVal){
			if($nFldID==$nCurrentFieldValue){ $nHTML.="<option value=\"$nFldID\" selected>$nFldVal</option>"; } else { $nHTML.="<option value=\"$nFldID\">$nFldVal</option>"; }
		}
		$nDDHTML = "<select name=\"$nFieldID\" id=\"$nFieldID\" style=\"margin-bottom:20px;\">$nHTML</select>";
		return $nDDHTML;
	}
}

// (3) Add the fields that make up your component
// Format: addField(FieldType, Title, Caption, DefaultVal, CustomFunctionManager, CustomFunctionSite)
addField( "text" , _("Contact Form Title") , _("(max. 200 characters)") , "" , "width:524px;" ); // 1
addField( "text" , _("Email Subject") , _("Subject line of the message you receive when the form is sent.") , _("New message from your website") , "width:300px;" ); // 2
addField( "textarea" , _("Thank You Message") , _("Message shown to visitor after form is sent.") , _("Thank you for your interest in Mywebsite.com. One of our staff will be in touch with you shortly in response to your request.") , "width:524px;" ); // 1
addField( "text" , _("Send Email To") , _("The e-mail address where this form sends emails to.") , "info@mywebsite.com" , "width:300px;" ); // 3
addField( "text" , _("Mail Host") , _("Your mail server host (e.g. mail.mywebsite.com)") , "mail.mywebsite.com" , "width:300px;" ); // 4
addField( "text" , _("Mail Host Username") , _("A valid e-mail address on the mail server.") , "" , "width:300px;" ); // 5
addField( "text" , _("Mail Host Password") , _("The password to the valid e-mail address.") , "" , "width:300px;" ); // 6
addField( "text" , _("Method for sending mail") , _("Switch this on if the form has problems sending mail.") , "" , "width:300px;" , "getSendmailDD" ); // 7
?>