Hello.
I just wanted to say that I used a hybrid between yours and ragtek's. It allows the base of the navtab to be stored in the plugin, with a couple of things that can be edited in the Admin->Options->Plugin, and offloads the submenu into a template that can be edited as needed by the end-user.
Plugin PHP:
Code:
$tabselected = '';
$tablinks = '';
$navtab_name = $vbulletin->options['plugin_navtab_title'];
$navtab_location = $vbulletin->options['plugin_navtab_location'];
Those are based on Options that i set up, so the user can choose title and location in the Admin->Options->Plugin Options
switch ($location) {
case '1':
$tabloc = 'navtab_end'; break;
case '2':
$tabloc = 'navtab_middle'; break;
case '3':
$tabloc = 'navtab_start'; break;
}
The above code determines which option was selected, 1/2/3, to determine location of navtab.
if (THIS_SCRIPT == 'rkc_plugin')
{
$vbulletin->options['selectednavtab']='rkc_plugin';
$tabselected = ' class="selected"';
$tablinks .= vB_Template::create('plugin_navbar_submenu')->render();
}
$template_hook[$nbloc] .= '<li'.$tabselected.'><a class="navtab" href="pluginpage.php">'.$navtabname.'</a>'.$tablinks.'</li>' ;
Template Code:
Code:
<ul class="floatcontainer">
<li><a href="link1.php">Link 1</a></li>
<li class="popupmenu">
<a href="javascript://" class="popupctrl">Drop Down</a>
<ul class="popupbody popuphover">
<li><a href="sublink1.php">SubLink 1</a></li>
<li><a href="sublink2.php">SubLink 2</a></li>
<li><a href="sublink3.php">SubLink 3</a></li>
</ul>
</li>
<li><a href="link2.php">Link 2</a></li>
<li><a href="link3.php">Link 3</a></li>
</ul>