2012-08-16, 06:01 PM
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.
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.
$page->output_header($lang->admin_plugin);
/* FIND A BETTER SOLUTION */
$lang->load('user_users');
$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
);
/* END BETTER SOLUTION NEEDED */
// output tabs
$page->output_nav_tabs($sub_tabs, 'adminplugin');
-TOA
Ordo Ab Chao
"Insanity: doing the same thing over again and expecting different results." - Einstein
Ordo Ab Chao
"Insanity: doing the same thing over again and expecting different results." - Einstein