<?php

class Intense_Label extends Intense_Shortcode {

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

        global $intense_visions_options;

        $this->title = __( 'Label', 'intense' );
        $this->description = __( 'The label shortcode can be used for any small piece of text that you want to highlight. Generally it is used like a tag. The label shortcode is also good to highlight new or unread items, categories, an item count, etc.', 'intense' );
        $this->category = __( 'Typography', 'intense' );
        $this->show_preview = true;
        $this->preview_content = __( "Label Text", 'intense' );
        $this->vc_map_content = 'textfield';
    }

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

        $id = ( !empty ( $id ) ) ? ' id="' . $id . '"' : '';
        $radius = '';
        if ( isset( $border_radius ) ) {
            $radius = ' border-radius:' . $border_radius . ';';
        }

        $color = intense_get_plugin_color( $color );
        $font_color = intense_get_plugin_color( $font_color );

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

        return "<span" . $id . " class='intense label" . ( !empty( $class ) ? ' ' . $class : '' ) . "' style='color: " . $font_color . "; background: " . $color  . ";" . $radius . "'>" . do_shortcode( $content ) . "</span>";
    }
}
