<?php

class Intense_Definition extends Intense_Shortcode {

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

		global $intense_visions_options;

		$this->title = __( 'Definition', 'intense' );
		$this->category = __( 'Typography', 'intense' );
		$this->show_preview = true;
		$this->hidden = true;
		$this->parent = 'intense_definitions';
	}

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

		$output = '';

		if (isset( $term )) {
			$output .= "<dt>" . do_shortcode( $term ) . "</dt>";
		}

		if (!isset( $definition )) {
			$definition = $content;
		}

		$output .= "<dd>" . do_shortcode( $definition ) . "</dd>";

		return $output;
	}
}

/* intense_term is a deprecated shortcode */
add_shortcode( 'intense_term', 'intense_term_shortcode' );
function intense_term_shortcode( $atts, $content = null ) {
	return "<dt>" . do_shortcode( $content ) . "</dt>";
}