<?php
/**
* @version $Id: jogadgets.php,v 0.1 2006/01/11 12:28:13 Artur Heinze Exp $
* @package Joomla
* @subpackage Jogadgets
* @copyright (C) 2006 Artur Heinze
* @license mambot http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @author Artur Heinze www.jogadgets.com
* Joomla is Free Open Source Software
*/


/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

/**
** Usage:
*  ...see documentation...
*/


$_MAMBOTS->registerFunction( 'onPrepareContent', 'botJOGADGETS' );

//include joGadgets-Framework
include_once('_jgfw_/jgfw.php');

$GLOBALS['jgw']->modulemode = false;

function botJOGADGETS( $published, &$row, &$params, $page=0 ) {
  
  // check whether mambot has been unpublished
	if (!$published) {
		return;
	}
	
	//check whether to perform parsing on content
	if(preg_match('/{jgexit}/i', $row->text)){
    $row->text = str_replace('{jgexit}', '', $row->text);
    return;
  }
  
  //Imagetitles
  if($GLOBALS['confJG']['useimgtitle']==true){
    $style= 'display:block;height:'.$GLOBALS['confJG']['imgtitle_height'];
  	
    // perform the replacement
  	$row->title = '<div style="'.$style.';background:url(_jgfw_/image.php?text='.urlencode(strip_tags($row->title)).') no-repeat;">&nbsp;</div>';
  }
  
  $row->text = $GLOBALS['jgw']->doparse($row->text);
  
	return true;
	
}





?>
