Created
February 2, 2012 10:57
-
-
Save tamasd/1722887 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- media.module | |
+++ media.module | |
@@ -435,6 +435,19 @@ function media_page_alter(&$page) { | |
} | |
/** | |
+ * Implements hook_menu_local_tasks_alter(). | |
+ */ | |
+function media_menu_local_tasks_alter(&$data, $router_item, $root_path) { | |
+ // Even if there aren't any action links on admin/content/media (e.g., if | |
+ // the user doesn't have 'import media' permission), make menu_local_actions() | |
+ // not strictly empty, so that Drupal.behaviors.mediaAdmin.attach() has a | |
+ // container into which to add an "Add file" action link. | |
+ if ($root_path == 'admin/content/media' && empty($data['actions']['output'])) { | |
+ $data['actions']['output'][] = array(); | |
+ } | |
+} | |
+ | |
+/** | |
* Implements hook_element_info_alter(). | |
*/ | |
function media_element_info_alter(&$types) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment