Tuesday, 6 September 2011

List the admin menu in drupal

The following code use to display all the menu items in drupal

In user.module file

function user_menu() {

$items['admin/user'] = array(
'title' => 'User management',
'description' => "Manage your site's users, groups and access to site features.",
'position' => 'left',
'page callback' => 'system_admin_menu_block_page',
'access arguments' => array('access administration pages'),
'file' => 'system.admin.inc',
'file path' => drupal_get_path('module', 'system'),
'weight' => 3,
);

}
In system.admin.inc file

function system_admin_menu_block_page() {
$item = menu_get_item();
if ($content = system_admin_menu_block($item)) {
$output = theme('admin_block_content', $content);
}
else {
$output = t('You do not have any administrative items.');
}
return $output;
}
The same module we display our custom module menus

0 comments:

Post a Comment