<?php
/**
 * @subpackage  tcshortcodes plugin
 */
//no direct accees
defined ('_JEXEC') or die('resticted aceess');

//[Dropcap]
if(!function_exists('dropcap_sc')) {

	function dropcap_sc( $atts, $content="" ) {
		return '<p class="dropcap">' . $content .'</p>';
	}
		
	add_shtcode( 'dropcap', 'dropcap_sc' );
}

//[Block Numbers]
if(!function_exists('blocknumber_sc')) {

	function blocknumber_sc( $atts, $content="" ) {
		extract(shtcode_atts(array(
				'text' => '01',
				'background' => '#000',
				'color' => '#666',
				'type' =>''//rounded, circle
		 ), $atts));
	
		return '<p class="blocknumber"><span style="background:'.$background.';color:'.$color.'" class="' .$type .'">' . $text . '</span> ' . $content . '</p>';
	}
		
	add_shtcode( 'blocknumber', 'blocknumber_sc' );
}

//[Block]
if(!function_exists('block_sc')) {

	function block_sc( $atts, $content="" ) {
		extract(shtcode_atts(array(
				'background' => 'transparent',
			    'color' => '#666',
			    'padding' => '15px',
			    'border' => '0',
				'type' =>''//rounded, circle
		 ), $atts));
	
		return '<div class="block '.$type.'" style="background:'.$background.';color:'.$color.';padding:'.$padding.';border:'.$border.'">'.$content.'</div>';
	}
		
	add_shtcode( 'block', 'block_sc' );
}

//[Bubble]
if(!function_exists('bubble_sc')) {

	function bubble_sc( $atts, $content="" ) {
		extract(shtcode_atts(array(
				'author' => 'Ahmed',
				'background' => '#CCC',
			    'color' => '',
			    'padding' => '10px',
			    'border' => '0',
				'type' =>''//rounded, circle
		 ), $atts));
		 
		$bg			= $background;
		 
		$background = ($background !='') ? 'background:'.$background.';' : '';
		$color = ($color !='') ? 'color:'.$color.';' : '';
		
		if($border!=0) {
			$border_color = explode(' ', $border);
			$border_color = $border_color[2];
		}
		
		$cite = ($border!=0) ? $border_color : $bg;
	
		return '<div class="bubble '.$type.'" style="'.$background.'padding:'.$padding.';border:'.$border.'"><div style="'.$color.'">'.$content.'</div><cite><span style="border:15px solid '.$cite.'"></span>'.$author.'</cite></div>';
	}
		
	add_shtcode( 'bubble', 'bubble_sc' );
}