From 539e99bb7167579724c3dbb25700af83b2fddc41 Mon Sep 17 00:00:00 2001 From: Paul Pound Date: Thu, 31 May 2012 15:14:55 -0300 Subject: [PATCH] added init functions to load admin css for each module --- islandora.module | 6 ++++ .../islandora_basic_collection.module | 28 +++++++++++-------- .../islandora_basic_image.module | 6 ++++ 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/islandora.module b/islandora.module index 20ddced2..a5028fb1 100644 --- a/islandora.module +++ b/islandora.module @@ -351,6 +351,12 @@ function islandora_get_types() { return module_invoke_all('islandora_get_types'); } +function islandora_init() { + if (path_is_admin(current_path())) { + drupal_add_css(drupal_get_path('module', 'islandora') . '/css/islandora.admin.css'); + } +} + /** * a function to call other modules edit page. If there are not any modules * that handle this function this module will build a default page. diff --git a/islandora_basic_collection/islandora_basic_collection.module b/islandora_basic_collection/islandora_basic_collection.module index 8d14a042..83ebfe24 100644 --- a/islandora_basic_collection/islandora_basic_collection.module +++ b/islandora_basic_collection/islandora_basic_collection.module @@ -61,22 +61,28 @@ function islandora_basic_collection_menu() { return $items; } +function islandora_basic_collection_init() { + if (path_is_admin(current_path())) { + drupal_add_css(drupal_get_path('module', 'islandora_basic_collection') . '/css/islandora_basic_collection.admin.css'); + } +} + /** * Implements hook_menu_local_tasks_alter(). */ function islandora_basic_collection_menu_local_tasks_alter(&$data, $router_item, $root_path) { - // Add action link - if ($root_path == 'islandora/object/%/manage/collection') { - $object_id = $router_item['page_arguments'][0]; - $item = menu_get_item("islandora/ingest/$object_id"); - $item['title'] = 'Add a repository item'; - if ($item['access']) { - $data['actions']['output'][] = array( - '#theme' => 'menu_local_action', - '#link' => $item, - ); - } + // Add action link + if ($root_path == 'islandora/object/%/manage/collection') { + $object_id = $router_item['page_arguments'][0]; + $item = menu_get_item("islandora/ingest/$object_id"); + $item['title'] = 'Add a repository item'; + if ($item['access']) { + $data['actions']['output'][] = array( + '#theme' => 'menu_local_action', + '#link' => $item, + ); } + } } /** diff --git a/islandora_basic_image/islandora_basic_image.module b/islandora_basic_image/islandora_basic_image.module index 890767c9..47eaeea2 100644 --- a/islandora_basic_image/islandora_basic_image.module +++ b/islandora_basic_image/islandora_basic_image.module @@ -132,6 +132,12 @@ function islandora_basic_image_access($object_id) { return FALSE; } +function islandora_basic_image_init() { + if (path_is_admin(current_path())) { + drupal_add_css(drupal_get_path('module', 'islandora_basic_image') . '/css/islandora_basic_image.admin.css'); + } +} + /** * Theme registry function * We supply a pattern so we can overide templates at the theme level if needed.