<?php
/**
 * ACF Group Settings: Member Types.
 *
 * @TODO: Move this to settings API.
 *
 * @package Nisje
 */

defined( 'ABSPATH' ) || die( 'Shame on you' );

acf_add_local_field_group(
	[
		'key'                   => 'dekode_intranet_group_option_member_types',
		'title'                 => esc_html__( 'Member Types', 'nisje' ),
		'fields'                => [
			[
				'key'               => 'dekode_intranet_key_member_types',
				'label'             => esc_html__( 'Register Member Types', 'nisje' ),
				'name'              => 'dekode_intranet_member_types',
				'type'              => 'repeater',
				'instructions'      => '',
				'required'          => 0,
				'conditional_logic' => 0,
				'wrapper'           => [
					'width' => '',
					'class' => '',
					'id'    => '',
				],
				'collapsed'         => '',
				'min'               => '',
				'max'               => '',
				'layout'            => 'block',
				'button_label'      => esc_html__( 'Add member type', 'nisje' ),
				'sub_fields'        => [
					[
						'key'               => 'dekode_intranet_key_member_types_key',
						'label'             => esc_html__( 'Key', 'nisje' ),
						'name'              => 'dekode_intranet_member_types_key',
						'type'              => 'text',
						'instructions'      => '',
						'required'          => 0,
						'conditional_logic' => 0,
						'wrapper'           => [
							'width' => '33',
							'class' => '',
							'id'    => '',
						],
						'default_value'     => '',
						'placeholder'       => esc_html__( 'Ex: student', 'nisje' ),
						'prepend'           => '',
						'append'            => '',
						'maxlength'         => '',
					],
					[
						'key'               => 'dekode_intranet_key_member_types_name',
						'label'             => esc_html__( 'Name', 'nisje' ),
						'name'              => 'dekode_intranet_member_types_name',
						'type'              => 'text',
						'instructions'      => '',
						'required'          => 0,
						'conditional_logic' => 0,
						'wrapper'           => [
							'width' => '33',
							'class' => '',
							'id'    => '',
						],
						'default_value'     => '',
						'placeholder'       => '',
						'prepend'           => '',
						'append'            => '',
						'maxlength'         => '',
					],
					[
						'key'               => 'dekode_intranet_key_member_types_singular_name',
						'label'             => esc_html__( 'Singular Name', 'nisje' ),
						'name'              => 'dekode_intranet_member_types_singular_name',
						'type'              => 'text',
						'instructions'      => '',
						'required'          => 0,
						'conditional_logic' => 0,
						'wrapper'           => [
							'width' => '33',
							'class' => '',
							'id'    => '',
						],
						'default_value'     => '',
						'placeholder'       => '',
						'prepend'           => '',
						'append'            => '',
						'maxlength'         => '',
					],
					[
						'key'               => 'dekode_intranet_key_member_types_has_directory',
						'label'             => esc_html__( 'Has directory?', 'nisje' ),
						'name'              => 'dekode_intranet_member_types_has_directory',
						'type'              => 'true_false',
						'instructions'      => '',
						'required'          => 0,
						'conditional_logic' => 0,
						'wrapper'           => [
							'width' => '',
							'class' => '',
							'id'    => '',
						],
						'message'           => '',
						'default_value'     => 0,
					],
					[
						'key'               => 'dekode_intranet_key_member_types_directory_slug',
						'label'             => esc_html__( 'Directory slug', 'nisje' ),
						'name'              => 'dekode_intranet_member_types_directory_slug',
						'type'              => 'text',
						'instructions'      => '',
						'required'          => 0,
						'conditional_logic' => [
							[
								[
									'field'    => 'dekode_intranet_key_member_types_has_directory',
									'operator' => '==',
									'value'    => '1',
								],
							],
						],
						'wrapper'           => [
							'width' => '33',
							'class' => '',
							'id'    => '',
						],
						'default_value'     => '',
						'placeholder'       => '',
						'prepend'           => '',
						'append'            => '',
						'maxlength'         => '',
					],
				],
			],
		],
		'location'              => [
			[
				[
					'param'    => 'options_page',
					'operator' => '==',
					'value'    => 'nisje-settings-member-types',
				],
			],
		],
		'menu_order'            => 0,
		'position'              => 'normal',
		'style'                 => 'default',
		'label_placement'       => 'top',
		'instruction_placement' => 'label',
		'hide_on_screen'        => '',
		'active'                => 1,
		'description'           => '',
	]
);
