<?php
$resourcesBlock = array (
  'key' => 'resources_block',
  'label' => 'Resources',
  'name' => 'resources-block',
  'type' => 'repeater',
  'sub_fields' => array (
    array (
      'key' => 'resources_block__Title',
      'label' => 'Section Title',
      'name' => 'title', // the 'name' value for each field has to match the variable in the Twig file.
      'type' => 'text',
      'wrapper' => array(
        'width' => '50%',
        'class' => '',
        'id' => '',
      ),
    ),
     array (
      'key' => 'resources_block_center_title',
      'label' => __('Center Title?', 'ipsen-master'),
      'name' => 'center_title', 
      // 'instructions' => __('This is optional', 'ipsen-master'),
      'type' => 'true_false',
      'instructions' => '',
      'required' => 0,
      'conditional_logic' => 0,
      'message' => '',
      'default_value' => 0,
      'ui' => 1,
      'ui_on_text' => '',
      'ui_off_text' => '',
      'wrapper' => array(
          'width' => '50%',
          'class' => '',
          'id' => '',
      ),
    ),
    array (
      'key' => 'resources_block_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' => 'resources_block__Intro',
      'label' => __('Introduction', 'ipsen-master'),
      'name' => 'content', 
      // 'instructions' => __('This is optional', 'ipsen-master'),
      'type' => 'wysiwyg',
      'tabs' => 'visual',
      // 'toolbar' => 'basic',
      'media_upload' => 1,
    ),
    array(
      'key' => 'resources_block_links',
      'label' => 'Resources',
      'name' => 'links',
      'layout' => 'block',
      'type' => 'flexible_content',
      'button_label' => 'Add Resource',
      'layouts' => array (
        array(
        'key' => 'resources_block_link',
        'label' => 'PDF',
        'name' => 'resources-block-link',
        'type' => 'repeater',
        'sub_fields' => array (
            array (
              'key' => 'resources_block_link_title',
              'label' => 'Title',
              'name' => 'title',
              'type' => 'text',
            ),
            array (
              'key' => 'resources_block_link_file',
              'label' => 'File',
              'name' => 'file',
              'type' => 'file',
              'return_format' => 'array',
              'preview_size' => 'thumbnail',
              'library' => 'all',
              'min_size' => 0,
              'max_size' => 0,
              'mime_types' => '',
            ),
          ),
        ),
      ),
    ),
  ),
  'row_min' => 0,
  'row_limit' => '',
  'layout' => 'row',
);

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