MyBB Community Forums

Full Version: How to access system's default sub tabs?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
That's the best title I could think of so I'll do my best to describe it better here.

I wrote a plugin for the acp. Works fine, everythings great. I just know there has to be a better solution to a small part of it; the subtabs have to be re-created in my plugin.

My plugin adds a sub tab under the users module of the groups/users. When my page is displayed, I have to recreate the array of subtabs to get them to show up. I see a potential problem in the case that future releases of mybb add tabs and my plugin would need to be updated accordingly. Not the best solution.

I tried everything I could think of so I come searching.

Anybody know how to get them to pull in automagically? :p

Here's some code if anyone feels it's relevant. Thanks for reading.
		$sub_tabs['browse_users'] = array(
			'title' => $lang->browse_users,
			'link' => "index.php?module=user-users",
			'description' => $lang->browse_users_desc

		$sub_tabs['find_users'] = array(
			'title' => $lang->find_users,
			'link' => "index.php?module=user-users&action=search",
			'description' => $lang->find_users_desc

		$sub_tabs['create_user'] = array(
			'title' => $lang->create_user,
			'link' => "index.php?module=user-users&action=add",
			'description' => $lang->create_user_desc

		$sub_tabs['merge_users'] = array(
			'title' => $lang->merge_users,
			'link' => "index.php?module=user-users&action=merge",
			'description' => $lang->merge_users_desc
		// output tabs
		$page->output_nav_tabs($sub_tabs, 'adminplugin');