<?php

defined( '_JEXEC' ) or die( 'resticted aceess' );

AddonParser::addAddon( 'sp_heading', 'sp_heading_addon' );

function sp_heading_addon( $atts ) {
	$class = $alignment = $color = $title_color = $content_hd = $title = $show_line = '';
	extract( spAddonAtts( array(
		"title"              => '',
		"title_color"        => '',
		"content_hd"         => '',
		"alignment"		     => '',
		"class"              => '',
		"show_line" => '',
	), $atts ) );
	ob_start();
	?>
	<div class="ob_heading <?php echo $alignment;?>">
		<?php if($title) {?>
		<div class="title">
			<h2<?php if($title_color) echo ' style="color: '.$title_color.';"';?>><?php echo $title;?></h2>
		</div>
		<?php }?>
		<?php if($content_hd) { ?>
		<div class="content_hd"<?php if($color) echo ' style="color: '.$color.';"';?>><?php echo $content_hd;?></div>
		<?php }?>
		<?php if($show_line) { ?>
			<span class="line"<?php if($color) echo ' style="border-color: '.$color.';"';?>></span>
		<?php }?>
	</div>
	<?php
	$html = ob_get_clean();
	return $html;
}