<?php

namespace PrimeSlider\Includes;

defined('ABSPATH') || exit;

/**
 * Class WPML_PrimeSlider_Knily
 */
class WPML_PrimeSlider_Knily extends WPML_Module_With_Items {

    /**
     * Repeater field name
     *
     * @return string
     */
    public function get_items_field() {
        return 'share_buttons';
    }

    /**
     * Fields inside repeater that should be translatable
     *
     * @return array
     */
    protected function get_fields() {
        return [
            'button',
            'text',
        ];
    }

    /**
     * Field labels shown in WPML Translation Editor
     *
     * @param string $field
     * @return string
     */
    protected function get_title($field) {
        switch ($field) {
            case 'button':
                return esc_html__('Social Title', 'bdthemes-prime-slider-lite');

            case 'text':
                return esc_html__('Custom Label', 'bdthemes-prime-slider-lite');

            default:
                return '';
        }
    }

    /**
     * Editor type for WPML Translation Editor
     *
     * @param string $field
     * @return string
     */
    protected function get_editor_type($field) {
        switch ($field) {
            case 'button':
            case 'text':
                return 'LINE';

            default:
                return '';
        }
    }
}
