<?php
/**
 * <pre>
 * Invision Power Services
 * IP.Board vVERSION_NUMBER
 * Config file
 * Last Updated: $Date$
 * </pre>
 *
 * @author 		$author$
 * @copyright	(c) 2001 - 2009 Invision Power Services, Inc.
 * @license		http://www.invisionpower.com/community/board/license.html
 * @package		IP.Content
 * @link		http://www.invisionpower.com
 * @version		$Rev$
 **/

if ( ! defined( 'IN_IPB' ) )
{
	print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
	exit();
}

/* Can search with this app */
$CONFIG['can_search']			= 1;

/* Can view new content with this app */
$CONFIG['can_viewNewContent']	= 1;

/* Can fetch active content with this app */
$CONFIG['can_activeContent']	= 1;

/* Can fetch user generated content */
$CONFIG['can_userContent']		= 1;

$CONFIG['contentTypes'] = array( 'pages' );

/* Gotta load cache, then loop through for databases */
$databases	= ipsRegistry::instance()->cache()->getCache('ccs_databases');

if( is_array($databases) AND count($databases) )
{
	foreach( $databases as $database )
	{
		if ( ipsRegistry::instance()->permissions->check( 'view', $database ) == TRUE AND $database['database_open'] )
		{
			$CONFIG['contentTypes'][]	= 'database_' . $database['database_id'];

			if( $database['database_comments'] AND !$database['database_forum_comments'] AND ipsRegistry::instance()->permissions->check( 'comment', $database ) == TRUE )
			{
				$CONFIG['contentTypes'][]	= 'database_' . $database['database_id'] . '_comments';
			}
		}
	}
}
