<?php
/**
*
* @author Elglobo (Mickael Salfati) elglobo@phpbb-services.com 
* @package umil
* @copyright (c) 2009 Mickael Salfati 
* @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 name of the mod to be displayed during installation.
$mod_name = 'ACP_MODELS';

/*
* The name of the config variable which will hold the currently installed version
* You do not need to set this yourself, UMIL will handle setting and updating the version itself.
*/
$version_config_name = 'post_models_version';

/*
* 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_models';

/*
* Optionally we may specify our own logo image to show in the upper corner instead of the default logo.
* $phpbb_root_path will get prepended to the path specified
* Image height should be 50px to prevent cut-off or stretching.
*/
//$logo_img = 'styles/prosilver/imageset/site_logo.gif';

/*
* 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(
	// Version 1.0.2
	'1.0.2'	=> array(
		'config_add' => array(
			array('post_models_enable', true),
		),
		
		'permission_add' => array(
			array('f_models', false),
			array('a_models', true),
			array('u_pm_models', true),
		),
		
		'table_add' => array(
			array(MODELS_TABLE, array(
					'COLUMNS'		=> array(
						'model_id'			=> array('UINT', NULL, 'auto_increment'),
						'model_title'		=> array('VCHAR', ''),
						'model_content'		=> array('MTEXT', ''),
						'model_auth'		=> array('TINT:1', '0'),
						'model_pm'			=> array('TINT:1', '0'),
						'model_lang'		=> array('VCHAR:30', ''),
					),
					'PRIMARY_KEY'	=> 'model_id',
					'KEYS'			=> array(
						'model_lang'		=> array('INDEX', 'model_lang'),
					),
				),
			),
		),
		
		'module_add' => array(
			array('acp', 'ACP_GENERAL_TASKS', array(
					'module_basename'		=> 'models',
				),
			),
		),
	),

	// Version 1.0.3
	'1.0.3' => array(
		// No database changes in this version.
	),
	
	// Version 1.0.4
	'1.0.4' => array(
		// No database changes in this version.
	),
	
	// Version 1.0.4a
	'1.0.4a' => array(
		// No database changes in this version.
	),
);

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

?>