<?php
namespace PrimeSlider\Includes;

if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly
}

/**
 * Class WPML_PrimeSlider_Elysium
 * Handles translation of repeater 'slides' in the Elysium widget
 */
class WPML_PrimeSlider_Elysium extends WPML_Module_With_Items {

    /**
     * @return string
     */
    public function get_items_field() {
        return 'slides';
    }

    /**
     * @return array
     */
    public function get_fields() {
        return array(
            'title',
            'title_link' => ['url'],
            'text',
        );
    }

    /**
     * @param string $field
     * @return string
     */
    protected function get_title( $field ) {
        switch ( $field ) {
            case 'title':
                return esc_html__( 'Title', 'bdthemes-prime-slider-lite' );
            case 'title_link':
                return esc_html__( 'Title Link', 'bdthemes-prime-slider-lite' );
            case 'text':
                return esc_html__( 'Text', 'bdthemes-prime-slider-lite' );
            default:
                return '';
        }
    }

    /**
     * @param string $field
     * @return string
     */
    protected function get_editor_type( $field ) {
        switch ( $field ) {
            case 'title':
                return 'LINE';
            case 'title_link':
                return 'LINK';
            case 'text':
                return 'VISUAL';
            default:
                return 'LINE';
        }
    }
}
