| 1 |
<?php |
<?php |
| 2 |
// $Id: rules.api.php,v 1.1.2.7 2009/08/19 11:20:17 fago Exp $ |
// $Id: rules.api.php,v 1.1.2.8 2009/08/25 14:52:52 fago Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 644 |
} |
} |
| 645 |
} |
} |
| 646 |
|
|
| 647 |
|
/** |
| 648 |
|
* Provides a default rule. |
| 649 |
|
* |
| 650 |
|
* Modules that implement this hook have to provide a configuration array that |
| 651 |
|
* contains rules and/or rule sets. You can use the output from the export |
| 652 |
|
* functionality, but you have to change rules and rule sets names and you need |
| 653 |
|
* to set the status property to 'default' or 'fixed'. |
| 654 |
|
* |
| 655 |
|
* @return |
| 656 |
|
* An array containing the configuration. |
| 657 |
|
* |
| 658 |
|
* @see http://drupal.org/node/298634 |
| 659 |
|
*/ |
| 660 |
|
function hook_rules_defaults() { |
| 661 |
|
$config = array ( |
| 662 |
|
'rules' => |
| 663 |
|
array ( |
| 664 |
|
// A default rule. |
| 665 |
|
'yourmodule_default_rule_1' => array( |
| 666 |
|
'#status' => 'default', |
| 667 |
|
// Your other rule properties here. |
| 668 |
|
), |
| 669 |
|
// A fixed rule (hidden from the Rules admin user interface). |
| 670 |
|
'yourmodule_default_rule_2' => array( |
| 671 |
|
'#status' => 'fixed', |
| 672 |
|
// Your other rule properties here. |
| 673 |
|
), |
| 674 |
|
), |
| 675 |
|
'rule_sets' => |
| 676 |
|
array( |
| 677 |
|
// A default rule set. |
| 678 |
|
'yourmodule_default_set_1' => array( |
| 679 |
|
'status' => 'default', |
| 680 |
|
// Your other rule set properties here. |
| 681 |
|
), |
| 682 |
|
// A fixed rule set (hidden from the Rules admin user interface). |
| 683 |
|
'yourmodule_default_set_2' => array( |
| 684 |
|
'status' => 'fixed', |
| 685 |
|
// Your other rule properties here. |
| 686 |
|
), |
| 687 |
|
), |
| 688 |
|
); |
| 689 |
|
return $config; |
| 690 |
|
} |
| 691 |
|
|
| 692 |
/** |
/** |
| 693 |
* @} |
* @} |