diff --git a/feeds.module b/feeds.module index 6681fbb..27b69fd 100644 --- a/feeds.module +++ b/feeds.module @@ -847,6 +847,9 @@ function feeds_flush_caches() { /** * Implements hook_admin_menu_output_build(). + * + * Shows available importers in the "Content" section of the admin menu. + * Requires the "admin_menu" module to be enabled. */ function feeds_admin_menu_output_build(array &$content) { // Add new top-level item to the menu. @@ -880,6 +883,32 @@ function feeds_admin_menu_output_build(array &$content) { } /** + * Implements hook_menu_local_tasks_alter(). + * + * Adds "Import" link as local action on content overview page. + */ +function feeds_menu_local_tasks_alter(&$data, $router_item, $root_path) { + if ($root_path == 'admin/content') { + $data['actions']['output'][] = array( + '#theme' => 'menu_local_task', + '#link' => array( + 'title' => t('Import'), + 'href' => 'import', + 'localized_options' => array( + 'attributes' => array( + 'title' => t('Import'), + ), + ), + ), + '#access' => feeds_page_access(), + // Add weight so it appears after the local action "Add content". + '#weight' => 1, + ); + } +} + + +/** * @} */