<?php
/**
 * @version        1.9.7
 * @package        Joomla
 * @subpackage     Edocman
 * @author         Dang Thuc Dam
 * @copyright      Copyright (C) 2011 - 2025 Ossolution Team
 * @license        GNU/GPL, see LICENSE.php
 */

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die ;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Editor\Editor;
use Joomla\CMS\Factory;
/**
 * HTML View class for Edocman component
 *
 * @static
 * @package        Joomla
 * @subpackage     EDocman
 */
class EdocmanViewConfigurationHtml extends OSViewHtml
{
    public static function showCheckboxfield($name, $value ,$option1='',$option2='')
    {

        if($option1 == ""){
            $option1 = Text::_('JNO');
        }
        if($option2 == ""){
            $option2 = Text::_('JYES');
        }

        HTMLHelper::_('jquery.framework');
        $field = FormHelper::loadFieldType('Radio');

        $element = new SimpleXMLElement('<field />');
        $element->addAttribute('name', $name);

        if (EdocmanHelper::isJoomla4())
        {
            $element->addAttribute('layout', 'joomla.form.field.radio.switcher');
        }
        else
        {
            $element->addAttribute('class', 'radio btn-group btn-group-yesno');
        }

        $element->addAttribute('default', '0');

        $node = $element->addChild('option', $option1);
        $node->addAttribute('value', '0');

        $node = $element->addChild('option', $option2);
        $node->addAttribute('value', '1');

        $field->setup($element, $value);

        return $field->input;
    }

