<?php
$products = array(
    'key' => 'products_list', //<---- this is needed so that it shows on the Add Block
    'label' => 'Products List', //<---- this is needed so that it shows on the Add Block
    'title' => 'Products List',
    'name' => 'product-list', // <---- This line defines the Twig file you're using
    'type' => 'group',
    'sub_fields' => array(
    	array (
	      'key' => 'product_list_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' => 'field_5bd70fc93a2b7',
			'label' => 'Country name or Category',
			'name' => 'title',
			'type' => 'text',
			'instructions' => '',
			'required' => 0,
			'conditional_logic' => 0,
			'wrapper' => array(
				'width' => '',
				'class' => '',
				'id' => '',
			),
			'default_value' => '',
			'placeholder' => '',
			'prepend' => '',
			'append' => '',
			'maxlength' => '',
		),
		array(
			'key' => 'field_5bd70ff243efe',
			'label' => 'Products',
			'name' => 'products',
			'type' => 'repeater',
			'instructions' => '',
			'required' => 0,
			'conditional_logic' => 0,
			'wrapper' => array(
				'width' => '',
				'class' => '',
				'id' => '',
			),
			'collapsed' => '',
			'min' => 0,
			'max' => 0,
			'layout' => 'row',
			'button_label' => 'Add Product',
			'sub_fields' => array(
				array(
					'key' => 'field_5bd7100343eff',
					'label' => 'Product name',
					'name' => 'name',
					'type' => 'text',
					'instructions' => '',
					'required' => 1,
					'conditional_logic' => 0,
					'wrapper' => array(
						'width' => '',
						'class' => '',
						'id' => '',
					),
					'default_value' => '',
					'placeholder' => '',
					'prepend' => '',
					'append' => '',
					'maxlength' => '',
				),
				array(
					'key' => 'field_5bd710ca43f01',
					'label' => 'Product Image',
					'name' => 'image',
					'type' => 'image',
					'instructions' => '',
					'required' => 0,
					'conditional_logic' => 0,
					'wrapper' => array(
						'width' => '',
						'class' => '',
						'id' => '',
					),
					'return_format' => 'url',
					'preview_size' => 'thumbnail',
					'library' => 'all',
					'min_width' => '',
					'min_height' => '',
					'min_size' => '',
					'max_width' => '',
					'max_height' => '',
					'max_size' => '',
					'mime_types' => '',
				),
				array(
					'key' => 'field_5bd7138f43f08',
					'label' => 'Product Variants',
					'name' => 'variants',
					'type' => 'repeater',
					'instructions' => '',
					'required' => 1,
					'conditional_logic' => array(
						array(
							array(
								'field' => 'field_5bd7135343f07',
								'operator' => '==',
								'value' => '1',
							),
						),
					),
					'wrapper' => array(
						'width' => '',
						'class' => '',
						'id' => '',
					),
					'collapsed' => '',
					'min' => 0,
					'max' => 0,
					'layout' => 'row',
					'button_label' => 'Add variant',
					'sub_fields' => array(
						array(
							'key' => 'field_5bd713db43f09',
							'label' => 'Main Active Drug',
							'name' => 'ingredient',
							'type' => 'text',
							'instructions' => '',
							'required' => 0,
							'conditional_logic' => 0,
							'wrapper' => array(
								'width' => '',
								'class' => '',
								'id' => '',
							),
							'default_value' => '',
							'placeholder' => '',
							'prepend' => '',
							'append' => '',
							'maxlength' => '',
						),
						array(
							'key' => 'field_5bd714dfe2492',
							'label' => 'Description',
							'name' => 'description',
							'type' => 'textarea',
							'instructions' => '',
							'required' => 0,
							'conditional_logic' => 0,
							'wrapper' => array(
								'width' => '',
								'class' => '',
								'id' => '',
							),
							'default_value' => '',
							'placeholder' => '',
							'maxlength' => 400,
							'rows' => 4,
							'new_lines' => '',
						),
						array(
							'key' => 'field_5bd7152ee2493',
							'label' => 'Links',
							'name' => 'links',
							'type' => 'repeater',
							'instructions' => '',
							'required' => 0,
							'conditional_logic' => 0,
							'wrapper' => array(
								'width' => '',
								'class' => '',
								'id' => '',
							),
							'collapsed' => '',
							'min' => 0,
							'max' => 0,
							'layout' => 'rows',
							'button_label' => 'Add Link',
							'sub_fields' => array(
								array(
									'key' => 'field_5bd71541e2494',
									'label' => 'Label',
									'name' => 'label',
									'type' => 'text',
									'instructions' => '',
									'required' => 1,
									'conditional_logic' => 0,
									'wrapper' => array(
										'width' => '',
										'class' => '',
										'id' => '',
									),
									'default_value' => '',
									'placeholder' => '',
									'prepend' => '',
									'append' => '',
									'maxlength' => '',
								),
								array(
									'key' => 'field_5bd71558e2495',
									'label' => 'Link',
									'name' => 'url',
									'type' => 'link',
									'instructions' => '',
									'required' => 1,
									'conditional_logic' => 0,
									'wrapper' => array(
										'width' => '',
										'class' => '',
										'id' => '',
									),
									'return_format' => 'url',
								),
							),
						),
						array(
							'key' => 'field_5be4487a505a3',
							'label' => 'Files',
							'name' => 'files',
							'type' => 'repeater',
							'instructions' => 'Video or PDF download',
							'required' => 0,
							'conditional_logic' => 0,
							'wrapper' => array(
								'width' => '',
								'class' => '',
								'id' => '',
							),
							'collapsed' => '',
							'min' => 0,
							'max' => 0,
							'layout' => 'row',
							'button_label' => 'Add File',
							'sub_fields' => array(
								array(
									'key' => 'field_5be448ea44a5a',
									'label' => 'File label',
									'name' => 'label',
									'type' => 'text',
									'instructions' => '',
									'required' => 1,
									'conditional_logic' => 0,
									'wrapper' => array(
										'width' => '',
										'class' => '',
										'id' => '',
									),
									'default_value' => '',
									'placeholder' => '',
									'prepend' => '',
									'append' => '',
									'maxlength' => '',
								),
								array(
									'key' => 'field_5be4490d44a5b',
									'label' => 'file url',
									'name' => 'url',
									'type' => 'file',
									'instructions' => '',
									'required' => 1,
									'conditional_logic' => 0,
									'wrapper' => array(
										'width' => '',
										'class' => '',
										'id' => '',
									),
									'return_format' => 'array',
									'library' => 'all',
									'min_size' => '',
									'max_size' => '',
									'mime_types' => '',
								),
								array(
									'key' => 'field_5bd71564e2496',
									'label' => 'Type',
									'name' => 'type',
									'type' => 'select',
									'instructions' => '',
									'required' => 0,
									'conditional_logic' => 0,
									'wrapper' => array(
										'width' => '',
										'class' => '',
										'id' => '',
									),
									'choices' => array(
										'video' => 'Video',
										'download' => 'Download',
									),
									'default_value' => array(
									),
									'allow_null' => 0,
									'multiple' => 0,
									'ui' => 0,
									'return_format' => 'value',
									'ajax' => 0,
									'placeholder' => '',
								),
							),
						),
					),
				),
			),
		),
	),
);

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