Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Tab and subtab
Hello,
how can I add subtab under my new tab? Problem: I writting a plugin with much options and “categories” and I want keep it well-arranged.
I need add new tab under extensions (with register_tab();
) and “subtab” under this new tab. I don´t know how. Exactly like MLP plugin.
Please, can anyone give me a little help?
Thanks!
Offline
Re: Tab and subtab
Look at the source code of the MLP plugin.
Offline
Re: Tab and subtab
Hi ruud,
thank you for quick answer.
I looked at source MLP, but it´s very complicated.
There is:
if ($parent_tab) {
register_tab($parent_tab, $event, $title);
register_callback(array(&$this, 'render'), $event, null, 0);
}
When I find solution, I will post it here.
Thank you again.
Offline
Re: Tab and subtab
MLP uses my gbp_admin_library (as does gbp_permanent_links). The library handles the subtabs the basic of gbp_permanent_links are as follows:
class PermanentLinks extends GBPPlugin
{
var $preferences = array(
'preference_name' => array('value' => 'default_value', 'type' => 'text_input'),
);
function preload()
{
new PermanentLinksListTabView('list', 'list', $this);
new PermanentLinksBuildTabView('build', 'build', $this);
new GBPPreferenceTabView($this);
}
}
class PermanentLinksBuildTabView extends GBPAdminTabView
{
function main()
{
// output tab html
}
}
class PermanentLinksListTabView extends GBPAdminTabView
{
function main()
{
// output tab html
}
}
new PermanentLinks('Permanent Links', 'permlinks', 'admin');
Note: GBPPreferenceTabView
takes the $preferences
array and automatically output a preference table. MLP also uses GBPWizardTabView
which generates the wizard which you can see when you first install MLP.
Last edited by graeme (2008-03-07 14:39:11)
Offline
Pages: 1