	function display($tpl = null)
	{	
		EDocmanHelperHtml::renderSubmenu('configuration');
		$config = EDocmanHelper::loadConfig();
		$db		= $db = Factory::getContainer()->get('db');;
		if (!Factory::getApplication()->getIdentity()->authorise('core.admin', 'com_edocman')) 
		{
			Factory::getApplication()->enqueueMessage(Text::_('JERROR_ALERTNOAUTHOR'));
			Factory::getApplication()->redirect('index.php');
		}

		$lists['enable_massdownload']			= self::showCheckboxfield('enable_massdownload',(int)$config->get('enable_massdownload'));

		$lists['overwrite_existing_file']		= self::showCheckboxfield('overwrite_existing_file',(int)$config->get('overwrite_existing_file'));

		$lists['position_of_unique_number']		= self::showCheckboxfield('position_of_unique_number',(int)$config->get('position_of_unique_number'), Text::_('EDOCMAN_BEFORE'),Text::_('EDOCMAN_AFTER'));

		$lists['show_update_available_message_in_dashboard']                      = self::showCheckboxfield('show_update_available_message_in_dashboard',(int)$config->show_update_available_message_in_dashboard);

		$lists['theme_type']					= self::showCheckboxfield('theme_type',(int)$config->get('theme_type'), Text::_('EDOCMAN_BRIGHT_LAYOUT1'), Text::_('EDOCMAN_DARK_LAYOUT'));

		$lists['use_combo_tree']				= self::showCheckboxfield('use_combo_tree',(int)$config->get('use_combo_tree'));

		$lists['human_title']					= self::showCheckboxfield('human_title',(int)$config->get('human_title'));

		$lists['show_site_title']				= self::showCheckboxfield('show_site_title',(int)$config->get('show_site_title'));

		$lists['enable_rss']					= self::showCheckboxfield('enable_rss',(int)$config->get('enable_rss')); 

		$lists['process_plugin']				= self::showCheckboxfield('process_plugin',(int)$config->get('process_plugin'));  

		$lists['download_log']					= self::showCheckboxfield('download_log',(int)$config->get('download_log'));

        $lists['load_twitter_bootstrap']		= self::showCheckboxfield('load_twitter_bootstrap', $config->get('load_twitter_bootstrap')); 

		$lists['load_jquery']					= self::showCheckboxfield('load_jquery', $config->get('load_jquery'));

		$lists['load_bootstrap_css']			= self::showCheckboxfield('load_bootstrap_css', $config->get('load_bootstrap_css'));

		$lists['activate_herachical_folder_structure'] = self::showCheckboxfield('activate_herachical_folder_structure',(int)$config->get('activate_herachical_folder_structure')); 

		$lists['activate_multilingual_feature'] = self::showCheckboxfield('activate_multilingual_feature',(int)$config->get('activate_multilingual_feature'));

        $lists['access_level_inheritance']      = self::showCheckboxfield('access_level_inheritance',(int)$config->get('access_level_inheritance'));

		$lists['user_group_ids'] 				= self::showCheckboxfield('user_group_ids',(int)$config->get('user_group_ids'));

        $lists['remove_category_folder'] 		= self::showCheckboxfield('remove_category_folder',(int)$config->get('remove_category_folder'));

		$lists['force_lower_case'] 				= self::showCheckboxfield('force_lower_case', $config->get('force_lower_case') );

		$options 								= [];
		$options[] 								= HTMLHelper::_('select.option', 0, Text::_('Upload new file for each document'));
		$options[] 								= HTMLHelper::_('select.option', 1, Text::_('Choose file from server'));
		$options[] 								= HTMLHelper::_('select.option', 2, Text::_('Both - Available at Backend only'));
		
		$lists['file_upload_method'] = HTMLHelper::_('select.genericlist', $options, 'file_upload_method', 'class="inputbox chosen form-select"', 'value', 'text', $config->get('file_upload_method'));
		
		$options 								= [];
		$options[] 								= HTMLHelper::_('select.option',  0, Text::_('Select'));
		$options[] 								= HTMLHelper::_('select.option', '1', Text::_('Byte'));
		$options[] 								= HTMLHelper::_('select.option', '2', Text::_('Kb'));
		$options[] 								= HTMLHelper::_('select.option', '3', Text::_('Mb'));
		$lists['max_filesize_type'] = HTMLHelper::_('select.genericlist', $options, 'max_filesize_type', 'class="input-small chosen form-select ishort"', 'value', 'text',  $config->get('max_filesize_type',3) );
		
		$lists['require_admin_approve']			= self::showCheckboxfield('require_admin_approve',(int)$config->get('require_admin_approve'));  
																								
		$lists['download_notification']			= self::showCheckboxfield('download_notification',(int)$config->get('download_notification'));  

		//User upload settings			
		$lists['upload_notification']			= self::showCheckboxfield('upload_notification',(int)$config->get('upload_notification'));  
		
		$lists['document_assigned_notification'] = self::showCheckboxfield('document_assigned_notification',$config->get('document_assigned_notification')); 

		$lists['jcomment_integration'] = self::showCheckboxfield('jcomment_integration',(int)$config->get('jcomment_integration'));  
		
		$lists['delete_file_when_document_deleted'] = self::showCheckboxfield('delete_file_when_document_deleted',(int)$config->get('delete_file_when_document_deleted'));

		$lists['delete_file_when_uppload_new'] = self::showCheckboxfield('delete_file_when_uppload_new',(int)$config->get('delete_file_when_uppload_new'));


        $lists['move_document_when_changing_category'] = self::showCheckboxfield('move_document_when_changing_category',(int)$config->get('move_document_when_changing_category'));
		
		$lists['show_default_category_thumbnail'] = self::showCheckboxfield('show_default_category_thumbnail',(int)$config->get('show_default_category_thumbnail'));  

		$lists['show_default_document_thumbnail'] = self::showCheckboxfield('show_default_document_thumbnail',(int)$config->get('show_default_document_thumbnail'));
		
		$lists['show_icon_beside_title']		= self::showCheckboxfield('show_icon_beside_title',(int)$config->get('show_icon_beside_title')); 
		
		$lists['show_add_sub_categories']		= self::showCheckboxfield('show_add_sub_categories',(int)$config->get('show_add_sub_categories'));  
		
		$lists['show_empty_cat']				= self::showCheckboxfield('show_empty_cat',(int)$config->get('show_empty_cat'));  

		$lists['show_number_documents']			= self::showCheckboxfield('show_number_documents',(int)$config->get('show_number_documents'));   

		$lists['show_number_downloads']			= self::showCheckboxfield('show_number_downloads',(int)$config->get('show_number_downloads'));   

		$lists['number_categories']				= self::showCheckboxfield('number_categories',(int)$config->get('number_categories'));  
				
		$lists['number_documents']				= self::showCheckboxfield('number_documents',(int)$config->get('number_documents'));   

		//Sub-categories settings
		$lists['show_subcategory_icon'] = self::showCheckboxfield('show_subcategory_icon',(int)$config->get('show_subcategory_icon'));  

		$lists['show_subcategory_text'] = self::showCheckboxfield('show_subcategory_text',(int)$config->get('show_subcategory_text'));  

		$lists['show_subcategory_description']	= self::showCheckboxfield('show_subcategory_description',(int)$config->get('show_subcategory_description'));  
		
		$lists['use_download_link_instead_of_detail_link'] = self::showCheckboxfield('use_download_link_instead_of_detail_link',(int)$config->get('use_download_link_instead_of_detail_link'));  

		$lists['category_table_show_filesize']	= self::showCheckboxfield('category_table_show_filesize',(int)$config->get('category_table_show_filesize'));  

		$lists['category_table_show_filetype']	= self::showCheckboxfield('category_table_show_filetype',(int)$config->get('category_table_show_filetype')); 

		$lists['show_no_download_permission_alert']	= self::showCheckboxfield('show_no_download_permission_alert',(int)$config->get('show_no_download_permission_alert'));

		$lists['show_view_button']				= self::showCheckboxfield('show_view_button',(int)$config->get('show_view_button'));

		$lists['keep_previous_versions']		= self::showCheckboxfield('keep_previous_versions',(int)$config->get('keep_previous_versions'));

		$lists['show_view_button_table']		= self::showCheckboxfield('show_view_button_table',(int)$config->get('show_view_button_table'));

		$lists['view_url']						= self::showCheckboxfield('view_url',(int)$config->get('view_url'));

		$lists['hide_download_button']			= self::showCheckboxfield('hide_download_button',(int)$config->get('hide_download_button')); 

		$lists['show_hits']						= self::showCheckboxfield('show_hits',(int)$config->get('show_hits')); 

		$lists['show_filename']					= self::showCheckboxfield('show_filename',(int)$config->get('show_filename')); 

		$lists['show_filesize']					= self::showCheckboxfield('show_filesize',(int)$config->get('show_filesize')); 

		$lists['show_filetype']					= self::showCheckboxfield('show_filetype',(int)$config->get('show_filetype')); 

		$lists['show_creation_date']			= self::showCheckboxfield('show_creation_date',(int)$config->get('show_creation_date'));

		$lists['show_creation_user']			= self::showCheckboxfield('show_creation_user',(int)$config->get('show_creation_user'));

		$lists['show_number_downloaded']		= self::showCheckboxfield('show_number_downloaded',(int)$config->get('show_number_downloaded'));

		$lists['show_modified_date']			= self::showCheckboxfield('show_modified_date',(int)$config->get('show_modified_date')); 

		$lists['show_detail_in_popup']			= self::showCheckboxfield('show_detail_in_popup',(int)$config->get('show_detail_in_popup')); 

		$lists['show_description_in_columns']	= self::showCheckboxfield('show_description_in_columns',(int)$config->get('show_description_in_columns')); 

		$lists['show_publish_date']				= self::showCheckboxfield('show_publish_date',(int)$config->get('show_publish_date')); 

		$lists['show_modify_date']				= self::showCheckboxfield('show_modify_date',(int)$config->get('show_modify_date')); 

		$lists['hide_details_button']			= self::showCheckboxfield('hide_details_button',(int)$config->get('hide_details_button'));

		$lists['show_bookmark_in_list']			= self::showCheckboxfield('show_bookmark_in_list',(int)$config->get('show_bookmark_in_list'));

        $lists['show_sort_options']				= self::showCheckboxfield('show_sort_options',(int)$config->get('show_sort_options'));

		$lists['show_document_version']			= self::showCheckboxfield('show_document_version',(int)$config->get('show_document_version'));

        $lists['reset_downloadlog']				= self::showCheckboxfield('reset_downloadlog',(int)$config->get('reset_downloadlog'));

		$lists['use_googleviewer']				= self::showCheckboxfield('use_googleviewer',(int)$config->get('use_googleviewer'));

		$lists['showing_document_googleviewer']	= self::showCheckboxfield('showing_document_googleviewer',(int)$config->get('showing_document_googleviewer'));

		$lists['show_tablelayoutheader']		= self::showCheckboxfield('show_tablelayoutheader',(int)$config->get('show_tablelayoutheader'));

        $lists['show_tablelayoutdescription']   = self::showCheckboxfield('show_tablelayoutdescription',(int)$config->get('show_tablelayoutdescription'));

        $lists['show_tablelayoutthumbnail']     = self::showCheckboxfield('show_tablelayoutthumbnail',(int)$config->get('show_tablelayoutthumbnail'));

        $lists['login_to_download']				= self::showCheckboxfield('login_to_download',(int)$config->get('login_to_download'));

		$lists['edocman_login']					= self::showCheckboxfield('edocman_login',(int)$config->get('edocman_login'), Text::_('EDOCMAN_LOGIN'),Text::_('EDOCMAN_JOOMLA_LOGIN'));

		$lists['lock_function']					= self::showCheckboxfield('lock_function',(int)$config->get('lock_function'));

		$lists['owner_assigned']				= self::showCheckboxfield('owner_assigned',(int)$config->get('owner_assigned'));

        $lists['owner_inheritance']				= self::showCheckboxfield('owner_inheritance',(int)$config->get('owner_inheritance'));

		$lists['owner_inheritance_categories']				= self::showCheckboxfield('owner_inheritance_categories',(int)$config->get('owner_inheritance_categories'));

        $options = [];
        $options[] 								= HTMLHelper::_('select.option', '0', Text::_('EDOCMAN_USERDOCUMENTS'));
        $options[] 								= HTMLHelper::_('select.option', '1', Text::_('EDOCMAN_CATEGORY_PAGE'));
        $options[] 								= HTMLHelper::_('select.option', '2', Text::_('EDOCMAN_JOOMLA_HOMEPAGE'));
        $lists['redirect_after_uploading']      = HTMLHelper::_('select.genericlist', $options, 'redirect_after_uploading', 'class="input-large ilarge form-select"', 'value', 'text', $config->get('redirect_after_uploading'));

        $options = [];
		$options[] 								= HTMLHelper::_('select.option', 'tbl.title', Text::_('EDOCMAN_TITLE'));
		$options[] 								= HTMLHelper::_('select.option', 'tbl.created_time', Text::_('JGLOBAL_CREATED_DATE'));
		$options[] 								= HTMLHelper::_('select.option', 'tbl.publish_up', Text::_('JGLOBAL_FIELD_PUBLISH_UP_LABEL'));
        $options[] 								= HTMLHelper::_('select.option', 'tbl.modified_time', Text::_('JGLOBAL_FIELD_MODIFIED_LABEL'));
		$options[]								= HTMLHelper::_('select.option', 'tbl.ordering', Text::_('EDOCMAN_ORDERING'));
        $options[]  							= HTMLHelper::_('select.option', 'tbl.file_size', Text::_('EDOCMAN_FILESIZE'));
		$lists['default_sort_option'] = HTMLHelper::_('select.genericlist', $options, 'default_sort_option', 'class="chosen form-select"', 'value', 'text', $config->get('default_sort_option','tbl.ordering') );


		$options = [];
		$options[] 								= HTMLHelper::_('select.option', 'tbl.title', Text::_('EDOCMAN_TITLE'));
		$options[] 								= HTMLHelper::_('select.option', 'tbl.created_time', Text::_('JGLOBAL_CREATED_DATE'));
        $options[] 								= HTMLHelper::_('select.option', 'tbl.modified_time', Text::_('JGLOBAL_FIELD_MODIFIED_LABEL'));
		$options[]								= HTMLHelper::_('select.option', 'tbl.ordering', Text::_('EDOCMAN_ORDERING'));
		$lists['default_category_sort_option']  = HTMLHelper::_('select.genericlist', $options, 'default_category_sort_option', 'class="chosen form-select"', 'value', 'text',  $config->get('default_category_sort_option', 'tbl.ordering') );

		$options								= [];
		$options[]								= HTMLHelper::_('select.option', 4, Text::_('EDOCMAN_VERSION_4'));
		if (EdocmanHelper::isJoomla4())
		{
			$options[] = HTMLHelper::_('select.option', 5, Text::_('EDOCMAN_VERSION_5'));
		}
		$options[]								= HTMLHelper::_('select.option', 6, Text::_('EDOCMAN_UIKIT3'));
		$lists['twitter_bootstrap_version']		= HTMLHelper::_('select.genericlist', $options, 'twitter_bootstrap_version', 'class=" form-select ilarge input-large"', 'value', 'text',  $config->get('twitter_bootstrap_version',5) );

		$db->setQuery("Update #__edocman_configs set config_value = '5' where config_key = 'twitter_bootstrap_version' and config_value in ('','2','3')");
		$db->execute();

		$options 								= [];
		$options[] 								= HTMLHelper::_('select.option', 0, Text::_('Self'));
		$options[] 								= HTMLHelper::_('select.option', 1, Text::_('Blank'));
		$lists['external_download_link'] = HTMLHelper::_('select.genericlist', $options, 'external_download_link', 'class="input-large ilarge form-select"', 'value', 'text',$config->get('external_download_link',0));

		$options 								= [];
		$options[] 								= HTMLHelper::_('select.option', 'asc', Text::_('EDOCMAN_ASC'));
		$options[] 								= HTMLHelper::_('select.option', 'desc', Text::_('EDOCMAN_DESC'));
		$lists['default_sort_direction']		= HTMLHelper::_('select.genericlist', $options, 'default_sort_direction', 'class="chosen form-select"', 'value', 'text', $config->get('default_sort_direction'));

		$lists['default_categoty_sort_direction']		= HTMLHelper::_('select.genericlist', $options, 'default_categoty_sort_direction', 'class="chosen form-select"', 'value', 'text', $config->get('default_categoty_sort_direction'));

		$lists['show_uploader_name_in_document_mamangement'] = self::showCheckboxfield('show_uploader_name_in_document_mamangement',(int)$config->get('show_uploader_name_in_document_mamangement')); 

        $lists['show_social_sharing_buttons']	= self::showCheckboxfield('show_social_sharing_buttons',(int)$config->get('show_social_sharing_buttons')); 

		$lists['show_bookmark_button']			= self::showCheckboxfield('show_bookmark_button',(int)$config->get('show_bookmark_button')); 

		//Fields configuration		
        //$lists['use_simple_upload_form']		= self::showCheckboxfield('use_simple_upload_form',(int)$config->get('use_simple_upload_form'));

        $options 								= [];
        $options[] 								= HTMLHelper::_('select.option', '0', Text::_('EDOCMAN_DEFAULT_FORM'));
        $options[] 								= HTMLHelper::_('select.option', '1', Text::_('EDOCMAN_SIMPLE_FORM'));
        $options[] 								= HTMLHelper::_('select.option', '2', Text::_('EDOCMAN_AJAX_UPLOAD'));
        $lists['use_simple_upload_form']		= HTMLHelper::_('select.genericlist', $options, 'use_simple_upload_form', 'class="chosen form-select"', 'value', 'text', $config->get('use_simple_upload_form'));

		$lists['show_alias_form']				= self::showCheckboxfield('show_alias_form', $config->get('show_alias_form') );

		$lists['show_thumb_form']				= self::showCheckboxfield('show_thumb_form', $config->get('show_thumb_form'));

		$lists['show_lock_form']				= self::showCheckboxfield('show_lock_form', $config->get('show_lock_form') );

		$lists['show_published_form']			= self::showCheckboxfield('show_published_form' ,$config->get('show_published_form') );

		$lists['show_meta_form']				= self::showCheckboxfield('show_meta_form', $config->get('show_meta_form') );

		$lists['show_license_form']				= self::showCheckboxfield('show_license_form', $config->get('show_license_form') );

		$lists['show_tag_form']					= self::showCheckboxfield('show_tag_form', $config->get('show_tag_form') );

		$lists['insert_document_id']			= self::showCheckboxfield('insert_document_id',(int)$config->get('insert_document_id'));

        $lists['insert_category_id']			= self::showCheckboxfield('insert_category_id',(int)$config->get('insert_category_id'));

		$lists['use_default_license']			= self::showCheckboxfield('use_default_license',(int)$config->get('use_default_license'));

        $lists['accept_license']				= self::showCheckboxfield('accept_license',(int)$config->get('accept_license'));

		$lists['gallery_picture_type']			= self::showCheckboxfield('gallery_picture_type',(int)$config->get('gallery_picture_type'), Text::_('EDOCMAN_LANDSCAPE'), Text::_('EDOCMAN_PORTRAIT'));

		$lists['accept_license_one_time']		= self::showCheckboxfield('accept_license_one_time',(int)$config->get('accept_license_one_time'));

        $lists['search_with_sub_cats']			= self::showCheckboxfield('search_with_sub_cats',(int)$config->get('search_with_sub_cats'));

		$lists['save_what_user_search']			= self::showCheckboxfield('save_what_user_search',(int)$config->get('save_what_user_search'));

		$lists['turn_on_sharing']				= self::showCheckboxfield('turn_on_sharing',(int)$config->get('turn_on_sharing'));

        $lists['turn_on_privacy']				= self::showCheckboxfield('turn_on_privacy',(int)$config->get('turn_on_privacy'));

        $lists['default_style']				    = self::showCheckboxfield('default_style',(int)$config->get('default_style'), Text::_('EDOCMAN_LIST'), Text::_('EDOCMAN_GRID'));;

        $lists['show_category_name']			= self::showCheckboxfield('show_category_name',(int)$config->get('show_category_name'));

		$lists['view_option']					= self::showCheckboxfield('view_option',(int)$config->get('view_option'),Text::_('EDOCMAN_MODAL_BOX'),Text::_('EDOCMAN_NEW_WINDOW'));

		$lists['pdf_view_option']				= self::showCheckboxfield('pdf_view_option',(int)$config->get('pdf_view_option'),Text::_('EDOCMAN_MODAL_BOX'),Text::_('EDOCMAN_NEW_WINDOW'));

		$lists['pdf_view_type']					= self::showCheckboxfield('pdf_view_type',(int)$config->get('pdf_view_type'),Text::_('EDOCMAN_VIEWER_TOOL'),Text::_('EDOCMAN_BROWSER_HANDLE'));

        $lists['show_newsletter_subscription']  = self::showCheckboxfield('view_option',(int)$config->get('show_newsletter_subscription'));

        $lists['show_related_documents']        = self::showCheckboxfield('show_related_documents',(int)$config->get('show_related_documents'));

        $lists['related_documents_in_same_cat'] = self::showCheckboxfield('related_documents_in_same_cat',(int)$config->get('related_documents_in_same_cat'));

        $lists['related_documents_in_author']   = self::showCheckboxfield('related_documents_in_author',(int)$config->get('related_documents_in_author'));

        $lists['related_documents_in_tags']     = self::showCheckboxfield('related_documents_in_tags',(int)$config->get('related_documents_in_tags'));

        $lists['increase_document_version']     = self::showCheckboxfield('increase_document_version',(int)$config->get('increase_document_version'));

		$lists['show_no_document_available_text']     = self::showCheckboxfield('show_no_document_available_text',(int)$config->get('show_no_document_available_text'));

		$lists['enable_rating']					= self::showCheckboxfield('enable_rating',(int)$config->get('enable_rating'));

		$lists['change_archieve']				= self::showCheckboxfield('change_archieve',(int)$config->get('change_archieve'));
		$lists['hide_search_engines']			= self::showCheckboxfield('hide_search_engines',(int)$config->get('hide_search_engines'));

		$options								= [];
		$options[]								= HTMLHelper::_('select.option', 0, Text::_('All nested categories'));
		$options[]								= HTMLHelper::_('select.option', 1, Text::_('Only the last one'));
		$options[]								= HTMLHelper::_('select.option', 2, Text::_('No insert'));
		$lists['insert_category']				= HTMLHelper::_('select.genericlist', $options, 'insert_category', ' class="form-select input-medium chosen"', 'value', 'text', $config->get('insert_category'));

		$options								= [];
		$options[]								= HTMLHelper::_('select.option', 1, 1);
		$options[]								= HTMLHelper::_('select.option', 2, 2);
		$options[]								= HTMLHelper::_('select.option', 3, 3);
		$options[]								= HTMLHelper::_('select.option', 4, 4);
		$options[]								= HTMLHelper::_('select.option', 6, 6);
		$lists['number_categories_per_row']		= HTMLHelper::_('select.genericlist', $options, 'number_categories_per_row', ' class="input-mini chosen form-select"', 'value', 'text',  $config->get('number_categories_per_row',2) );

        $options								= [];
        $options[]								= HTMLHelper::_('select.option', 2, 2);
        $options[]								= HTMLHelper::_('select.option', 3, 3);
        $options[]								= HTMLHelper::_('select.option', 4, 4);
        $lists['number_documents_in_grid']		= HTMLHelper::_('select.genericlist', $options, 'number_documents_in_grid', ' class="input-mini chosen form-select"', 'value', 'text', $config->get('number_documents_in_grid',2) );

        $options								= [];
        $options[]								= HTMLHelper::_('select.option', 2, 2);
        $options[]								= HTMLHelper::_('select.option', 3, 3);
        $options[]								= HTMLHelper::_('select.option', 4, 4);
		$options[]								= HTMLHelper::_('select.option', 6, 6);
        $lists['number_columns']		        = HTMLHelper::_('select.genericlist', $options, 'number_columns', ' class="input-mini chosen form-select"', 'value', 'text', $config->get('number_columns',2) );

		$options 								= [];
		$options[]								= HTMLHelper::_('select.option', 1, 1);
		$options[]								= HTMLHelper::_('select.option', 2, 2);
		$options[] 								= HTMLHelper::_('select.option', 3, 3);
		$options[] 								= HTMLHelper::_('select.option', 4, 4);
		$options[] 								= HTMLHelper::_('select.option', 6, 6);
		$lists['number_subcategories']			= HTMLHelper::_('select.genericlist', $options, 'number_subcategories', ' class="input-mini chosen form-select"', 'value', 'text', $config->get('number_subcategories',2));

		// Collect downloader information
		$lists['collect_downloader_information'] = self::showCheckboxfield('collect_downloader_information',(int)$config->get('collect_downloader_information')); 
		$lists['onetime_collect'] = self::showCheckboxfield('onetime_collect',(int)$config->get('onetime_collect')); 

		$options 								= [];
		$options[] 								= HTMLHelper::_('select.option', 0, Text::_('EDOCMAN_DIRECT_DOWNLOAD'));
		$options[] 								= HTMLHelper::_('select.option', 1, Text::_('EDOCMAN_SEND_DOWNLOAD_LINK'));
		$lists['download_type']					= HTMLHelper::_('select.genericlist', $options, 'download_type', ' class="inputbox chosen form-select"', 'value', 'text', $config->get('download_type',1));

        $options 								= [];
        $options[] 								= HTMLHelper::_('select.option', 0, Text::_('EDOCMAN_DEFAULT_LAYOUT'));
        $options[] 								= HTMLHelper::_('select.option', 1, Text::_('EDOCMAN_BLOG_LAYOUT'));
        $lists['document_details_layout']	    = HTMLHelper::_('select.genericlist', $options, 'document_details_layout', ' class="inputbox chosen form-select"', 'value', 'text',  $config->get('document_details_layout',0));

		$options    = [];
		$options [] = HTMLHelper::_('select.option', 0, Text::_('EDOCMAN_NO_INTEGRATION'));
		if (file_exists(JPATH_ROOT . '/components/com_comprofiler/comprofiler.php'))
		{
			$options[] = HTMLHelper::_('select.option', 1, Text::_('Community Builder'));
		}
		if (file_exists(JPATH_ROOT . '/components/com_community/community.php'))
		{
			$options[] = HTMLHelper::_('select.option', 2, Text::_('JomSocial'));
		}
        if (file_exists(JPATH_ROOT . '/components/com_jsn/jsn.php'))
        {
            $options[] = HTMLHelper::_('select.option', 3, Text::_('Easy Profile'));
        }
        if (file_exists(JPATH_ROOT . '/components/com_easysocial/easysocial.php'))
        {
            $options[] = HTMLHelper::_('select.option', 4, Text::_('Easy Social'));
        }

		$lists ['profile_integration']           = HTMLHelper::_('select.genericlist', $options, 'profile_integration', 'class="form-select input-large ilarge"', 'value', 'text', (int)$config->get('profile_integration'));

		$lists['make_filename_safely']				= self::showCheckboxfield('make_filename_safely',(int)$config->get('make_filename_safely'));

		$path = JPATH_ROOT.'/edocman' ;
		$path = str_replace("\\", "/", $path) ;
		//Get tab object					
		$this->lists = $lists;
		$this->config =	$config;				
		$this->path = $path;	
		// We don't need toolbar in the modal window.
		if (version_compare(JVERSION, '3.0', 'ge')) {
			if ($this->getLayout() !== 'modal')
			{
				//EdocmanHelper::addSideBarmenus('configuration');
				//$this->sidebar = JHtmlSidebar::render();
			}
		}

		// Editor plugin for code editing
		$editorPlugin = null;

		if (PluginHelper::isEnabled('editors', 'codemirror'))
		{
			$editorPlugin = 'codemirror';
		}
		elseif (PluginHelper::isEnabled('editor', 'none'))
		{
			$editorPlugin = 'none';
		}

		if ($editorPlugin)
		{
			$this->editor = Editor::getInstance($editorPlugin);
		}

		$optionArr = [];
		for($i = 15;$i<=45;$i++)
		{
			$optionArr[] = HTMLHelper::_('select.option', $i, $i.' px');
		}
		$this->lists['heading_font_size'] = HTMLHelper::_('select.genericlist', $optionArr,'heading_font_size','class="form-select input-small ismall"','value','text',(int)$config->get('heading_font_size', 30));


		$optionArr = [];
		for($i = 15;$i<=35;$i++)
		{
			$optionArr[] = HTMLHelper::_('select.option', $i, $i.' px');
		}
		$this->lists['category_title_font_size'] = HTMLHelper::_('select.genericlist', $optionArr,'category_title_font_size','class="form-select input-small ismall"','value','text',(int)$config->get('category_title_font_size', 25));

		$optionArr = [];
		for($i = 13;$i<=30;$i++)
		{
			$optionArr[] = HTMLHelper::_('select.option', $i, $i.' px');
		}
		$this->lists['document_title_font_size'] = HTMLHelper::_('select.genericlist', $optionArr,'document_title_font_size','class="form-select input-small ismall"','value','text',(int)$config->get('document_title_font_size', 18));


		parent::display();
	}
}
