<?php

CSF::createSection(
	$prefix,
	[
		'title'  => __( 'Attachments', 'forumax' ),
		'icon'   => 'dashicons dashicons-media-default',
		'fields' => [
			[
				'id'      => 'is_attachment',
				'type'    => 'switcher',
				'default' => true,
				'title'   => __( 'Show attachments on topic replies.', 'forumax' ),
			],

			[
				'id'       => 'max_file_size',
				'type'     => 'number',
				'title'    => _x( 'Maximum File Size', 'forumax maximum file size upload', 'forumax' ),
				'subtitle' => __( 'Input the values in Kilo Bytes (KB)', 'forumax' ),
				'default'  => 512,
                'unit'     => 'KB',
                'class'   => 'st-pro-notice',
			],

			[
				'id'      => 'max_file_uploads',
				'type'    => 'number',
				'title'   => _x( 'Maximum number of file to upload at once', 'forumax maximum file size upload', 'forumax' ),
				'default' => 4,
				'class'   => 'st-pro-notice',
			],

			[
				'id'       => 'is_hide_attachment',
				'type'     => 'switcher',
				'default'  => true,
				'title'    => __( 'Hide Attachment from visitors', 'forumax' ),
				'text_on'  => __( 'Hide', 'forumax' ),
				'text_off' => __( 'Show', 'forumax' ),
				'text_width' => 85
			],

			[
				'type'    => 'subheading',
				'content' => __( 'Who can upload files ', 'forumax' ),
			],

			[
				'id'      => 'users_can_upload',
				'type'    => 'checkbox',
				'title'   => __( 'Users who can upload attachments.', 'forumax' ),
				'options' => [
					'keymaster'   => __( 'Keymaster', 'forumax' ),
					'moderator'   => __( 'Moderator', 'forumax' ),
					'participant' => __( 'Participant', 'forumax' ),
					'spectator'   => __( 'Spectator', 'forumax' ),
					'blocked'     => __( 'Blocked', 'forumax' ),
				],
				'default' => [ 'keymaster', 'moderator', 'participant', 'spectator', 'blocked' ],
			],

			[
				'type'    => 'subheading',
				'content' => __( 'When an associated Topic or Reply has been deleted', 'forumax' ),
			],

			[
				'id'      => 'is_attachment_deletion',
				'type'    => 'switcher',
				'default' => false,
				'title'   => __( 'Delete the attachment along with forum/topic.', 'forumax' ),
				'class'   => 'st-pro-notice',
			],

			[
				'type'    => 'subheading',
				'content' => __( 'Forums integration', 'forumax' ),
			],

			[
				'type'    => 'content',
				'content' => __( 'With these options you can modify the forums to include attachment elements.', 'forumax' ),
			],

			[
				'id'      => 'is_attachment_icon',
				'type'    => 'switcher',
				'title'   => __( 'Attachment Icon', 'forumax' ),
				'default' => true,
			],

			[
				'id'      => 'is_file_type_icon',
				'type'    => 'switcher',
				'title'   => __( 'File type Icons', 'forumax' ),
				'default' => true,
			],

			[
				'type'    => 'subheading',
				'content' => __( 'Display of image attachments', 'forumax' ),
			],

			[
				'type'    => 'content',
				'content' => __( 'Attached images can be displayed as thumbnails, and from here you can control this.', 'forumax' ),
			],

			[
				'id'      => 'image_thumbnail_caption',
				'type'    => 'switcher',
				'title'   => __( 'With Caption', 'forumax' ),
				'default' => true,
			],
			
			[
				'id'      => 'image_link_type',
				'type'    => 'select',
				'title'   => __( 'Image Link Type', 'forumax' ),
				'options' => [
					'download'   => __( 'Download', 'forumax' ),
					'lightbox'   => __( 'Lightbox', 'forumax' ),
				],
				'default' => 'download',
				'class'   => 'st-pro-notice',
				'chosen'  => true
			],
			
			[
				'type'    => 'subheading',
				'content' => __( 'Image thumbnails size', 'forumax' ),
			],

			[
				'type'    => 'content',
				'content' => __( 'Changing thumbnails size affects only new image attachments. To use new size for old attachments, resize them using Regenerate Thumbnails plugin.', 'forumax' ),
			],

			[
				'id'        => 'attachment_image_x',
				'type'      => 'number',
				'title'     => __( 'Thumbnail width', 'forumax' ),
                'unit'      => 'px',
			],

			[
				'id'    => 'attachment_image_y',
				'type'  => 'number',
				'title' => __( 'Thumbnail height', 'forumax' ),
                'unit'     => 'px',
			],
		],
	]
);
