function menu_import_drush_command in Menu Export/Import 7
Implementation of hook_drush_command().
@See drush_parse_command() for a list of recognized keys.
Return value
An associative array describing your command(s).
File
- ./
menu_import.drush.inc, line 16 - Menu import module drush integration.
Code
function menu_import_drush_command() {
$items = array();
$items['menu-import'] = array(
'description' => 'Imports a menu from a text file.',
'callback' => 'drush_menu_import_import',
'drupal dependencies' => array(
'menu_import',
),
'examples' => array(
'drush menu-import menu_file.txt main_menu' => 'Import menu_file.txt into menu called main_menu using no specific options.',
'drush menu-import menu_file.txt main_menu --create-content --link-content --clean-import' => 'Import menu_file.txt into menu called main_menu, creates empty content, tries to link to existsing and deletes all menu items before importing new ones.',
),
'arguments' => array(
'file' => 'Required. Path to the menu text file.',
'menu-name' => 'Required. Name of the menu to import in.',
),
'options' => array(
'create-content' => 'Creates empty nodes referenced by respective menu items. Useful for stubbing-out a new site.' . ' Possible option value: type:page,author:1,status:1 where type is content type machine name,' . ' author is uid and status is publication status (0 - unpublished, 1 - published).',
'no-content-link' => 'Do not try to link menu items to existing content/pages.',
'clean-import' => 'Removes old menu items. Use carefully!',
),
'aliases' => array(
'mi-import',
'mi',
),
);
$items['menu-export'] = array(
'description' => 'Exports menu to a text file.',
'callback' => 'drush_menu_import_export',
'drupal dependencies' => array(
'menu_import',
),
'examples' => array(
'drush menu-export menu_file.txt main_menu' => 'Export menu called main_menu to a text file menu_file.txt.',
),
'arguments' => array(
'file' => 'Required. Path to the resulting menu text file.',
'menu-name' => 'Required. Name of the menu to export.',
),
'options' => array(
'export-language' => 'Language will be exported in menu item metadata. This can be useful for a multilingual site',
'line-ending' => 'Line endings to be used. Allowed values are: unix, mac, dos.' . ' Defaults to current system\'s line ending.',
'export-options' => 'Export menu item options, used to store various menu item metadata by other contribs.',
),
'aliases' => array(
'mi-export',
'me',
),
);
return $items;
}