<?php
/**
* @JoGadgets 0.4.x Image Editor Buttons Pack 
* @version : 1.0.0
* @date    : 2006-09-20
* @author  : Bernard Gilly
* @website : www.visualclinic.fr
*/

// no direct access
defined( '_VALID_MOS' ) or die( 'Restricted access' );
global $database;

// make sure ordering = 3 (after button mospagebreak)
$query = "UPDATE #__mambots SET ordering = 3"
. "\n WHERE element = 'jogadgetseditor.btn'"
. "\n AND folder = 'editors-xtd'"
;
$database->setQuery( $query );
$database->query();

// load mambot params info
$query = "SELECT params"
. "\n FROM #__mambots"
. "\n WHERE element = 'jogadgetseditor.btn'"
. "\n AND folder = 'editors-xtd'"
;
$database->setQuery( $query );
$database->loadObject($mambot);

// params mambot
$_MAMBOTS->_content_mambot_params['jogadgetseditorbtn'] = $mambot;
$botParams = new mosParameters( $mambot->params );

$botParams->def( 'jgthumb', 1 );
$botParams->def( 'jggallery', 1 );
$botParams->def( 'jgmedia', 1 );
$botParams->def( 'jginfobox', 1 );
$botParams->def( 'jgtabber', 1 );
$botParams->def( 'jgtooltips', 1 );
$botParams->def( 'jgtextimage', 1 );
$botParams->def( 'jgcontentbox', 1 );
$botParams->def( 'jgaccordion', 1 );
$botParams->def( 'jgquotes', 1 );
$botParams->def( 'jginclude', 1 );

// register function(s)
if( $botParams->get( 'jgthumb' ) ){ $_MAMBOTS->registerFunction( 'onCustomEditorButton', 'botjgthumbButton' ); }
if( $botParams->get( 'jggallery' ) ){ $_MAMBOTS->registerFunction( 'onCustomEditorButton', 'botjggalleryButton' ); }
if( $botParams->get( 'jgmedia' ) ){ $_MAMBOTS->registerFunction( 'onCustomEditorButton', 'botjgmediaButton' ); }
if( $botParams->get( 'jginfobox' ) ){ $_MAMBOTS->registerFunction( 'onCustomEditorButton', 'botjginfoboxButton' ); }
if( $botParams->get( 'jgtabber' ) ){ $_MAMBOTS->registerFunction( 'onCustomEditorButton', 'botjgtabberButton' ); }
if( $botParams->get( 'jgtooltips' ) ){ $_MAMBOTS->registerFunction( 'onCustomEditorButton', 'botjgtooltipsButton' ); }
if( $botParams->get( 'jgtextimage' ) ){ $_MAMBOTS->registerFunction( 'onCustomEditorButton', 'botjgtextimageButton' ); }
if( $botParams->get( 'jgcontentbox' ) ){ $_MAMBOTS->registerFunction( 'onCustomEditorButton', 'botjgcontentboxButton' ); }
if( $botParams->get( 'jgaccordion' ) ){ $_MAMBOTS->registerFunction( 'onCustomEditorButton', 'botjgaccordionButton' ); }
if( $botParams->get( 'jgquotes' ) ){ $_MAMBOTS->registerFunction( 'onCustomEditorButton', 'botjgquotesButton' ); }
if( $botParams->get( 'jginclude' ) ){ $_MAMBOTS->registerFunction( 'onCustomEditorButton', 'botjgincludephpButton' ); }

// candy thumb
function botjgthumbButton() {
	global $option;

	// button is not active in specific content components
	switch ( $option ) {
		case 'com_sections':
		case 'com_categories':
		case 'com_modules':
			$button = array( '', '' );
			break;

		default:
			$button = array( 'jgthumb.gif', '{jgxtimg src:=[path/image.jpg] width:=[320]}' );
			break;
	}

	return $button;
}

// candy gallery
function botjggalleryButton() {
	global $option;

	// button is not active in specific content components
	switch ( $option ) {
		case 'com_sections':
		case 'com_categories':
		case 'com_modules':
			$button = array( '', '' );
			break;

		default:
			$button = array( 'jggallery.gif', '{jgxgal folder:=[path/folder] cols:=[4]}' );
			break;
	}

	return $button;
}

