<?php

$ctaBlock = array(
  'key' => 'cta-block',
  'label' => 'CTA Block',
	'title' => 'CTA Block',
  'name' => 'cta-block', //defines the Twig file you're using
	'type' => 'group',//<---- this is needed so that it shows on the Add Block Correctly
	'sub_fields' => array( //<---- this is initially fields, needs to be renamed as sub_fields
		array(
			'key' => 'cta-block__btn-position',
			'label' => 'CTA Button position',
			'name' => 'btnPosition',
			'type' => 'select',
			'instructions' => 'Where would you like the CTA button to display?',
			'conditional_logic' => 0,
			'wrapper' => array(
				'width' => '',
				'class' => '',
				'id' => '',
			),
			'choices' => array(
				'top' => 'top',
				'bottom' => 'bottom',
				'left' => 'left',
				'right' => 'right'
			),
			'default_value' => array(
				0 => 'right',
			),
			'allow_null' => 0,
			'multiple' => 0,
			'ui' => 0,
			'return_format' => 'value',
			'ajax' => 0,
			'placeholder' => '',
		),
		array(
			'key' => 'cta-block__theme',
			'label' => 'Theme',
			'name' => 'theme',
			'type' => 'radio',
			'instructions' => '',
			'required' => 0,
			'conditional_logic' => 0,
			'wrapper' => array(
				'width' => '',
				'class' => '',
				'id' => '',
			),
			'choices' => array(
				'default' => 'Default',
				'white' => 'White',
			),
			'allow_null' => 0,
			'other_choice' => 0,
			'default_value' => '',
			'layout' => 'horizontal',
			'return_format' => 'value',
			'save_other_choice' => 0,
		),
		array(
			'key' => 'cta-block__heading',
			'label' => 'CTA Block Heading',
			'name' => 'ctaBlockHeading',
			'type' => 'text',
			'instructions' => '',
			'conditional_logic' => 0,
			'wrapper' => array(
				'width' => '',
				'class' => '',
				'id' => '',
			),
			'default_value' => '',
			'placeholder' => '',
			'prepend' => '',
			'append' => '',
			'maxlength' => '',
		),
		array(
			'key' => 'cta-block__text',
			'label' => 'CTA Block Text',
			'name' => 'ctaBlockText',
			'type' => 'textarea',
			'instructions' => '',
			'conditional_logic' => 0,
			'wrapper' => array(
				'width' => '',
				'class' => '',
				'id' => '',
			),
			'default_value' => '',
			'placeholder' => '',
			'maxlength' => '',
			'rows' => '',
			'new_lines' => '',
		),
		array(
			'key' => 'cta-block__image',
			'label' => 'CTA Block Image',
			'name' => 'ctaBlockImage',
			'type' => 'image',
			'instructions' => '',
			'conditional_logic' => 0,
			'wrapper' => array(
				'width' => '',
				'class' => '',
				'id' => '',
			),
			'return_format' => 'array',
			'preview_size' => 'thumbnail',
			'library' => 'all',
			'min_width' => '',
			'min_height' => '',
			'min_size' => '',
			'max_width' => '',
			'max_height' => '',
			'max_size' => '',
			'mime_types' => '',
		),
		array(
			'key' => 'cta-block__button',
			'label' => 'CTA Block Button Link',
			'name' => 'ctaBlockBtn',
			'type' => 'url',
			'instructions' => '',
			'required' => 1,
			'conditional_logic' => 0,
			'wrapper' => array(
				'width' => '',
				'class' => '',
				'id' => '',
			),
			'default_value' => '',
			'placeholder' => '',
    ),
    array(
			'key' => 'cta-block__btnText',
			'label' => 'CTA Block Button Text',
			'name' => 'ctaBlockBtnText',
			'type' => 'text',
			'instructions' => '',
			'conditional_logic' => 0,
			'wrapper' => array(
				'width' => '',
				'class' => '',
				'id' => '',
			),
			'default_value' => '',
			'placeholder' => '',
			'prepend' => '',
			'append' => '',
			'maxlength' => '',
    ),
    array(
      'key' => 'cta-block__samewidth',
      'label' => 'Make all CTA buttons on this page the same width',
      'name' => 'ctaBlockSameWidth',
      'type' => 'true_false',
      'instructions' => '',
      'required' => 0,
      'wrapper' => array(
        'width' => '',
        'class' => '',
        'id' => '',
      ),
      'message' => '',
      'default_value' => 0,
      'ui' => 1,
      'ui_on_text' => '',
      'ui_off_text' => '',
    ),
	),
  'row_min' => 0,
  'row_limit' => '',
  'layout' => 'row'
);

array_push($_SESSION["blocks"], $ctaBlock);