? rules-551316.patch
Index: rules/rules.api.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/rules/rules/Attic/rules.api.php,v
retrieving revision 1.1.2.8
diff -u -p -r1.1.2.8 rules.api.php
--- rules/rules.api.php	25 Aug 2009 14:52:52 -0000	1.1.2.8
+++ rules/rules.api.php	6 Sep 2009 17:32:59 -0000
@@ -644,6 +644,50 @@ function hook_rules_import($rule) {
   }
 }
 
+/**
+ * Provides a default rule.
+ *
+ * Modules that implement this hook have to provide a configuration array that
+ * contains rules and/or rule sets. You can use the output from the export
+ * functionality, but you have to change rules and rule sets names and you need
+ * to set the status property to 'default' or 'fixed'.
+ *
+ * @return
+ *   An array containing the configuration.
+ * 
+ * @see http://drupal.org/node/298634
+ */
+function hook_rules_defaults() {
+  $config = array (
+    'rules' =>
+    array (
+       // A default rule.
+      'yourmodule_default_rule_1' => array(
+        '#status' => 'default',
+        // Your other rule properties here.
+      ),
+      // A fixed rule (hidden from the Rules admin user interface).
+      'yourmodule_default_rule_2' => array(
+        '#status' => 'fixed',
+        // Your other rule properties here.
+      ),
+    ),
+    'rule_sets' =>
+    array(
+      // A default rule set.
+      'yourmodule_default_set_1' => array(
+        'status' => 'default',
+        // Your other rule set properties here.
+      ),
+      // A fixed rule set (hidden from the Rules admin user interface).
+      'yourmodule_default_set_2' => array(
+        'status' => 'fixed',
+        // Your other rule properties here.
+      ),
+    ),
+  );
+  return $config;
+}
 
 /**
  * @}
