? 426646-hook-dashboard.patch ? 432414-render-hook.patch ? dashboard.patch Index: dashboard.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/dashboard/dashboard.module,v retrieving revision 1.19 diff -u -p -r1.19 dashboard.module --- dashboard.module 12 Apr 2009 05:47:11 -0000 1.19 +++ dashboard.module 13 Apr 2009 16:09:43 -0000 @@ -267,3 +267,16 @@ function dashboard_profile_dashboard_gad 'content' => $content, ); } + +/** + * API hook to allow passing values by reference. + */ +function dashboard_invoke() { + $args = func_get_args(); + $hook = $args[0]; + unset($args[0]); + foreach (module_implements($hook) as $module) { + $function = $module .'_'. $hook; + call_user_func_array($function, $args); + } +} Index: dashboard.page.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/dashboard/dashboard.page.inc,v retrieving revision 1.3 diff -u -p -r1.3 dashboard.page.inc --- dashboard.page.inc 12 Apr 2009 05:47:11 -0000 1.3 +++ dashboard.page.inc 13 Apr 2009 16:09:43 -0000 @@ -19,6 +19,9 @@ function dashboard_page($page = NULL) { } dashboard_add_ui($page); + // Allow for modules to run pre-generation alterations. + dashboard_invoke('dashboard_pre_render', $page); + $gadgets = array_fill(0, 3, ''); $result = db_query('SELECT gadget_id, module, name, col FROM {dashboard_gadget} WHERE page_id = %d ORDER BY weight', $page->page_id); while ($gadget = db_fetch_object($result)) { @@ -35,6 +38,9 @@ function dashboard_page($page = NULL) { $gadgets[$gadget->col] .= theme('dashboard_gadget', $info); } + // Allow for modules to run post-generation alterations. + dashboard_invoke('dashboard_post_render', $page); + return theme('dashboard_page', $gadgets); }