<?php
if (class_exists('GF_Field')) {
	class ClassicRating extends GF_Field_Radio
	{
		public $type = 'classic-rating';

		public $choices = [
			[
				'text'          => 'Non',
				'value'         => 1,
				'isSelected'    => false,
			],
			[
				'text'          => 'Un peu',
				'value'         => 2,
				'isSelected'    => false,
				'price'         => ''
			],
			[
				'text'          => 'Moyen',
				'value'         => 3,
				'isSelected'    => false,
			],
			[
				'text'          => 'Beaucoup',
				'value'         => 4,
				'isSelected'    => false,
			],
			[
				'text'          => 'Parfait',
				'value'         => 5,
				'isSelected'    => false,
			],
		];


		public function get_form_editor_field_title()
		{
			return esc_attr__('Notation classique', 'homegrade-theme__texte-fonctionnel');
		}
		public function get_form_editor_button()
		{
			return [
				'group' => 'advanced_fields',
				'text'  => $this->get_form_editor_field_title(),
			];
		}
		public function get_form_editor_field_icon()
		{
			return 'dashicons-star-filled';
		}
		public function get_form_editor_field_settings()
		{
			return [
				'label_setting',
				'choices_setting',
				'description_setting',
				'rules_setting',
				'error_message_setting',
				'css_class_setting',
				'conditional_logic_field_setting'
			];
		}
	}
	GF_Fields::register(new ClassicRating());
}
