Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
[How-To] Add entries to AdminCP Navigation Menu
Andreas
Join Date: Jan 2004
Posts: 6,863

Germany
by Andreas Andreas is offline 08 Jun 2005
Rating: (1 vote - 5.00 average)

The AdminCP Navigation is now controlled through XML files.
To add custom entries, you must create a new file cpnav_yourhack.xml and place it in directory includes/xml.

This XML-File constist of 6 important tags:
  • <navgroups>
    This indicates that this is a XML File containing navgroups.
    It has one parameter product that should be set to your product identifier or vbulletin if it does not belong to any product.
  • <navgroup>
    This is the container for one Settings-Group, like Styles & Templates, vBulletin Options, etc.
    It has three parameters: phrase/text, permissions and hr.
    If you are using phrases, phrase must contain the variable name, if you are using hardcoded text then text must contain the label.
    Parameter permissions (optional) can be used to check an administrator permission, like canadminoptions.
    Parameter hr (optional) can be used to put a spacer below this navgroup.
  • <navoption>
    This is one Menu-Entry.
  • <phrase> or <text>
    This must contain the varname or hardcoded text for the menuetry.
  • <link>
    Tag link must contain the URL.
    You can use {$vbulletin->config[Misc][modcpdir]} to point to the ModCP directory here, no matter how it is actually called

Example

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Update for Beta 3
With Beta 3 a new parameter displayorder has been introduced. This parameter is valid for Tags navgroup and navoption.
This way it is possible to control in which order the Navgroups and Links will be displayed, and you can also add custom Links to existing Navgroups.
To do so, your navgroup must have them same displayorder and Phrase Varname as the existing group:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Then Top-Link Forums & Moderators will be the first link in Navgroup Forums & Moderators (Displayorder: 60).

To find out the Displayorder for existing groups, take a look at cpnav_vbulletin.xml.

This How-To is (C) 2005 by KirbyDE and you are not allowed to redistribute it in any way without my explicit consent.

Last edited by Andreas; 28 Dec 2005 at 23:48..
Views: 21744
Reply With Quote
Comments
  #2  
Old 13 Jun 2005, 21:51
Creative Suite's Avatar
Creative Suite Creative Suite is offline
 
Join Date: May 2004
Thanks..
__________________
Easy come .. Easy go
:sleep:
Reply With Quote
  #3  
Old 13 Jun 2005, 22:20
rjordan's Avatar
rjordan rjordan is offline
 
Join Date: Sep 2004
So, in doing this, does this take care of the issues with no hooks being included in the AdminCP navigation menu? I know that it does not take care of not having hooks in the individual modules, just refering to the main selection menu.
Reply With Quote
  #4  
Old 15 Jun 2005, 04:10
feldon23's Avatar
feldon23 feldon23 is offline
 
Join Date: Nov 2001
Originally Posted by rjordan
So, in doing this, does this take care of the issues with no hooks being included in the AdminCP navigation menu? I know that it does not take care of not having hooks in the individual modules, just refering to the main selection menu.
Site administrators upload the XML file prepared by the hack author and presto, new items appear in the AdminCP.

The bummer here is that hack authors can't specify which existing group to add a menu item under (for instance, adding a new PM-related funtion or feature under the existing PM AdminCP tree) nor can hack authors specify a group that their hack should appear above or below. A hack author might want to add "Clans" right below Usergroups or Promotions.

I'm guessing that new menus created with this XML technique appear way at the bottom?

Of course to add all the functionality I am talking about, the admincp XML file would need to be cached in a "merged" state.

Last edited by feldon23; 15 Jun 2005 at 04:15.
Reply With Quote
  #5  
Old 22 Jun 2005, 07:13
stlmike stlmike is offline
 
Join Date: Mar 2004
Thanks KirbyDE in how to do this...
Reply With Quote
  #6  
Old 22 Jun 2005, 12:12
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Real name: Chris Murphy, BSc
Originally Posted by feldon23
Site administrators upload the XML file prepared by the hack author and presto, new items appear in the AdminCP.

The bummer here is that hack authors can't specify which existing group to add a menu item under (for instance, adding a new PM-related funtion or feature under the existing PM AdminCP tree) nor can hack authors specify a group that their hack should appear above or below. A hack author might want to add "Clans" right below Usergroups or Promotions.

I'm guessing that new menus created with this XML technique appear way at the bottom?

Of course to add all the functionality I am talking about, the admincp XML file would need to be cached in a "merged" state.
They seem to appear at either the top or bottom, quite randomly...

It is bizzarre to be sure...

I hope the Devs listen to the requests and create some kind of display order feature for the CP Nav

Satan
Reply With Quote
  #7  
Old 22 Jun 2005, 12:16
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Real name: Andreas
Originally Posted by hellsatan
They seem to appear at either the top or bottom, quite randomly...
They appear in the sort-order that is provided by the OS when you list cpnav_*.xml Files.
Reply With Quote
  #8  
Old 22 Jun 2005, 12:18
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Real name: Chris Murphy, BSc
Aha - Glad someone knows

Satan
Reply With Quote
  #9  
Old 27 Jun 2005, 20:12
Dream's Avatar
Dream Dream is offline
 
Join Date: Oct 2001
so kirby what changed in vb 3.5 beta 3? are you going to update this
Reply With Quote
  #10  
Old 27 Jun 2005, 20:24
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Real name: Andreas
Updated
Reply With Quote
  #11  
Old 27 Jun 2005, 20:35
Dream's Avatar
Dream Dream is offline
 
Join Date: Oct 2001
thanks
Reply With Quote
  #12  
Old 01 Jul 2005, 13:27
sv1cec sv1cec is offline
 
Join Date: May 2004
Real name: John
I have a problem with the xml file which describes the menu I want to appear in the AdminCP.

If one of the options contains a link, which includes as a character, the character &, the menu does not appear. For example:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Them the menu refuses to appear. Instead, an empty menu is shown.

If I replace the & character with a - or something, everything works.

Is this a bug in the way the xml is handled or is this character not allowed? If so, how can I pass a link, which includes such a character?

Thanks
__________________

John
SV1CEC
Reply With Quote
  #13  
Old 01 Jul 2005, 13:49
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Real name: Andreas
& is only allowed in CDATA (Character Data) Sections, otherwise you must use the entity &amp;
Reply With Quote
  #14  
Old 01 Jul 2005, 14:05
sv1cec sv1cec is offline
 
Join Date: May 2004
Real name: John
Thanks Kirby, much appreciated.

Any other characters that are not allowed, that I need to be aware of? As you can tell, I have no expertise in XML.

Thanks again.
__________________

John
SV1CEC
Reply With Quote
  #15  
Old 01 Jul 2005, 14:53
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Real name: Andreas
[ ] < > ' "
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 21:47.

Layout Options | Width: Wide Color: