The $tabs variable normally gets populated with menu entries of type MENU_LOCAL_TASK
.
Take a look at the menu system, and especially at hook_menu()
to get a basic idea. It boils down to a mapping of callback functions to paths. If an URL matches a path defined in hook_menu
(can contain placeholders!), the callback function registered for that path will be called to generate the content for that URL.
The 'type' of the hook_menu
item defines how the path/callback combination is represented in the system. It can be a MENU_CALLBACK
, which would mean just the registered path/callback combination, but no corresponding 'real' menu entry. A MENU_NORMAL_ITEM
, would be the same, but with a 'standard' menu entry, e.g. in the navigation menu. A MENU_LOCAL_TASK
is the same, but the corresponding menu entry usually shows up in the $tabs and not in a menu.
All MENU_LOCAL_TASK
that share the same base path will end up as a group of tabs. So if you had paths like:
- some/path/tab1
- some/path/tab2
- some/path/tab3
and all of these where defined as MENU_LOCAL_TASK
, you would see one tab for each of them on each page they represent.
So to find the places you need to modify/enhance, you should search your codebase for all hook_menu()
implementations that define the paths where those tabs show up. Note that they need not all be defined at the same place, but could come from different hook_menu
implementations in different modules. Than you'd need to add menu definitions for the tabs you want to add, mapping the relevant paths to callback functions. The callback functions would return the content of the pages that the user should see when clicking the tabs.