<?php
$achievements = array (
  'key' => 'achievementsfield',
  'label' => 'Achievements',
  'name' => 'achievements',
  'type' => 'text',
  'sub_fields' => array (
    array (
      'key' => 'achievements__title',
      'label' => 'Section title',
      'name' => 'title', 
      'type' => 'text',
    ),
    array(
		'key' => 'achievements__content',
		'label' => 'Section introduction',
		'name' => 'content',
		'type' => 'textarea',
		'instructions' => '',
		'required' => 0,
		'conditional_logic' => 0,
		'wrapper' => array(
			'width' => '',
			'class' => '',
			'id' => '',
		),
	),
    array(
		'key' => 'achievements__sectionTitle',
		'label' => 'Section title',
		'name' => 'sectionTitle',
		'type' => 'text',
		'instructions' => 'Insert short section title',
		'required' => 0,
		'conditional_logic' => 0,
		'wrapper' => array(
			'width' => '',
			'class' => '',
			'id' => '',
		),
	),
  array(
    'key' => 'hide_block',
    'label' => 'Hide this block from anchor links',
    'name' => 'hide_block',
    'type' => 'true_false',
    'instructions' => '',
    'required' => 0,
    'wrapper' => array(
      'width' => '',
      'class' => '',
      'id' => '',
    ),
    'message' => '',
    'default_value' => 0,
    'ui' => 1,
    'ui_on_text' => '',
    'ui_off_text' => '',
  ),
  array(
		'key' => 'achievements__cta',
		'label' => 'Button label',
		'name' => 'button',
		'type' => 'text',
		'instructions' => '',
		'required' => 0,
		'conditional_logic' => 0,
		'wrapper' => array(
			'width' => '',
			'class' => '',
			'id' => '',
		),
	),
	array(
		'key' => 'achievements__cta-link',
		'label' => 'Select page to link to',
		'name' => 'link',
		'type' => 'page_link',
		'instructions' => '',
		'required' => 0,
		'conditional_logic' => 0,
		'wrapper' => array(
			'width' => '',
			'class' => '',
			'id' => '',
		),
	),
    array(
		'key' => 'achievements__facts',
		'label' => 'Facts',
		'name' => 'achievements',
		'type' => 'repeater',
		'instructions' => '',
		'required' => 1,
		'conditional_logic' => 0,
		'wrapper' => array(
			'width' => '',
			'class' => '',
			'id' => '',
		),
		'min' => 1,
		'max' => 4,
		'layout' => 'row',
		// 'button_label' => 'Add Slide',
		'sub_fields' => array(
			array(
				'key' => 'achievements__fact-title',
				'label' => 'Fact title',
				'name' => 'title',
				'type' => 'text',
				'instructions' => '',
				'required' => 1,
				'conditional_logic' => 0,
				'wrapper' => array(
					'width' => '',
					'class' => '',
					'id' => '',
				),
				'default_value' => '',
				'placeholder' => '',
				'prepend' => '',
				'append' => '',
				'maxlength' => '',
			),
			array(
				'key' => 'achievements__fact-number',
				'label' => 'Fact number',
				'name' => 'number',
				'type' => 'text',
				'instructions' => '',
				'required' => 1,
				'conditional_logic' => 0,
				'wrapper' => array(
					'width' => '',
					'class' => '',
					'id' => '',
				),
				'default_value' => '',
				'placeholder' => '',
				'prepend' => '',
				'append' => '',
				'maxlength' => '',
			),
		),
    ),
  ),
  'parent' => 'contentblocks_flex', //flex field key
  'parent_layout' => '56ff5b1a77c76', // layout key
  'row_min' => 0,
  'row_limit' => '',
  'layout' => 'row',
);

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