<?php
if (!isset($cache))
{
	$cache = array();
}

$cache[] = 'dbtech_vbshop_itempopup';

switch (THIS_SCRIPT)
{
	case 'member':
		$cache = array_merge(array(
			'dbtech_vbshop_member_css',
			'dbtech_vbshop_memberinfo_purchasebit',
			'dbtech_vbshop_memberinfo_purchasebit_categorybit',
			//'dbtech_vbshop_memberinfo_pointsbit',
			'dbtech_vbshop_memberinfo_block',
			/*DBTECH_PRO_START*/
			'dbtech_vbshop_memberinfo_block_profilemusic',
			/*DBTECH_PRO_END*/
			//'dbtech_vbshop_bar'
		), $cache);
		break;	
		
	case 'usernote':
	case 'showthread':
	case 'showpost':
	case 'private':
	case 'announcement':
	case 'vbcms':
		$cache = array_merge(array(
			'dbtech_vbshop_postbit_purchase',
			'dbtech_vbshop_postbit_purchasebit',
			'dbtech_vbshop_postbit_stats',
		), $cache);
		break;
}

if (THIS_SCRIPT == 'showthread')
{
	$cache[] = 'dbtech_vbshop_threadpage_itemgroup';
	$cache[] = 'dbtech_vbshop_threadpage_itembit';
	$cache[] = 'dbtech_vbshop_threadpage_wrapper';
}

if (THIS_SCRIPT == 'newthread')
{
	$cache[] = 'dbtech_vbshop_threadcreate_itemgroup';
	$cache[] = 'dbtech_vbshop_threadcreate_itembit';
	$cache[] = 'dbtech_vbshop_threadcreate_wrapper';
}

if ($vbulletin->userinfo['permissions']['dbtech_vbshoppermissions'] & $vbulletin->bf_ugp_dbtech_vbshoppermissions['canview'])
{
	// Global templates
	$cache[] = 'dbtech_vbshop_navbar_link';
	
	if ($vbulletin->options['dbtech_vbshop_integration'] & 1 OR $vbulletin->options['dbtech_vbshop_integration'] & 2)
	{
		$cache[] = 'dbtech_vbshop_quicklinks_link';
	}
}

if (in_array('usercp_nav_folderbit', (array)$cache) OR in_array('usercp_nav_folderbit', (array)$globaltemplates))
{
	// UserCP templates
	$cache[] = 'dbtech_vbshop_usercp_nav_link';
	$cache[] = 'dbtech_vbshop_options';
	$cache[] = 'dbtech_vbshop_options_bit';
	$cache[] = 'dbtech_vbshop_options_bit_bit';
}

if (intval($vbulletin->versionnumber) == 3)
{
	$cache[] = 'dbtech_vbshop.css';
	
	$globaltemplates = array_merge($globaltemplates, $cache);
}
?>