<?php

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

AddonParser::addAddon( 'sp_position', 'sp_position_addon' );

function sp_position_addon( $atts ) {
	$class = $position = '';
	extract( spAddonAtts( array(
		"class"              => '',
	), $atts ) );
	ob_start();
	?>
	<div class="ob_position <?php echo $class;?>">
		<?php
		$position = "with_page";
		$document = JFactory::getDocument();
		$renderer   = $document->loadRenderer('modules');
		$options   = array('style' => 'sp_xhtml');
		echo $renderer->render($position, $options, null);
		?>
	</div>
	<?php
	$html = ob_get_clean();
	return $html;
}