Skip to main content
added 6 characters in body
Source Link
Pierre.Vriens
  • 36k
  • 40
  • 50
  • 182

Here is what's needed to integrate your exported rulesRules component in a custom module:

<?php
function MY_MODULE_NAME_default_rules_configuration() {
  $configs = array();
  $rule = '{ "my_exported_rule" : {
    "LABEL" : "My Exported Rule",
    ...,
  }
}';
  $configs['my_exported_rule'] = rules_import($rule);
  return $configs;
}
?>

So to use such exported Rule, you need to run it through the function rules_import(). This will change the exported Rule in a format that is usablefor usable for the Rules module.

To reuse this example:

  • Replace MY_MODULE_NAME with the machine name of your module.
  • Replace the value used for $rule by the content of your exported rule.
  • Make sure to use the machine name of your rule (= my_exported_rule in my sample) as the key in $configs.

In the sample contained in the question, the machine name of the rule is rules_faircent_rules, though that is NOT what is used in the $configs ... Therefor I think you should correct your code like so:

$configs['rules_faircent_rules'] = rules_import($rule);
echo '<pre>';
print_r($configs['rules_faircent_rules'] );

Refer to the articled "Drupal 7 - Defining rules within a module using PHP" for some more details.

Here is what's needed to integrate your exported rules component in a custom module:

<?php
function MY_MODULE_NAME_default_rules_configuration() {
  $configs = array();
  $rule = '{ "my_exported_rule" : {
    "LABEL" : "My Exported Rule",
    ...,
  }
}';
  $configs['my_exported_rule'] = rules_import($rule);
  return $configs;
}
?>

So to use such exported Rule, you need to run it through the function rules_import(). This will change the exported Rule in a format that is usablefor the Rules module.

To reuse this example:

  • Replace MY_MODULE_NAME with the machine name of your module.
  • Replace the value used for $rule by the content of your exported rule.
  • Make sure to use the machine name of your rule (= my_exported_rule in my sample) as the key in $configs.

In the sample contained in the question, the machine name of the rule is rules_faircent_rules, though that is NOT what is used in the $configs ... Therefor I think you should correct your code like so:

$configs['rules_faircent_rules'] = rules_import($rule);
echo '<pre>';
print_r($configs['rules_faircent_rules'] );

Refer to the articled "Drupal 7 - Defining rules within a module using PHP" for some more details.

Here is what's needed to integrate your exported Rules component in a custom module:

<?php
function MY_MODULE_NAME_default_rules_configuration() {
  $configs = array();
  $rule = '{ "my_exported_rule" : {
    "LABEL" : "My Exported Rule",
    ...,
  }
}';
  $configs['my_exported_rule'] = rules_import($rule);
  return $configs;
}
?>

So to use such exported Rule, you need to run it through the function rules_import(). This will change the exported Rule in a format that is usable for the Rules module.

To reuse this example:

  • Replace MY_MODULE_NAME with the machine name of your module.
  • Replace the value used for $rule by the content of your exported rule.
  • Make sure to use the machine name of your rule (= my_exported_rule in my sample) as the key in $configs.

In the sample contained in the question, the machine name of the rule is rules_faircent_rules, though that is NOT what is used in the $configs ... Therefor I think you should correct your code like so:

$configs['rules_faircent_rules'] = rules_import($rule);
echo '<pre>';
print_r($configs['rules_faircent_rules'] );

Refer to the articled "Drupal 7 - Defining rules within a module using PHP" for some more details.

deleted 19 characters in body
Source Link
Pierre.Vriens
  • 36k
  • 40
  • 50
  • 182

Here is "the meat" of what you should dowhat's needed to integrate your exported rules component in a custom module:

<?php
function MY_MODULE_NAME_default_rules_configuration() {
  $configs = array();
  $rule = '{ "my_exported_rule" : {
    "LABEL" : "My Exported Rule",
    ...,
  }
}';
  $configs['my_exported_rule'] = rules_import($rule);
  return $configs;
}
?>

So to use such exported Rule, you need to run it through the function rules_import(). This will change the exported Rule in a format that is usablefor the Rules module.

To reuse this example:

  • Replace MY_MODULE_NAME with the machine name of your module.
  • Replace the value used for $rule by the content of your exported rule.
  • Make sure to use the machine name of your rule (= my_exported_rule in my sample) as the key in $configs.

In the sample contained in the question, the machine name of the rule is rules_faircent_rules, though that is NOT what is used in the $configs ... Therefor I think you should correct your code like so:

$configs['rules_faircent_rules'] = rules_import($rule);
echo '<pre>';
print_r($configs['rules_faircent_rules'] );

Refer to the articled "Drupal 7 - Defining rules within a module using PHP" for some more details.

Here is "the meat" of what you should do to integrate your exported rules component in a custom module:

<?php
function MY_MODULE_NAME_default_rules_configuration() {
  $configs = array();
  $rule = '{ "my_exported_rule" : {
    "LABEL" : "My Exported Rule",
    ...,
  }
}';
  $configs['my_exported_rule'] = rules_import($rule);
  return $configs;
}
?>

So to use such exported Rule, you need to run it through the function rules_import(). This will change the exported Rule in a format that is usablefor the Rules module.

