Domanda

I have a custom module in which i have a hook menu called " management " , Now I want to creatae this module looks like exactly same as the Drupal admin configuration. Like within this module there will be a set of links which will be linkable to other modules.Please let me know how it could be done ..

È stato utile?

Soluzione

In your custom module copy the following menu items. Hope this might give u a slight idea.Try reading more about the hook menu mate.After copying the following items in your hook_menu,clear the cache and run it.Hope that helps u mate.. :)

 $items['management'] = array(
                                'title' => 'My Menu list',
                                'description' => 'User history settings',
                                'page callback' => 'my_function',
                                'access arguments' => array('access content'),
                                                );

    $items['management/annotate'] = array(
                                'title' => 'Node annotation',
                                'description' => 'Adjust node annotation options.',
                                'position' => 'right',
                                'weight' => -5,
                                'page callback' => 'system_admin_menu_block_page',
                                'access arguments' => array('administer site configuration'),
                                'file' => 'system.admin.inc',
                                'file path' => drupal_get_path('module', 'system'),
    );


function my_function(){
$item = menu_get_item();
  if ($content = system_admin_menu_block($item)) {
    $output = theme('admin_block_content', array('content' => $content));
  }
  else {
    $output = t('You do not have any items to display.');
  }
  return $output;
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top