<?php

class Intense_Template extends Intense_Shortcode {

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

		global $intense_visions_options;

		$this->title = __( 'Template', 'intense' );
		$this->description = __( 'Use the template shortcode to add the content of a file template to the post or page. 
			The file template, along with the template shortode, are a perfect way to add dynamic content. 
			They are also a powerful way to reuse content across your WordPress website. 
			All attributes added to the template will be passed through to the template file by way of a global $intense_template array.', 'intense' );
		$this->category = __( 'Elements', 'intense' );
		$this->show_preview = true;		
	}

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

		$intense_template = $atts;

		return intense_get_template( array(
			'/template/' . $template . '.php',
			'/template/blank.php'
		) );
	}
}
