<?php

namespace PrimeSlider\Includes;

defined('ABSPATH') || exit;

/**
 * Class WPML_PrimeSlider_Pandora
 */
class WPML_PrimeSlider_Pandora extends WPML_Module_With_Items {

    /**
     * Repeater field name
     */
    public function get_items_field() {
        return 'items';
    }

    /**
     * Fields inside repeater that should be translatable
     */
    protected function get_fields() {
        return [
            'title',
            'sub_title',
            'title_link' => ['url'],
        ];
    }

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

            case 'sub_title':
                return esc_html__('Sub Title', 'bdthemes-prime-slider-lite');

            case 'title_link':
                return esc_html__('Title Link', 'bdthemes-prime-slider-lite');

            default:
                return '';
        }
    }

    /**
     * Editor type for WPML Translation Editor
     */
    protected function get_editor_type($field) {
        switch ($field) {
            case 'title':
            case 'sub_title':
                return 'LINE';

            case 'title_link':
                return 'LINK';

            default:
                return '';
        }
    }
}