[development] Creating admin pages.

rajasekharan websweetweb at gmail.com
Fri Sep 18 23:25:36 UTC 2009


I am working on a module that requires a few admin interfaces. The admin 
interface needs to list something from the database. Additionally there 
should be a tab in the same page that has a form to inserts data into 
the db. I am using hook_menu to do this but am having a problem with 
getting the tab to appear. Below is my code:

function obc_menu()
     $items['admin/store/pcampaigns'] = array(
                             'title' => 'Product Campaigns',
                             'description' => 'Manage the campaigns that 
the products in the store will support',
                             'access arguments'=>array('manage campaigns'),
                             'page callback'=>'obc_list',
     $items['admin/store/pcampaigns/add'] = array(
                                                 'title'=> 'Add Campaign',
                                                 'description'=>'Add a 
                                                 'access arguments' => 
array('manage campaigns'),

return $items;

I have ubercart installed so there is a separeate section called 
'Stores' like 'Site Building' and 'Site configuration'. What am I doing 
wrong? How do I create a page and add a tab to it?


More information about the development mailing list