<?php
$items = array(
  'key' => 'expanding_carousel',
  'label' => 'Expanded Carousel',
  'title' => 'Expanded Carousel',
  'name' => 'expanding-carousel',
  'type' => 'group',
	'sub_fields' => array( 
		array (
	      'key' => 'expanding_carousel_section_label',
	      'label' => 'Section Label',
	      'name' => 'blocklabel',
	      'type' => 'text',
	      'instructions' => __('This label appears in in-page navigation and within the content of some blocks, overriding the title.', 'ipsen-master'),
	    ),
    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' => 'expanding_carousel_slides',
			'label' => 'Slides',
			'name' => 'slides', // the 'name' value has to match the variable passed to the twig file
			'type' => 'repeater',
			'instructions' => '',
			'required' => 0,
			'conditional_logic' => 0,
			'wrapper' => array(
				'width' => '',
			   	'class' => '',
				'id' => '',
			),
			'collapsed' => '',
			'min' => 0,
			'max' => 0,
			'layout' => 'row',
			'button_label' => 'Add Slide',
			'sub_fields' => array(
				array(
					'key' => 'expanding_carousel_slide_title',
					'label' => 'Slide Title',
					'name' => 'title', // the 'name' value for each field has to match the variable in the Twig file.
					'type' => 'text',
					'instructions' => '',
					'required' => 1,
					'conditional_logic' => 0,
					'wrapper' => array(
						'width' => '',
						'class' => '',
						'id' => '',
					),
					'default_value' => '',
					'placeholder' => '',
					'prepend' => '',
					'append' => '',
					'maxlength' => '',
				),
				array(
					'key' => 'expanding_carousel_slide_content',
					'label' => 'Item Content',
					'name' => 'content', // the 'name' value for each field has to match the variable in the Twig file.
					'type' => 'wysiwyg',
					'instructions' => '',
					'required' => 1,
					'conditional_logic' => 0,
					'wrapper' => array(
						'width' => '',
						'class' => '',
						'id' => '',
					),
					'default_value' => '',
					'placeholder' => '',
					'maxlength' => '',
					'rows' => '',
				),
				array (
		          'key' => 'expanding_carousel_slide_image',
		          'label' => 'Card Image',
		          'name' => 'image',
		          'type' => 'image',
		          'return_format' => 'url',
		        ),
				array (
					'key' => 'expanding_carousel_slide_flex',
					'label' => __('Expandable Content', 'ipsen-master'),
					'name' => 'blocks',
					'type' => 'flexible_content',
					'instructions' => __('Place longer pieces of content here.', 'ipsen-master'),
					'wrapper' => array (
					  'width' => '',
					  'class' => '',
					  'id' => '',
					),
				  'button_label' => 'Add Block',
				  'min' => '',
				  'max' => '',
				  'layouts' => array(
				  	array (
					  'key' => 'expanding_carousel_slide_wysiwyg_content_block',
					  'label' => 'Editorial',
					  'name' => 'generic-wysiwyg',
					  'type' => 'repeater',
					  'sub_fields' => array (
					    array (
					      'key' => 'expanding_carousel_slide_wysiwyg_content_block_content',
					      'label' => __('Content', 'ipsen-master'),
					      'name' => 'content', 
					      'type' => 'wysiwyg',
					      'tabs' => 'visual',
					      // 'toolbar' => 'basic',
					      'media_upload' => 1,
					    ),
					  ),
					  'row_min' => 0,
					  'row_limit' => '',
					  'layout' => 'row',
					),
					array (
					  'key' => 'expanding_carousel_slide_accordion',
					  'label' => 'Accordion',
					  'name' => 'generic-accordion', //defines the Twig file you're using
					  'type' => 'repeater',
					  'sub_fields' => array (
					    array(
					      'key' => 'aexpanding_carousel_slide_accordion_accordions',
					      'label' => 'Accordions',
					      'name' => 'accordions', // has to match the variable in the Twig file.
					      'layout' => 'block',
					      'type' => 'repeater',
					      'button_label' => 'Add Accordion',
					      'sub_fields' => array (
					        array(
					          'key' => 'accordionHeader', 
					          'label' => 'Heading',
					          'name' => 'accordionHeader',
					          'type' => 'text',
					          'instructions' => '',
					          'required' => 0,
					          'conditional_logic' => 0,
					          'wrapper' => array(
					            'width' => '',
					            'class' => '',
					            'id' => '',
					          ),
					          'default_value' => '',
					          'placeholder' => '',
					          'prepend' => '',
					          'append' => '',
					          'maxlength' => '',
					        ),
					        array(
					          'key' => 'accordionContent', 
					          'label' => 'Content',
					          'name' => 'accordionContent',
					          'type' => 'wysiwyg',
					          'tabs' => 'visual',
					          'media_upload' => 1,
					          'instructions' => '',
					          'required' => 0,
					          'conditional_logic' => 0,
					        ),
					      ),
					    ),
					  ),
					'row_min' => 0,
					'row_limit' => '',
					),
				  ),
				),
			),
		)
	)
);

array_push($_SESSION["blocks"], $items); //<---- this is needed so that it shows on the Add Block
