diff --git ctools.module ctools.module index b3e6f8f..1e607fd 100644 --- ctools.module +++ ctools.module @@ -391,7 +391,7 @@ function ctools_shutdown_handler() { function ctools_theme() { ctools_include('utility'); $items = array(); - _ctools_passthrough($items, 'theme'); + ctools_passthrough('ctools', 'theme', $items); return $items; } @@ -401,7 +401,7 @@ function ctools_theme() { function ctools_menu() { ctools_include('utility'); $items = array(); - _ctools_passthrough($items, 'menu'); + ctools_passthrough('ctools', 'menu', $items); return $items; } @@ -410,7 +410,8 @@ function ctools_menu() { */ function ctools_cron() { ctools_include('utility'); - _ctools_passthrough($items, 'cron'); + $items = array(); + ctools_passthrough('ctools', 'cron', $items); } /** diff --git includes/utility.inc includes/utility.inc index 1360f16..499b00a 100644 --- includes/utility.inc +++ includes/utility.inc @@ -18,13 +18,13 @@ * To save time we pass the $items array in so we don't need to do array * addition. It modifies the array by reference and doesn't need to return it. */ -function _ctools_passthrough(&$items, $type = 'theme') { - $files = drupal_system_listing('.' . $type . '.inc$', drupal_get_path('module', 'ctools') . '/includes', 'name', 0); +function ctools_passthrough($module, $type, &$items) { + $files = drupal_system_listing('.' . $type . '.inc$', drupal_get_path('module', $module) . '/includes', 'name', 0); foreach ($files as $file) { require_once './' . $file->filename; list($tool) = explode('.', $file->name, 2); - $function = 'ctools_' . str_replace ('-', '_', $tool) . '_' . $type; + $function = $module . '_' . str_replace ('-', '_', $tool) . '_' . $type; if (function_exists($function)) { $function($items); }