<?php if ( ! defined( 'ABSPATH' ) ) {
	die;
} // Cannot access pages directly.
// ===============================================================================================
// -----------------------------------------------------------------------------------------------
// NAVIGATION OPTIONS
// -----------------------------------------------------------------------------------------------
// ===============================================================================================

// Control core classes for avoid errors
if( class_exists( 'CSF' ) ) {

    add_filter( 'csf_field_icon_add_icons', 'seosight_theme_icons' );

    function seosight_theme_icons( $icons ) {
        $icons[]  = array(
            'title' => 'Theme icon pack',
            'icons' => array(
                'seotheme seotheme-add-button',
                'seotheme seotheme-wifi',
                'seotheme seotheme-analytics',
                'seotheme seotheme-antenna',
                'seotheme seotheme-apps',
                'seotheme seotheme-arrows',
                'seotheme seotheme-at',
                'seotheme seotheme-backup',
                'seotheme seotheme-bag',
                'seotheme seotheme-bag-1',
                'seotheme seotheme-bag-2',
                'seotheme seotheme-bar-stats',
                'seotheme seotheme-basket',
                'seotheme seotheme-binary-code',
                'seotheme seotheme-chip',
                'seotheme seotheme-check-square',
                'seotheme seotheme-calendar',
                'seotheme seotheme-bug-free',
                'seotheme seotheme-bug',
                'seotheme seotheme-browser-visualization',
                'seotheme seotheme-browser-2',
                'seotheme seotheme-browser',
                'seotheme seotheme-bookmark',
                'seotheme seotheme-blogging',
                'seotheme seotheme-bitcoin',
                'seotheme seotheme-cloud-computing',
                'seotheme seotheme-cloud-connection',
                'seotheme seotheme-cloud-connections',
                'seotheme seotheme-cloud-data',
                'seotheme seotheme-cloud-data-1',
                'seotheme seotheme-cloud-network',
                'seotheme seotheme-cloud-sync',
                'seotheme seotheme-coding',
                'seotheme seotheme-compass',
                'seotheme seotheme-compass-1',
                'seotheme seotheme-compass-2',
                'seotheme seotheme-compass-3',
                'seotheme seotheme-computer',
                'seotheme seotheme-connections',
                'seotheme seotheme-cup',
                'seotheme seotheme-customer',
                'seotheme seotheme-design',
                'seotheme seotheme-devices',
                'seotheme seotheme-diagonal-enlarge',
                'seotheme seotheme-distiller',
                'seotheme seotheme-document-security',
                'seotheme seotheme-document-security-1',
                'seotheme seotheme-document-settings',
                'seotheme seotheme-dollar',
                'seotheme seotheme-folders',
                'seotheme seotheme-folder',
                'seotheme seotheme-flag',
                'seotheme seotheme-favorite',
                'seotheme seotheme-favorites-button',
                'seotheme seotheme-eye',
                'seotheme seotheme-euro',
                'seotheme seotheme-enlarge',
                'seotheme seotheme-email',
                'seotheme seotheme-efficency',
                'seotheme seotheme-downloading-from-smartphone',
                'seotheme seotheme-download',
                'seotheme seotheme-domain-registration',
                'seotheme seotheme-funnel',
                'seotheme seotheme-glasses',
                'seotheme seotheme-graph-search',
                'seotheme seotheme-group',
                'seotheme seotheme-high-volume',
                'seotheme seotheme-history-button',
                'seotheme seotheme-hourglass',
                'seotheme seotheme-hystogram',
                'seotheme seotheme-idea',
                'seotheme seotheme-image',
                'seotheme seotheme-key',
                'seotheme seotheme-keywords',
                'seotheme seotheme-microscope',
                'seotheme seotheme-microphone',
                'seotheme seotheme-menu-button',
                'seotheme seotheme-megaphone',
                'seotheme seotheme-medal',
                'seotheme seotheme-map',
                'seotheme seotheme-mail-settings',
                'seotheme seotheme-lock',
                'seotheme seotheme-link',
                'seotheme seotheme-light-bulb',
                'seotheme seotheme-letter',
                'seotheme seotheme-laptop',
                'seotheme seotheme-molecular',
                'seotheme seotheme-monitoring',
                'seotheme seotheme-mouse',
                'seotheme seotheme-music',
                'seotheme seotheme-mute',
                'seotheme seotheme-network',
                'seotheme seotheme-new-file',
                'seotheme seotheme-newspaper',
                'seotheme seotheme-next-page',
                'seotheme seotheme-no-bug',
                'seotheme seotheme-note',
                'seotheme seotheme-notification',
                'seotheme seotheme-pin',
                'seotheme seotheme-pie-graph-split',
                'seotheme seotheme-pie-graph-1',
                'seotheme seotheme-pie-graph',
                'seotheme seotheme-pie-chart',
                'seotheme seotheme-picture',
                'seotheme seotheme-phone-shop',
                'seotheme seotheme-pay-per-click',
                'seotheme seotheme-paper-plane',
                'seotheme seotheme-padlock',
                'seotheme seotheme-order',
                'seotheme seotheme-open-book',
                'seotheme seotheme-online-shop',
                'seotheme seotheme-pin-1',
                'seotheme seotheme-pin-settings',
                'seotheme seotheme-play-button',
                'seotheme seotheme-play-button-1',
                'seotheme seotheme-power',
                'seotheme seotheme-ranking',
                'seotheme seotheme-refresh-button',
                'seotheme seotheme-retweet',
                'seotheme seotheme-screen',
                'seotheme seotheme-search',
                'seotheme seotheme-search-1',
                'seotheme seotheme-search-engine',
                'seotheme seotheme-shopping-cart-1',
                'seotheme seotheme-shopping-cart',
                'seotheme seotheme-shopping',
                'seotheme seotheme-spider-web',
                'seotheme seotheme-speedometer',
                'seotheme seotheme-speech-bubbles',
                'seotheme seotheme-speech-balloon',
                'seotheme seotheme-shop',
                'seotheme seotheme-shield',
                'seotheme seotheme-social-media',
                'seotheme seotheme-smartphone-4',
                'seotheme seotheme-sharing-archives',
                'seotheme seotheme-shared-folder',
                'seotheme seotheme-smartphone-3',
                'seotheme seotheme-smartphone-2',
                'seotheme seotheme-settings',
                'seotheme seotheme-servers',
                'seotheme seotheme-smartphone-1',
                'seotheme seotheme-smartphone',
                'seotheme seotheme-server-and-cloud',
                'seotheme seotheme-server',
                'seotheme seotheme-sitemap',
                'seotheme seotheme-side-menu',
                'seotheme seotheme-security-data',
                'seotheme seotheme-search-engine-1',
                'seotheme seotheme-shopping-cart-2',
                'seotheme seotheme-star',
                'seotheme seotheme-tracker',
                'seotheme seotheme-translation',
                'seotheme seotheme-statistics',
                'seotheme seotheme-statistics-1',
                'seotheme seotheme-turn-right',
                'seotheme seotheme-typewriter',
                'seotheme seotheme-statistics-2',
                'seotheme seotheme-stats',
                'seotheme seotheme-upload-to-cloud',
                'seotheme seotheme-strategy',
                'seotheme seotheme-system',
                'seotheme seotheme-user',
                'seotheme seotheme-user-1',
                'seotheme seotheme-tags',
                'seotheme seotheme-target',
                'seotheme seotheme-user-stats',
                'seotheme seotheme-users',
                'seotheme seotheme-target-1',
                'seotheme seotheme-targeting',
                'seotheme seotheme-vertical-bar',
                'seotheme seotheme-vertical-bars',
                'seotheme seotheme-telephone',
                'seotheme seotheme-telephone-1',
                'seotheme seotheme-video',
                'seotheme seotheme-viral-marketing',
                'seotheme seotheme-whistle',
                'seotheme seotheme-browser-1',
                'seotheme seotheme-message',
                'seotheme seotheme-close',
                'seotheme seotheme-upload-arrow',
                'seotheme seotheme-arrows-1',
                'seotheme seotheme-target-search',
                'seotheme seotheme-arrows-2',
                'seotheme seotheme-business',
                'seotheme seotheme-business-1',
                'seotheme seotheme-button',
                'seotheme seotheme-coins',
                'seotheme seotheme-graphic',
                'seotheme seotheme-graphic-search',
                'seotheme seotheme-pie-chart-1',
                'seotheme seotheme-pie-graph-2',
                'seotheme seotheme-pie-graph-split-1',
                'seotheme seotheme-pin-2',
                'seotheme seotheme-search-1-1',
                'seotheme seotheme-settings-symbol-with-up-arrow-in-a-circle',
                'seotheme seotheme-target-audience',
                'seotheme seotheme-communication',
                'seotheme seotheme-mail-send'
            )
        );
      
        $icons = array_reverse( $icons );
      
        return $icons;
    }

    $prefix_nav_icon = 'seosight_menu_icon';

    CSF::createNavMenuOptions( $prefix_nav_icon, array(
        'data_type' => 'serialize', // The type of the database save options. `serialize` or `unserialize`
    ) );

    CSF::createSection( $prefix_nav_icon, array(
        'title'  => esc_html__( 'Icon', 'seosight' ),
        'fields' => array(
            array(
				'id' => 'icon_type',
				'type'	 => 'radio',
				'title'		 => false,
				'options'	 => array(
					'icon-font'	 => esc_html__( 'Fonts', 'seosight' ),
					'custom-upload' => esc_html__( 'Custom upload', 'seosight' ),
				),
                'default' => 'icon-font',
                'inline' => true
			),
            array(
                'id'    => 'icon_class',
                'type'  => 'icon',
                'title' => false,
                'dependency' => array( 'icon_type', '==', 'icon-font' ),
            ),
            array(
				'id'        => 'icon_url',
				'type'      => 'upload',
				'library'  => 'image',
				'title' => false,
                'dependency' => array( 'icon_type', '==', 'custom-upload' ),
			),
        )
    ) );
}