? .DS_Store
? make_node_optional_14.patch
? node_decouple_block_03.patch
? node_decouple_block_04.patch
? node_decouple_help_00.patch
? node_decouple_locale_04.patch
? node_decouple_profile_00.patch
? remove_fieldset_body_title_01.patch
? rename_node_to_content_00.patch
? rework_trigger_menu_00.patch
? rework_trigger_menu_01.patch
? test.patch
? modules/.DS_Store
? sites/.DS_Store
? sites/default/files
? sites/default/settings.php
Index: modules/trigger/trigger.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/trigger/trigger.admin.inc,v
retrieving revision 1.14
diff -u -p -r1.14 trigger.admin.inc
--- modules/trigger/trigger.admin.inc	20 Jul 2009 18:51:35 -0000	1.14
+++ modules/trigger/trigger.admin.inc	9 Aug 2009 17:53:09 -0000
@@ -15,12 +15,6 @@
  *   HTML form.
  */
 function trigger_assign($type = NULL) {
-  // If no type is specified we default to node actions, since they
-  // are the most common.
-  if (!isset($type)) {
-    drupal_goto('admin/structure/trigger/node');
-  }
-
   $build = array();
   $hooks = module_invoke_all('hook_info');
   foreach ($hooks as $module => $hook) {
Index: modules/trigger/trigger.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/trigger/trigger.module,v
retrieving revision 1.41
diff -u -p -r1.41 trigger.module
--- modules/trigger/trigger.module	20 Jul 2009 18:51:35 -0000	1.41
+++ modules/trigger/trigger.module	9 Aug 2009 17:53:09 -0000
@@ -37,69 +37,35 @@ function trigger_help($path, $arg) {
 function trigger_menu() {
   $items['admin/structure/trigger'] = array(
     'title' => 'Triggers',
-    'description' => 'Tell Drupal when to execute actions.',
+    'description' => 'Assign actions to system events.',
     'page callback' => 'trigger_assign',
-    'access callback' => 'trigger_access_check',
-    'access arguments' => array('node'),
-  );
-  // We don't use a menu wildcard here because these are tabs,
-  // not invisible items.
-  $items['admin/structure/trigger/node'] = array(
-    'title' => 'Content',
-    'page callback' => 'trigger_assign',
-    'page arguments' => array('node'),
-    'access callback' => 'trigger_access_check',
-    'access arguments' => array('node'),
-    'type' => MENU_LOCAL_TASK,
-  );
-  $items['admin/structure/trigger/user'] = array(
-    'title' => 'Users',
-    'page callback' => 'trigger_assign',
-    'page arguments' => array('user'),
-    'access callback' => 'trigger_access_check',
-    'access arguments' => array('user'),
-    'type' => MENU_LOCAL_TASK,
-  );
-  $items['admin/structure/trigger/comment'] = array(
-    'title' => 'Comments',
-    'page callback' => 'trigger_assign',
-    'page arguments' => array('comment'),
-    'access callback' => 'trigger_access_check',
-    'access arguments' => array('comment'),
-    'type' => MENU_LOCAL_TASK,
-  );
-  $items['admin/structure/trigger/taxonomy'] = array(
-    'title' => 'Taxonomy',
-    'page callback' => 'trigger_assign',
-    'page arguments' => array('taxonomy'),
-    'access callback' => 'trigger_access_check',
-    'access arguments' => array('taxonomy'),
-    'type' => MENU_LOCAL_TASK,
+    'page arguments' => array('cron'),
+    'access arguments' => array('administer actions'),
   );
+  // Create tabs for every module that exposes its hooks. System.module only
+  // exposes hook_cron(), so create its tab manually.
   $items['admin/structure/trigger/cron'] = array(
     'title' => 'Cron',
     'page callback' => 'trigger_assign',
     'page arguments' => array('cron'),
     'access arguments' => array('administer actions'),
-    'type' => MENU_LOCAL_TASK,
+    'type' => MENU_DEFAULT_LOCAL_TASK,
   );
-
-  // We want contributed modules to be able to describe
-  // their hooks and have actions assignable to them.
-  $hooks = module_invoke_all('hook_info');
-  foreach ($hooks as $module => $hook) {
-    // We've already done these.
-    if (in_array($module, array('node', 'comment', 'user', 'system', 'taxonomy'))) {
+  $modules = module_implements('hook_info');
+  $modules_info = db_select('system')
+    ->fields('system', array('name', 'info'))
+    ->condition('name', $modules, 'IN')
+    ->execute()
+    ->fetchAllAssoc('name');
+  foreach ($modules as $module) {
+    // We created System's tab manually.
+    if ($module == 'system') {
       continue;
     }
-    $info = db_select('system')
-      ->condition('name', $module)
-      ->execute()
-      ->fetchField();
-    $info = unserialize($info);
-    $nice_name = $info['name'];
+
+    $module_info = unserialize($modules_info[$module]->info);
     $items["admin/structure/trigger/$module"] = array(
-      'title' => $nice_name,
+      'title' => $module_info['name'],
       'page callback' => 'trigger_assign',
       'page arguments' => array($module),
       'access arguments' => array($module),
@@ -119,13 +85,6 @@ function trigger_menu() {
 }
 
 /**
- * Access callback for menu system.
- */
-function trigger_access_check($module) {
-  return (module_exists($module) && user_access('administer actions'));
-}
-
-/**
  * Get the aids of actions to be executed for a hook-op combination.
  *
  * @param $hook
