Joomla 1.6+ menu items are stored in the #__menu table with a special type of menu called the “main” for the admin menu.
Find the identifier of the menu item of the main component. You can add sub-items to this by declaring the parent_id column as the identifier of your main menu item and setting the level column to 2.
The only problem you will run into is accepting nested sets (lft and rgt columns). This is the best way to handle parent-child relationships and organize menu items. I'm not sure if parent_id or lft / rgt is used at this point, but they are both full.
To add a new item, you will have to “bypass” all lft / rgt values by two for menu items with a value greater than or equal to the position that you want to add to your menu item. This should include the rgt of your parent. If your parent element has no children, for your new element, the lft value will be the value of the parent left + 1. The value of the new rgt element will be the parent lft + 2.
One thing that should be noted with lft and rgt is that numbering applies to each menu item (front-end and back-end), so not doing it properly may have the potential to destroy your entire menu hierarchy. I think that’s why the parent_id column is still in use and that there is an “rebuild” menu option in the admin area.
http://en.wikipedia.org/wiki/Nested_set_model
source share