So after the success of my create character fluxcp add-on, I pursue my knowledge reading athena web related applications. I happened to find ceres control panel and think of what if I also integrate my add-ons to that cp. While converting one of my add-on, I see that adding a menu item is a little confusing ( I don't know if other find it confusing too ), you have to edit the whole keys and indexes if you want to add let's say a sub menu for characters menu.
So I did rewrite some codes to support easy adding of menus and sub menus via array of values.
Make sure that you have a backup of your current menu.php file in case something bad happened.
All you have to do is to download the revised code ( menu.php ) and overwrite theyour current menu.php located in the root folder of your ceres cp.
This update is intended to those who are having difficulties adding their own custom menu and sub menus.
How to add new menus and sub menus? Open menu.php and find
Adding Main Menu '$mainmenu' array, create a new array something like this
label : this is the label / text of your menu index : this is the unique number for your menu level : players with equal or above this level can see the menu, -1 means all can see the menu file : if this is a page and intended to have no sub menus, specify the filename of the page like what you did in sub menus. If this menu has sub menus, this will be ignored and will act as a normal menu. Order of menus is according to their chronological orders. So if you want your menu to be next in 'My Account' menu, you have to put your custom menu array next to 'My Account's array like this
parent : is the index you set in $mainmenu, so if I want this sub menu to be seen under 'Custom Menu' above, I'll set this to 7 since 7 is the unique index of 'Custom Menu' label : this is the label / text of your sub menu file : is the filename of the page enabled : is this menu enabled or not? 1 for enabled, 0 or below 0 for disabled
Question
Jupeto
Description
So after the success of my create character fluxcp add-on, I pursue my knowledge reading athena web related applications. I happened to find ceres control panel and think of what if I also integrate my add-ons to that cp. While converting one of my add-on, I see that adding a menu item is a little confusing ( I don't know if other find it confusing too
), you have to edit the whole keys and indexes if you want to add let's say a sub menu for characters menu.
So I did rewrite some codes to support easy adding of menus and sub menus via array of values.
Make sure that you have a backup of your current menu.php file in case something bad happened.
All you have to do is to download the revised code ( menu.php ) and overwrite theyour current menu.php located in the root folder of your ceres cp.
This update is intended to those who are having difficulties adding their own custom menu and sub menus.
How to add new menus and sub menus? Open menu.php and find
-
Adding Main Menu
-
Adding Sub Menus
Edited by Jupeto'$mainmenu' array, create a new array something like this
label : this is the label / text of your menu
index : this is the unique number for your menu
level : players with equal or above this level can see the menu, -1 means all can see the menu
file : if this is a page and intended to have no sub menus, specify the filename of the page like what you did in sub menus. If this menu has sub menus, this will be ignored and will act as a normal menu.
Order of menus is according to their chronological orders. So if you want your menu to be next in 'My Account' menu, you have to put your custom menu array next to 'My Account's array like this
'$submenu' array, create a new array something like this
parent : is the index you set in $mainmenu, so if I want this sub menu to be seen under 'Custom Menu' above, I'll set this to 7 since 7 is the unique index of 'Custom Menu'
label : this is the label / text of your sub menu
file : is the filename of the page
enabled : is this menu enabled or not? 1 for enabled, 0 or below 0 for disabled
Link to comment
Share on other sites
0 answers to this question
Recommended Posts