? 835090-3-context_reaction_menu_trail.patch ? 835090-4-context_reaction_menu_trail.patch Index: context.core.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/context/Attic/context.core.inc,v retrieving revision 1.1.2.3.2.20.2.29 diff -u -p -r1.1.2.3.2.20.2.29 context.core.inc --- context.core.inc 5 Aug 2010 08:03:29 -0000 1.1.2.3.2.20.2.29 +++ context.core.inc 14 Aug 2010 00:21:29 -0000 @@ -298,6 +298,9 @@ function context_context_page_reaction() if ($plugin = context_get_plugin('reaction', 'breadcrumb')) { $plugin->execute(); } + if ($plugin = context_get_plugin('reaction', 'menu_trail')) { + $plugin->execute(); + } if ($plugin = context_get_plugin('reaction', 'css_injector')) { $plugin->execute(); } Index: context.plugins.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/context/Attic/context.plugins.inc,v retrieving revision 1.1.2.8 diff -u -p -r1.1.2.8 context.plugins.inc --- context.plugins.inc 30 Jul 2010 18:15:36 -0000 1.1.2.8 +++ context.plugins.inc 14 Aug 2010 00:21:29 -0000 @@ -88,10 +88,15 @@ function _context_context_registry() { 'plugin' => 'context_reaction_breadcrumb', ), 'menu' => array( - 'title' => t('Menu'), + 'title' => t('Menu class'), 'description' => t('Control menu active class using context.'), 'plugin' => 'context_reaction_menu', ), + 'menu_trail' => array( + 'title' => t('Menu trail'), + 'description' => t('Set the current page to behave like a child of the selected menu item.'), + 'plugin' => 'context_reaction_menu_trail', + ), 'theme' => array( 'title' => t('Theme'), 'description' => t('Control theme variables using context.'), @@ -268,6 +273,14 @@ function _context_context_plugins() { 'parent' => 'context_reaction', ), ); + $plugins['context_reaction_menu_trail'] = array( + 'handler' => array( + 'path' => drupal_get_path('module', 'context') .'/plugins', + 'file' => 'context_reaction_menu_trail.inc', + 'class' => 'context_reaction_menu_trail', + 'parent' => 'context_reaction_menu', + ), + ); $plugins['context_reaction_theme'] = array( 'handler' => array( 'path' => drupal_get_path('module', 'context') .'/plugins', Index: plugins/context_reaction_menu_trail.inc =================================================================== RCS file: plugins/context_reaction_menu_trail.inc diff -N plugins/context_reaction_menu_trail.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ plugins/context_reaction_menu_trail.inc 14 Aug 2010 00:21:29 -0000 @@ -0,0 +1,22 @@ +get_contexts(); + foreach ($contexts as $context) { + if (!empty($context->reactions[$this->plugin])) { + $item['href'] = $context->reactions[$this->plugin]; + menu_set_item(NULL, $item); + break; + } + } + } +}