<?php

class Intense_Highlight extends Intense_Shortcode {

    function __construct() {
        parent::__construct();

        global $intense_visions_options;

        $this->title = __( 'Highlight', 'intense' );
        $this->description = __( 'Use the highlight shortcode to highlight text within your WordPress site. The highlight background color and font color can be customized to suite your needs. This shortcode is useful for making text stand out.', 'intense' );
        $this->category = __( 'Typography', 'intense' );
        $this->show_preview = true;
        $this->preview_content = __( "Highlighted Text", 'intense' );
        $this->vc_map_content = 'textfield';        
    }

    function shortcode( $atts, $content = null ) {
        extract( shortcode_atts( $this->get_shortcode_defaults( null, $atts ), $atts ) );

        $color = intense_get_plugin_color( $color );
        $font_color = intense_get_plugin_color( $font_color );
        $id = ( !empty ( $id ) ) ? ' id="' . $id . '"' : '';
        $class = ( !empty ( $class ) ) ? ' class="' . $class . '"' : '';

        if ( empty( $font_color ) ) {
            $font_color = intense_get_contract_color( $color );
        }

        return "<span" . $id . $class . " style='color: " . $font_color . "; background: " . $color  . "; padding: 0 3px;'>" . $content . "</span>";
    }
}
