function dbtng_example_menu in Examples for Developers 7
Implements hook_menu().
Set up calls to drupal_get_form() for all our example cases.
Related topics
File
- dbtng_example/
dbtng_example.module, line 393 - This is an example outlining how a module can make use of the new DBTNG database API in Drupal 7.
Code
function dbtng_example_menu() {
$items = array();
$items['examples/dbtng'] = array(
'title' => 'DBTNG Example',
'page callback' => 'dbtng_example_list',
'access callback' => TRUE,
);
$items['examples/dbtng/list'] = array(
'title' => 'List',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
$items['examples/dbtng/selectivelist'] = array(
'title' => 'Selective List',
'page callback' => 'dbtng_example_selective_list',
'access callback' => TRUE,
'type' => MENU_LOCAL_TASK,
'weight' => -9,
);
$items['examples/dbtng/add'] = array(
'title' => 'Add entry',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'dbtng_example_form_add',
),
'access callback' => TRUE,
'type' => MENU_LOCAL_TASK,
'weight' => -4,
);
$items['examples/dbtng/update'] = array(
'title' => 'Update entry',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'dbtng_example_form_update',
),
'type' => MENU_LOCAL_TASK,
'access callback' => TRUE,
'weight' => -5,
);
$items['examples/dbtng/advanced'] = array(
'title' => 'Advanced list',
'page callback' => 'dbtng_example_advanced_list',
'access callback' => TRUE,
'type' => MENU_LOCAL_TASK,
);
$items['examples/dbtng/grouping_list'] = array(
'title' => 'Grouping list',
'page callback' => 'dbtng_example_grouping_list',
'access callback' => TRUE,
'type' => MENU_LOCAL_TASK,
);
return $items;
}