<?php
namespace KaliForms\Inc\Backend\PredefinedForms;

if (!defined('ABSPATH')) {
    exit;
}
class Donation_Form extends Predefined_Form
{
    public function __construct()
    {
        parent::__construct();
        $this->id = 'donationForm';
		$this->name = esc_html__('Donation Form', 'kaliforms');
        $this->field_components = array(array("id" => "textbox", "internalId" => "textbox1", "label" => "Text box", "properties" => array("id" => "textbox1", "name" => "first-name", "caption" => "First name", "description" => "", "default" => "", "type" => "text", "placeholder" => "", "required" => true, "readonly" => false), "constraint" => "none"), array("id" => "textbox", "internalId" => "textbox2", "label" => "Text box", "properties" => array("id" => "textbox12", "name" => "email", "caption" => "Email", "description" => "", "default" => "", "type" => "text", "placeholder" => "", "required" => true, "readonly" => false), "constraint" => "none"), array("id" => "textbox", "internalId" => "textbox3", "label" => "Text box", "properties" => array("id" => "textbox123", "name" => "last-name", "caption" => "Last name", "description" => "", "default" => "", "type" => "text", "placeholder" => "", "required" => true, "readonly" => false), "constraint" => "none"), array("id" => "telephone", "internalId" => "telephone4", "label" => "Phone", "properties" => array("id" => "telephone4", "name" => "telephone", "caption" => "Phone", "description" => "", "default" => "", "placeholder" => "", "required" => false, "format" => "free", "readonly" => false), "constraint" => "none"), array("id" => "donation", "internalId" => "donation5", "label" => "Donation", "properties" => array("id" => "donation5", "name" => "donation", "caption" => "Amount", "description" => "", "default" => "", "donationType" => "custom", "donationName" => "Donation", "choices" => array(array("value" => "5", "label" => "5$"), array("value" => "10", "label" => "10$"), array("value" => "15", "label" => "15$"))), "constraint" => "none"), array("id" => "paypal", "internalId" => "paypal6", "label" => "PayPal", "properties" => array("id" => "paypal6", "name" => "paypal", "merchantEmail" => ""), "constraint" => "none"), array("id" => "textarea", "internalId" => "textarea7", "label" => "Textarea", "properties" => array("id" => "textarea7", "name" => "comment", "caption" => "Comment", "description" => "", "default" => "", "placeholder" => "", "rows" => "5", "changeToEditor" => false, "required" => false, "readonly" => false), "constraint" => "none"));

        $this->grid = array(array("h" => 1, "i" => "textbox1", "maxH" => 1, "minW" => 3, "moved" => false, "static" => false, "w" => 6, "x" => 0, "y" => 0), array("h" => 1, "i" => "textbox2", "maxH" => 1, "minW" => 3, "moved" => false, "static" => false, "w" => 12, "x" => 0, "y" => 1), array("h" => 1, "i" => "textbox3", "maxH" => 1, "minW" => 3, "moved" => false, "static" => false, "w" => 6, "x" => 6, "y" => 0), array("h" => 1, "i" => "telephone4", "maxH" => 1, "minW" => 3, "moved" => false, "static" => false, "w" => 12, "x" => 0, "y" => 2), array("h" => 1, "i" => "donation5", "maxH" => 1, "minW" => 3, "moved" => false, "static" => false, "w" => 12, "x" => 0, "y" => 3), array("h" => 1, "i" => "paypal6", "maxH" => 1, "minW" => 3, "moved" => false, "static" => false, "w" => 12, "x" => 0, "y" => 5), array("h" => 1, "i" => "textarea7", "maxH" => 1, "minW" => 3, "moved" => false, "static" => false, "w" => 12, "x" => 0, "y" => 4));

        $this->form_info = [
            'requiredFieldMark'           => '*',
            'multipleSelectionsSeparator' => ',',
            'globalErrorMessage'          => 'Something went wrong, please make sure everything is ok!',
            'showThankYouMessage'         => '1',
			'thankYouMessage'             => '<p>Thank you for your donation!</p>',
			'saveFormSubmissions' => '1',
        ];
    }
}
