<?php
/**
 * Into Customizer Control
*/
if( ! class_exists( 'WP_Customize_Control' ) )
return;

if ( ! class_exists( 'Excel_Theme_Info_Text' ) ) {

	class Excel_Theme_Info_Text extends Wp_Customize_Control {
		
		public function render_content(){ ?>
    	    <span class="customize-control-title">
    			<?php echo esc_html( $this->label ); ?>
    		</span>
    
    		<?php if( $this->description ){ ?>
    			<span class="description customize-control-description">
    			<?php echo wp_kses_post($this->description); ?>
    			</span>
    		<?php }
        }
	}
}

function excel_blog_customizer_theme_info( $wp_customize ) {
	
    $wp_customize->add_section( 'theme_info', 
        array(
            'title'    => __( 'Important Links', 'excel-blog' ),
            'priority' => 6,
        )
    );
    
    /** Important Links */
	$wp_customize->add_setting( 'theme_info_theme',
        array(
            'default' => '',
            'sanitize_callback' => 'wp_kses_post',
        )
    );
    
    $theme_info = '<ul>';
	$theme_info .= sprintf( __( '<li>View demo: %1$sClick here%2$s</li>', 'excel-blog' ),  '<a href="' . esc_url( 'http://exceltheme.com/demo/excel-blog/' ) . '" target="_blank">', '</a>' );
    $theme_info .= sprintf( __( '<li>View documentation: %1$sClick here%2$s</li>', 'excel-blog' ),  '<a href="' . esc_url( 'http://exceltheme.com/documentation/excel-blog/' ) . '" target="_blank">', '</a>' );
    $theme_info .= sprintf( __( '<li>Theme info: %1$sClick here%2$s</li>', 'excel-blog' ),  '<a href="' . esc_url( 'http://exceltheme.com/wordpress-theme/excel-blog/' ) . '" target="_blank">', '</a>' );
    $theme_info .= sprintf( __( '<li>Support ticket: %1$sClick here%2$s</li>', 'excel-blog' ),  '<a href="' . esc_url( 'http://exceltheme.com/support/' ) . '" target="_blank">', '</a>' );
    $theme_info .= sprintf( __( '<li>Please %1$sreview us%2$s</li>', 'excel-blog' ),  '<a href="' . esc_url( 'https://wordpress.org/support/theme/excel-blog/reviews/' ) . '" target="_blank">', '</a>' );
    $theme_info .= '</ul>';

	$wp_customize->add_control( new Excel_Theme_Info_Text( $wp_customize,
        'theme_info_theme', 
            array(
                'label'       => __( 'Important Links', 'excel-blog' ),
                'section'     => 'theme_info',
                'description' => $theme_info
            )
        )
    );
    
}
add_action( 'customize_register', 'excel_blog_customizer_theme_info' );