Tuesday, May 17, 2011

Create Custom Tab Interface with multiple pages in Admin Panel

/**
 * Implementation of hook_menu().
 */
function addons_menu() {

    /* Start of Event Registration - Admin Interface */
    $items['admin/customlinks/eventregistration'] = array(
        'title' => 'Awaiting for Approval',
        'page callback' => 'drupal_get_form',
        'page arguments' => array('listof_eventregistered_users'),
        'access arguments' => array('access administration pages'),
        );
    $items['admin/customlinks/eventregistration/list'] = array(
        'title' => 'Awaiting for Approval',
        'type' => MENU_DEFAULT_LOCAL_TASK,
        'weight' => -10);
   
    $items['admin/customlinks/eventregistration/confirmed'] = array(
        'title' => 'Approved Users',
        'page callback' => 'drupal_get_form',
        'page arguments' => array('listof_eventconfirmed_users'),
        'access arguments' => array('access administration pages'),
        'type' => MENU_LOCAL_TASK,
        );
   
    $items['admin/customlinks/eventregistration/cancelled'] = array(
        'title' => 'Rejected Users',
        'page callback' => 'drupal_get_form',
        'page arguments' => array('listof_eventcancelled_users'),
        'access arguments' => array('access administration pages'),
        'type' => MENU_LOCAL_TASK,
        );
    return $items;
}

function listof_eventregistered_users(){
 /* code for list of event register users */
 echo "Code for list of event register .. coming soon.";
}

function listof_eventconfirmed_users(){
 /* code for list of event confirmed users */
 echo "Code for list of event confirmed .. coming soon.";
}

function listof_eventcancelled_users(){
 /* code for list of event cancelled users */
 echo "Code for list of event cancelled .. coming soon.";
}

No comments:

Post a Comment

Followers