function taxonomy_xml_menu in Taxonomy import/export via XML 6.2
Same name and namespace in other branches
- 5.2 taxonomy_xml.module \taxonomy_xml_menu()
- 5 taxonomy_xml.module \taxonomy_xml_menu()
- 6 taxonomy_xml.module \taxonomy_xml_menu()
- 7 taxonomy_xml.module \taxonomy_xml_menu()
Implementation of hook_menu: Define menu links.
@note See hook_menu for a description of return values.
File
- ./
taxonomy_xml.module, line 144 - This module makes it possible to import and export taxonomies as XML documents.
Code
function taxonomy_xml_menu() {
if (!module_exists('taxonomy')) {
return;
}
$items = array();
$items[TAXONOMY_XML_ADMIN . '/export'] = array(
'title' => t('Export'),
'access arguments' => array(
'export taxonomy',
),
'page callback' => 'taxonomy_xml_export',
'type' => MENU_LOCAL_TASK,
);
$items[TAXONOMY_XML_ADMIN . '/import'] = array(
'title' => t('Import'),
'access arguments' => array(
'administer taxonomy',
),
'page callback' => 'taxonomy_xml_import',
'type' => MENU_LOCAL_TASK,
);
$items[TAXONOMY_XML_ADMIN . '_xml/flush'] = array(
'title' => t('Delete cache file'),
'access arguments' => array(
'administer taxonomy',
),
'page callback' => 'taxonomy_xml_flush_cache_file',
'type' => MENU_CALLBACK,
);
$items['taxonomy_xml'] = array(
'title' => t('Taxonomy XML'),
'access arguments' => array(
'access content',
),
'page callback' => 'taxonomy_xml_file',
'type' => MENU_CALLBACK,
);
$items[TAXONOMY_XML_ADMIN . '/import/services'] = array(
'title' => t('About taxonomy_import services'),
'access arguments' => array(
'administer taxonomy',
),
'page callback' => 'taxonomy_xml_about_services',
'type' => MENU_LOCAL_TASK,
);
if (module_exists('rdf')) {
// Export individual taxonomy term information
// This approach is closer to how rdf.module expects to do it
$items['taxonomy/term/%/rdf'] = array(
'title' => 'RDF',
'type' => MENU_CALLBACK,
'access arguments' => array(
'access content',
),
'page callback' => 'taxonomy_xml_rdf_export_term',
'page arguments' => array(
2,
),
'file' => 'taxonomy_xml_rdf.inc',
);
// Not a real URL, but it works as a placeholder
$items['taxonomy/vocabulary/%/rdf'] = array(
'title' => 'RDF',
'type' => MENU_CALLBACK,
'access arguments' => array(
'access content',
),
'page callback' => 'taxonomy_xml_rdf_export_vocabulary',
'page arguments' => array(
2,
),
'file' => 'taxonomy_xml_rdf.inc',
);
}
return $items;
}