To reuse this example:

  • Replace MY_MODULE_NAME with the machine name of your module.
  • Replace the value used for $rule by the content of your exported rule.
  • Make sure to use the machine name of your rule (= my_exported_rule in my sample) as the key in $configs.

In the sample contained in the question, the machine name of the rule is rules_faircent_rules, though that is NOT what is used in the $configs ... Therefor I think you should correct your code like so:

$configs['rules_faircent_rules'] = rules_import($rule);
echo '<pre>';
print_r($configs['rules_faircent_rules'] );

Refer to the articled "Drupal 7 - Defining rules within a module using PHP" for some more details.

Here is what's needed to integrate your exported rules component in a custom module:

<?php
function MY_MODULE_NAME_default_rules_configuration() {
  $configs = array();
  $rule = '{ "my_exported_rule" : {
    "LABEL" : "My Exported Rule",
    ...,
  }
}';
  $configs['my_exported_rule'] = rules_import($rule);
  return $configs;
}
?>

So to use such exported Rule, you need to run it through the function rules_import(). This will change the exported Rule in a format that is usablefor the Rules module.

To reuse this example:

  • Replace MY_MODULE_NAME with the machine name of your module.
  • Replace the value used for $rule by the content of your exported rule.
  • Make sure to use the machine name of your rule (= my_exported_rule in my sample) as the key in $configs.

In the sample contained in the question, the machine name of the rule is rules_faircent_rules, though that is NOT what is used in the $configs ... Therefor I think you should correct your code like so:

$configs['rules_faircent_rules'] = rules_import($rule);
echo '<pre>';
print_r($configs['rules_faircent_rules'] );

Refer to the articled "Drupal 7 - Defining rules within a module using PHP" for some more details.

added 330 characters in body
Source Link
Pierre.Vriens
  • 36k
  • 40
  • 50
  • 182

Here is "the meat" of what you should do to integrate your exported rules component in a custom module:

<?php
function MY_MODULE_NAME_default_rules_configuration() {
  $configs = array();
  $rule = '{ "my_exported_rule" : {
    "LABEL" : "My Exported Rule",
    ...,
  }
}';
  $configs['my_exported_rule'] = rules_import($rule);
  return $configs;
}
?>

Replace MY_MODULE_NAME with the machine name of your module. And make sureSo to use such exported Rule, you need to run it through the machine name of your rule (=function my_exported_rulerules_import() in my sample) as. This will change the keyexported Rule in a format that is usablefor the $configsRules module.

To reuse this example:

  • Replace MY_MODULE_NAME with the machine name of your module.
  • Replace the value used for $rule by the content of your exported rule.
  • Make sure to use the machine name of your rule (= my_exported_rule in my sample) as the key in $configs.

In the sample contained in the question, the machine name of the rule is rules_faircent_rules, though that is NOT what is used in the $configs ... Therefor I think you should correct your code like so:

$configs['rules_faircent_rules'] = rules_import($rule);
echo '<pre>';
print_r($configs['rules_faircent_rules'] );

Refer to the articled "Drupal 7 - Defining rules within a module using PHP" for some more details.

Here is "the meat" of what you should do to integrate your exported rules component in a custom module:

<?php
function MY_MODULE_NAME_default_rules_configuration() {
  $configs = array();
  $rule = '{ "my_exported_rule" : {
    "LABEL" : "My Exported Rule",
    ...,
  }
}';
  $configs['my_exported_rule'] = rules_import($rule);
  return $configs;
}
?>

Replace MY_MODULE_NAME with the machine name of your module. And make sure to use the machine name of your rule (= my_exported_rule in my sample) as the key in $configs.

In the sample contained in the question, the machine name of the rule is rules_faircent_rules, though that is NOT what is used in the $configs ... Therefor I think you should correct your code like so:

$configs['rules_faircent_rules'] = rules_import($rule);
echo '<pre>';
print_r($configs['rules_faircent_rules'] );

Refer to the articled "Drupal 7 - Defining rules within a module using PHP" for some more details.

Here is "the meat" of what you should do to integrate your exported rules component in a custom module:

<?php
function MY_MODULE_NAME_default_rules_configuration() {
  $configs = array();
  $rule = '{ "my_exported_rule" : {
    "LABEL" : "My Exported Rule",
    ...,
  }
}';
  $configs['my_exported_rule'] = rules_import($rule);
  return $configs;
}
?>

So to use such exported Rule, you need to run it through the function rules_import(). This will change the exported Rule in a format that is usablefor the Rules module.

To reuse this example:

  • Replace MY_MODULE_NAME with the machine name of your module.
  • Replace the value used for $rule by the content of your exported rule.
  • Make sure to use the machine name of your rule (= my_exported_rule in my sample) as the key in $configs.

In the sample contained in the question, the machine name of the rule is rules_faircent_rules, though that is NOT what is used in the $configs ... Therefor I think you should correct your code like so:

$configs['rules_faircent_rules'] = rules_import($rule);
echo '<pre>';
print_r($configs['rules_faircent_rules'] );

Refer to the articled "Drupal 7 - Defining rules within a module using PHP" for some more details.

added 331 characters in body
Source Link
Pierre.Vriens
  • 36k
  • 40
  • 50
  • 182
Loading
Source Link
Pierre.Vriens
  • 36k
  • 40
  • 50
  • 182
Loading