<?php
/**
 * JComments Custom BBCodes Table ETL for #__jcomments_custom_bbcodes
 * 
 * @version 2.0
 * @package Migrator
 * @author Sergey M. Litvinov (smart@joomlatune.ru)
 * @copyright (C) 2008-2009 by Sergey M. Litvinov (http://www.joomlatune.ru)
 * @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html
 */

class JComments_Custom_bbcodes_ETL extends ETLPlugin
{
	function getName()
	{
		return "JComments Custom BBCodes ETL Plugin";
	}
	
	function getAssociatedTable()
	{
		return 'jcomments_custom_bbcodes';
	}
	
	function mapvalues( $key, $value )
	{
		switch ($key) {
			default:
				return $value;
				break;
		}
	}

	function getSQLPrologue()
	{
		$ret = <<<EOT

CREATE TABLE IF NOT EXISTS `#__jcomments_custom_bbcodes` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(32) NOT NULL DEFAULT '',
`simple_pattern` VARCHAR(255) NOT NULL DEFAULT '',
`simple_replacement_html` TEXT NOT NULL DEFAULT '',
`simple_replacement_text` TEXT NOT NULL DEFAULT '',
`pattern` VARCHAR(255) NOT NULL DEFAULT '',
`replacement_html` TEXT NOT NULL DEFAULT '',
`replacement_text` TEXT NOT NULL DEFAULT '',
`button_acl` TEXT NOT NULL DEFAULT '',
`button_open_tag` VARCHAR(16) NOT NULL DEFAULT '',
`button_close_tag` VARCHAR(16) NOT NULL DEFAULT '',
`button_title` VARCHAR(255) NOT NULL DEFAULT '',
`button_prompt` VARCHAR(255) NOT NULL DEFAULT '',
`button_image` VARCHAR(255) NOT NULL DEFAULT '',
`button_css` VARCHAR(255) NOT NULL DEFAULT '',
`button_enabled` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
`ordering` INT(11) UNSIGNED NOT NULL DEFAULT '0',
`published` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
  PRIMARY KEY  (`id`)
) TYPE=MyISAM CHARACTER SET `utf8` COLLATE `utf8_general_ci`;
    
EOT;
        return $ret;
    }
}
?>