<?php
/**
*
* @package - Red Blinking PM MOD
* @version $Id:$
* @file				install_rbpm.php
* @copyright (c) 2011 all4phone (http://phpbbmods.cba.pl/)
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*
*/

/**
 * @ignore
 */
define('UMIL_AUTO', true);
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);

include($phpbb_root_path . 'common.' . $phpEx);
$user->session_begin();
$auth->acl($user->data);
$user->setup();


if (!file_exists($phpbb_root_path . 'umil/umil_auto.' . $phpEx))
{
	trigger_error('Please download the latest UMIL (Unified MOD Install Library) from: <a href="http://www.phpbb.com/mods/umil/">phpBB.com/mods/umil</a>', E_USER_ERROR);
}

/*
* The language file which will be included when installing
* Language entries that should exist in the language file for UMIL (replace $mod_name with the mod's name you set to $mod_name above)
* $mod_name
* 'INSTALL_' . $mod_name
* 'INSTALL_' . $mod_name . '_CONFIRM'
* 'UPDATE_' . $mod_name
* 'UPDATE_' . $mod_name . '_CONFIRM'
* 'UNINSTALL_' . $mod_name
* 'UNINSTALL_' . $mod_name . '_CONFIRM'
*/
$language_file = 'mods/info_acp_rbpm';

// The name of the mod to be displayed during installation.
$mod_name = 'ACP_RBPM_TITLE';

/*
* The name of the config variable which will hold the currently installed version
* UMIL will handle checking, setting, and updating the version itself.
*/
$version_config_name = 'rbpm_version';

/*
* The array of versions and actions within each.
* You do not need to order it a specific way (it will be sorted automatically), however, you must enter every version, even if no actions are done for it.
*
* You must use correct version numbering.  Unless you know exactly what you can use, only use X.X.X (replacing X with an integer).
* The version numbering must otherwise be compatible with the version_compare function - http://php.net/manual/en/function.version-compare.php
*/
$versions = array(
	'1.0.0' => array(
		'config_add' => array(
			array('rbpm_enable', '0', 0),
			array('rbpm_color', '#ff0000', 0),
			array('rbpm_bold', 'none', 0),
			array('rbpm_italic', 'normal', 0),
			array('rbpm_size', '11px', 0),
			array('rbpm_family', 'Verdana', 0),
			array('rbpm_shadow', '0px 0px', 0),
			array('rbpm_shadow_blur', '0px', 0),
			array('rbpm_shadow_colour', 'attach', 0),
		),

		'module_add' => array(
			array('acp', 'ACP_CAT_DOT_MODS', 'ACP_CAT_RBPM'),
			array('acp', 'ACP_CAT_RBPM',
				array(
				'module_basename'	=> 'rbpm',
				'module_langname'   => 'ACP_RBPM_CONFIG',
				'module_mode'       => 'index',
				'module_auth'       => 'acl_a_board',
				),
			),
		),
	),
	'1.0.1' => array(
		'config_add' => array(
			array('rbpm_insc_enable', '0', 0),
			array('rbpm_enable_background', '0', 0),
			array('rbpm_enable_unread', '0', 0),
			array('rbpm_insc_color', '#ff0000', 0),
			array('rbpm_variant', 'normal', 0),
			array('rbpm_spacing', 'normal', 0),
			array('rbpm_transform', 'none', 0),
			array('rbpm_decoration', 'none', 0),
			array('rbpm_shadowh', '0px', 0),
			array('rbpm_shadowv', '0px', 0),
			array('rbpm_insc_shadow_colour', 'attach', 0),
			array('rbpm_background_colour', 'attach', 0),
			array('rbpm_border_colour', 'attach', 0),
			array('rbpm_border_width', '1px', 0),
			array('rbpm_border_style', 'outset', 0),
			array('rbpm_border_radius', '10px', 0),
		),
	),
	'1.0.2' => array(
		'config_add' => array(
			array('rbpm_background_r', '0', 0),
			array('rbpm_background_g', '0', 0),
			array('rbpm_background_b', '0', 0),
			array('rbpm_background_transp', '1', 0),
		),
	),
	'1.0.3' => array(
		'config_add' => array(
			array('rbpm_unread_color','#000000', 0),
		),
	),
	// Version 1.0.4
	'1.0.4' => array(
	// Nothing changed in this version.
	// Just checked on the newest phpbb 3.0.10
	),
	// Version 1.0.5
	'1.0.5' => array(
		'config_add' => array(
			array('rbpm_enable_unread_blink', '0', 0),
		),
	),
	// Version 1.0.6
	'1.0.6' => array(
	// Nothing changed in this version
	),
	// Version 1.0.7
	'1.0.7' => array(
	// Just fixed known bugs
	),
	// Version 1.0.8
	'1.0.8' => array(
	// Changed rbpm.css file
	),
	// Version 1.0.9
	'1.0.9' => array(
	// Nothing changed in this version
	// Just fixed known bugs
	),
	// Version 1.0.10
	'1.0.10' => array(
	// Nothing changed in this version
	// Just fixed known bugs
	// purge the cache
		'cache_purge' => array('', 'template', 'theme', 'imageset'),
	),
);

// Include the UMIF Auto file and everything else will be handled automatically.
include($phpbb_root_path . 'umil/umil_auto.' . $phpEx);

?>