<?php
/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*\
<< ******************************************************************** >>
<< * ---------------------------------------------------------------- * >>
<< * Copyright ©2011-2012 Ozzy47                                      * >>
<< * All Rights Reserved. 											  * >>
<< * This file may not be redistributed in whole or significant part. * >>
<< * ---------------------------------------------------------------- * >>
<< * You are not allowed to use this on your server unless the files  * >>
<< * you downloaded were done so with permission.					  * >>
<< * ---------------------------------------------------------------- * >>
<< ******************************************************************** >>
\*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/

if ($vbulletin->options['dbtech_vbnavtabs_420_active'])
{
// Usergroup settings
	$allowedusergroup = array('membergroupids' => $navelement['allowedusergroup']);
	$blockedusergroup = array('membergroupids' => $navelement['blockedusergroup']);

//PARENT SELECTOR
	if ($navelement['navtype'] !== 'tab')
	{
		$navlist = build_navigation_list();
		$tabs = $parents = array();
		foreach ($navlist AS $id => $tab)
			{
				if ($tab['navtype'] == 'tab')
				{
					$parents[$tab['name']] =  $vbphrase['vb_navigation_'.$tab['navtype'].'_'.$tab['name'].'_text']. ' (TAB)';
					
				if ($tab['links'] AND $navelement['type'] = 'menu')
				{
					foreach ($tab['links'] AS $id => $child)
					{
						if ($child['navtype'] == 'menu')
						{
							$parents[$child['name']] = ' - - ' . $vbphrase['vb_navigation_'.$child['navtype'].'_'.$child['name'].'_text'] . ' (MENU)';
						}
					}
				}				
			}
		}
print_select_row($vbphrase['dbtech_vbnavtabs_420_parent_tab'], 'parent', $parents, $navelement['parent']);
	}

print_input_row($vbphrase['dbtech_vbnavtabs_420_color'], 'tabcolor', $navelement['tabcolor']);

print_membergroup_row($vbphrase['dbtech_vbnavtabs_420_ug_allowed_tabs'], 'allowedusergroup', $vbulletin->options['dbtech_vbnavtabs_420_num_col'], $allowedusergroup);

print_membergroup_row($vbphrase['dbtech_vbnavtabs_420_ug_not_allowed_tabs'], 'blockedusergroup', $vbulletin->options['dbtech_vbnavtabs_420_num_col'], $blockedusergroup);

//STYLE CHOOSER
	require_once(DIR . '/includes/adminfunctions_template.php');

	cache_styles();

	$styles = array();
	foreach ($stylecache AS $styleid => $style)
	{
		$styles[$style['type']]["$styleid"] = construct_depth_mark($style['depth'], '** ', ($vbulletin->debug ? '** ' : '')) . '' . $style['title'];
	}
	$styleoptions = array(
	$vbphrase['dbtech_vbnavtabs_420_styles'] => $styles['standard'],
);

print_label_row($vbphrase['dbtech_vbnavtabs_420_styles_chooser'], '<select name="tabstyles[]" tabindex="1" class="bginput" multiple="multiple" size="10">' . construct_select_options($styleoptions, explode(',', $navelement['tabstyles'])) . '</select>', '', 'top', 'tabstyles[]');

if (version_compare($vbulletin->versionnumber, '4.2.1 Beta 0', '<'))
{
print_select_row($vbphrase['dbtech_vbnavtabs_420_tab_tabtargets'], 'tabtarget', array('_self'=>'_self','_blank'=>'_blank','_parent'=>'_parent','_top'=>'_top'), $navelement['tabtarget']);
}

print_input_row($vbphrase['dbtech_vbnavtabs_420_tab_title'], 'tabtitle', $navelement['tabtitle']);

// TAB DROPDOWN
if (version_compare($vbulletin->versionnumber, '4.2.1 Beta 0', '<'))
{
if ($navelement['navtype'] == 'tab')
{
	$menus = array('' => '');

	foreach ($navlist[$navelement['navid']]['links'] AS $link)
	{
		if ($link['navtype'] == 'menu')
		{
			$menus[$link['name']] = $link['text'];
		}
	}
	
	if (count($menus) > 1)
	{
		print_select_row($vbphrase['dbtech_vbnavtabs_420_droptab'], 'tabdrop', $menus, $navelement['tabdrop']);
	}
}
}
}

/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*\
<< ********************************************************************* >>
<< * Created: 09:30, Fri June 8th 2012                                 * >>
<< * VER: 1.0.0                                                        * >>
<< ********************************************************************* >>
\*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/
?>