// Include media file
function botjgmediaButton() {
	global $option;

	// button is not active in specific content components
	switch ( $option ) {
		case 'com_sections':
		case 'com_categories':
		case 'com_modules':
			$button = array( '', '' );
			break;

		default:
			$button = array( 'jgmedia.gif', '{jgmedia file:=[path/mediafile] width:=[386] height:=[288] autostart:=[false]}' );
			break;
	}

	return $button;
}

// Info Box
function botjginfoboxButton() {
	global $option;

	// button is not active in specific content components
	switch ( $option ) {
		case 'com_sections':
		case 'com_categories':
		case 'com_modules':
			$button = array( '', '' );
			break;

		default:
			$button = array( 'jginfobox.gif', '{jgibox title:=[test (click me)] style:=[width:320px;]}Your text here{/jgibox}' );
			break;
	}

	return $button;
}

// tabber
function botjgtabberButton() {
	global $option;

	// button is not active in specific content components
	switch ( $option ) {
		case 'com_sections':
		case 'com_categories':
		case 'com_modules':
			$button = array( '', '' );
			break;

		default:
			$button = array( 'jgtabber.gif', '{jgtabber}[tab ==tab 1==]Content 1[/tab][tab ==tab 2==]Content 2[/tab][tab ==tab 3==]Content 3[/tab]{/jgtabber}' );
			break;
	}

	return $button;
}

// Tooltips
function botjgtooltipsButton() {
	global $option;

	// button is not active in specific content components
	switch ( $option ) {
		case 'com_sections':
		case 'com_categories':
		case 'com_modules':
			$button = array( '', '' );
			break;

		default:
			$button = array( 'jgtooltips.gif', '{jgtip text:=[description tooltip]}...content...{/jgtip}' );
			break;
	}

	return $button;
}

// TextImage
function botjgtextimageButton() {
	global $option;

	// button is not active in specific content components
	switch ( $option ) {
		case 'com_sections':
		case 'com_categories':
		case 'com_modules':
			$button = array( '', '' );
			break;

		default:
			$button = array( 'jgtextimage.gif', '{jgitext text:=[Hello World!] size:=[30] color:=[000000] bgcolor:=[FFFFFF] font:=[default.ttf]}' );
			break;
	}

	return $button;
}

// Content-Box
function botjgcontentboxButton() {
	global $option;

	// button is not active in specific content components
	switch ( $option ) {
		case 'com_sections':
		case 'com_categories':
		case 'com_modules':
			$button = array( '', '' );
			break;

		default:
			$button = array( 'jgcontentbox.gif', '{jgbox linktext:=[open box]}...content to show...{/jgbox}' );
			break;
	}

	return $button;
}

// Accordion
function botjgaccordionButton() {
	global $option;

	// button is not active in specific content components
	switch ( $option ) {
		case 'com_sections':
		case 'com_categories':
		case 'com_modules':
			$button = array( '', '' );
			break;

		default:
			$button = array( 'jgaccordion.gif', '{jgaccordion}[acctab ==tab 1==]Content 1[/acctab][acctab ==tab 2==]Content 2[/acctab][acctab ==tab 3==]Content 3[/acctab]{/jgaccordion}' );
			break;
	}

	return $button;
}

// Quotes
function botjgquotesButton() {
	global $option;

	// button is not active in specific content components
	switch ( $option ) {
		case 'com_sections':
		case 'com_categories':
		case 'com_modules':
			$button = array( '', '' );
			break;

		default:
			$button = array( 'jgquotes.gif', '{jgquote}...quote content to show...{/jgquote}' );
			break;
	}

	return $button;
}

// Include (php) files into content
function botjgincludephpButton() {
	global $option;

	// button is not active in specific content components
	switch ( $option ) {
		case 'com_sections':
		case 'com_categories':
		case 'com_modules':
			$button = array( '', '' );
			break;

		default:
			$button = array( 'jginsertphp.gif', '{jgfile file:=[path/filename]}' );
			break;
	}

	return $button;
}
?>