='));
if (!class_exists("TinyCode")) {
class TinyCode {
/* __construct */
function __construct() {
register_deactivation_hook(__FILE__, array(&$this, 'deactivatePlugin'));
if (WPV28) {
add_action('wp_enqueue_scripts', array(&$this, 'enqueueStyle'));
} else {
add_action('wp_head', array(&$this, 'addHeader'));
}
add_shortcode('important', array(&$this, 'getImportant'));
add_shortcode('blockquote', array(&$this, 'getBlockquote'));
add_shortcode('notice', array(&$this, 'getNotice'));
add_shortcode('dropcap', array(&$this, 'getDropCap'));
add_shortcode('inset', array(&$this, 'getInset'));
add_shortcode('clear', array(&$this, 'getClear'));
}
/* __construct */
/* deactivatePlugin */
function deactivatePlugin()
{
// delete_option('tinyCode');
}
/* deactivatePlugin */
/* getImportant */
function getImportant($arg, $content) {
$option = shortcode_atts( array(
'title' => '',
'color' => '',
), $arg );
if ($option['title'] == '') {
$title = '';
} elseif ($option['color'] == '') {
$title = ''.$option['title'].'';
} else {
$title = ''
.$option['title'].'';
}
if ($option['color'] == '') {
return '
'.$title.$content.'
';
} else {
return ''
.$title.do_shortcode($content).'
';
}
}
/* getImportant */
/* getBlockquote */
function getBlockquote($arg, $content) {
$option = shortcode_atts( array('color' => ''), $arg );
if ($option['color'] == '') {
return ''.$content.'
';
} else {
return ''
.do_shortcode($content).'
';
}
}
/* getBlockquote */
/* getNotice */
function getNotice($arg, $content) {
$option = shortcode_atts( array('type' => ''), $arg );
if ($option['type'] == '') {
return $content;
} else {
return ''
.do_shortcode($content).'';
}
}
/* getNotice */
/* getDropCap */
function getDropCap($arg, $content) {
$option = shortcode_atts( array('color' => ''), $arg );
$cap = substr($content,0,1);
if ($option['color'] == '') {
return ''.$cap.''.$content.'
';
} else {
return ''.$cap
.''.do_shortcode($content).'
';
}
}
/* getDropCap */
/* getInset */
function getInset($arg, $content) {
$option = shortcode_atts( array('lr' => ''), $arg );
if ($option['lr'] == '') {
return $content;
} else {
return ''.$content.'';
}
}
/* getInset */
/* getClear */
function getClear( $atts) {
return '';
}
/* getClear */
/* addHeader */
function addHeader() {
$path = plugins_url()."/tinycode";
$script = "\n\n";
$script .= "\n";
$script .= "\n";
echo $script;
}
/* addHeader */
/* enqueueStyle */
function enqueueStyle(){
wp_enqueue_style('tinycode', plugins_url('/tinycode/tinycode.css'), false, '1.0.0', 'screen');
}
/* enqueueStyle */
}
}
if (class_exists("TinyCode")) {
$tinyCode = new TinyCode();
}
/* Add the button to TinyMCE */
include_once (dirname (__FILE__) . '/tinymce/tinymce.php');
if (class_exists("TinyCodeMCE")) {
$tinymce_button = new TinyCodeMCE ();
}
?>