<?php

class Intense_Responsive_Utility extends Intense_Shortcode {

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

		global $intense_visions_options;

		$this->title = __( 'Responsive Utility', 'intense' );
		$this->description = __( 'The Responsive Utility Shortcode gives you the ability to hide or show elements on the page responsively for different device sizes. It can be used for showing and hiding content by device using media query. Also included are options for toggling content when printed.', 'intense' );
		$this->category = __( 'Layout', 'intense' );
		$this->show_preview = false;
		$this->is_container = true;
	}

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

		$style = "display: inline";

		return "<div " . ( isset( $id ) ? "id='$id' " : "" ) . " class='intense responsive-utility " .

			( $visible_large ? "visible-lg " : "" ) .
			( $visible_medium ? "visible-md " : "" ) .
			( $visible_small ? "visible-sm " : "" ) .
			( $visible_extra_small ? "visible-xs " : "" ) .
			( $visible_print ? "visible-print " : "" ) .

			( $hidden_large ? "hidden-lg " : "" ) .
			( $hidden_medium ? "hidden-md " : "" ) .
			( $hidden_small ? "hidden-sm " : "" ) .
			( $hidden_extra_small ? "hidden-xs " : "" ) .
			( $hidden_print ? "hidden-print " : "" ) .

			( !empty( $class ) ? $class . ' ' : '' ) .

			"' " . ( isset( $style ) ? "style='$style'" : "" ) . ">" . do_shortcode( $content ) . "</div>";
	}	
}
