function schema_menu in Schema 6
Same name and namespace in other branches
- 5 schema.module \schema_menu()
- 7 schema.module \schema_menu()
Implementation of hook_menu(). Define menu items and page callbacks. admin/build/schema calls local task(default): schema_report() admin/build/schema/report calls local task: schema_report() admin/build/schema/describe calls local task: schema_describe() admin/build/schema/inspect calls local task: schema_inspect() admin/build/schema/sql calls local task: schema_sql() admin/build/schema/show calls local task: schema_show()
File
- ./
schema.module, line 536 - The Schema module provides functionality built on the Schema API.
Code
function schema_menu() {
$items['admin/build/schema'] = array(
'title' => 'Schema',
'description' => 'Manage the database schema for this system.',
'page callback' => 'schema_report',
'access arguments' => array(
'administer schema',
),
);
$items['admin/build/schema/report'] = array(
'title' => 'Compare',
'type' => MENU_DEFAULT_LOCAL_TASK,
'page callback' => 'schema_report',
'weight' => -10,
'access arguments' => array(
'administer schema',
),
);
$items['admin/build/schema/describe'] = array(
'title' => 'Describe',
'type' => MENU_LOCAL_TASK,
'page callback' => 'schema_describe',
'weight' => -8,
'access arguments' => array(
'administer schema',
),
);
$items['admin/build/schema/inspect'] = array(
'title' => 'Inspect',
'type' => MENU_LOCAL_TASK,
'page callback' => 'schema_inspect',
'weight' => -6,
'access arguments' => array(
'administer schema',
),
);
$items['admin/build/schema/sql'] = array(
'title' => 'SQL',
'type' => MENU_LOCAL_TASK,
'page callback' => 'schema_sql',
'weight' => -4,
'access arguments' => array(
'administer schema',
),
);
// This can't work unless we rename the functions in database.*.inc.
global $db_type, $schema_engines;
if (FALSE && isset($schema_engines) && is_array($schema_engines)) {
foreach ($schema_engines as $engine) {
$items['admin/build/schema/sql/' . $engine] = array(
'title' => t($engine),
'type' => $engine == $db_type ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
'page callback' => 'schema_sql',
'callback arguments' => $engine,
'access arguments' => array(
'administer schema',
),
);
}
}
$items['admin/build/schema/show'] = array(
'title' => 'Show',
'type' => MENU_LOCAL_TASK,
'page callback' => 'schema_show',
'weight' => -2,
'access arguments' => array(
'administer schema',
),
);
$items['admin/build/schema/settings'] = array(
'title' => 'Settings',
'type' => MENU_LOCAL_TASK,
'page callback' => 'drupal_get_form',
'page arguments' => array(
'schema_settings',
),
'weight' => 0,
'access arguments' => array(
'administer schema',
),
);
return $items;
}