<?php


/**

 * @package     pkg_dearflip
 * @subpackage  com_dearflip
 * @since       1.0.0
 * @copyright   Copyright © 2007 Free Software Foundation, Inc. All rights reserved.
 * @license   GNU General Public License version 3 or later; see https://www.gnu.org/licenses/gpl-3.0.en.html

 */

// No direct access to this file
defined( '_JEXEC' ) or die( 'Restricted access' );

JFormHelper::loadFieldClass( 'list' );

/**
 * Dearflipsetting Form Field class for the Dearflip component
 *
 * @since  0.0.1
 */
class JFormFieldDearflipsetting extends JFormFieldList {
    /**
     * The field type.
     *
     * @var         string
     */
    protected $type = 'Dearflipsetting';

    /**
     * Method to get a list of options for a list input.
     *
     * @return  array  An array of JHtml options.
     */
    protected function getOptions() {
        $db    = JFactory::getDBO();
        $query = $db->getQuery( true );
        $query->select(
            'id',
           
            'dfx_setting_3d_2d',
            'dfx_setting_hardpages',
            'dfx_setting_pdfPagerenderSize',
            'dfx_setting_autoEnableSound',
            'dfx_setting_enableDownload',
            'dfx_setting_pageMode',
            'dfx_setting_singlePageMode',
            'dfx_setting_controlsPosition',
            'dfx_setting_enableAutoPlay',
            'dfx_setting_enableAutoPlayAutomatically',
              'dfx_setting_thumb_type',
                'dfx_setting_enableAnalytics',
                'dfx_setting_enableZoomOnScroll',
                'dfx_setting_bgColor',
                'dfx_setting_bgImage',
                'dfx_setting_containerHeight',
                'dfx_setting_paddingLeft',
                'dfx_setting_paddingRight',
                'dfx_setting_flipduration',
                'dfx_setting_zoomRatio',
                'dfx_setting_paperStiffness',
                'dfx_setting_moreControls',
                'dfx_settings_hide_controls',
                'dfx_setting_disablePartialLoading',
                'dfx_setting_pdfPartialLoadingChunkSize',
                'dfx_setting_autoplayDuration',
                'dfx_setting_pdfLinkOpenTarget',


            'dfx_settings_translate_loading_message',
            'dfx_settings_translate_turn_on_off_sound',
            'dfx_settings_translate_toggle_thumbnails',
            'dfx_settings_translate_toggle_outline_bookmark',
            'dfx_settings_translate_previous_page' ,
            'dfx_settings_translate_next_page',
            'dfx_settings_translate_toggle_fullscreen',
            'dfx_settings_translate_zoom_in',
            'dfx_settings_translate_zoom_out',
            'dfx_settings_translate_toggle_help',
            'dfx_settings_translate_single_page_mode',
            'dfx_settings_translate_double_page_mode',
            'dfx_settings_translate_download_pdf_file',
            'dfx_settings_translate_goto_first_page',
            'dfx_settings_translate_goto_last_page',
            'dfx_settings_translate_play',
            'dfx_settings_translate_pause',
            'dfx_settings_translate_share',
            'dfx_settings_translate_share_mail_subject',
            'dfx_settings_translate_share_mail_message'

        );

        $query->from( '#__dearflipsetting' );
        $db->setQuery( (string)$query );
        $messages = $db->loadObjectList();
        $options  = array();

        if ( $messages ) {
            foreach ( $messages as $message ) {
                $options[] = JHtml::_( 'select.option', $message->id, $message->dfx_setting_3d_2d);
            }
        }

        $options = array_merge( parent::getOptions(), $options );

        return $options;
    }
}
