You are here

function rules_get_configured_items in Rules 6

Gets all configured items, regardless if defined by the admin or by a module

Parameters

$items Which items to get, e.g. 'rules' or 'rule_sets'. Use NULL when clearing the cache.:

Whether the cache should be cleared:

Return value

An array of configured items, where the structure of the item configuration depends on the item

25 calls to rules_get_configured_items()
rules_admin_export_by_category in rules_admin/rules_admin.export.inc
Adds in the rule items for the given tags.
rules_admin_form_export in rules_admin/rules_admin.export.inc
Exports one or more configurations
rules_admin_form_export_submit in rules_admin/rules_admin.export.inc
rules_admin_form_overview in rules_admin/rules_admin.rule_forms.inc
Lists the available rules.
rules_admin_form_rule_settings in rules_admin/rules_admin.rule_forms.inc
Returns the form for the settings of a rule

... See full list

File

rules/rules.module, line 792
Rules engine module

Code

function rules_get_configured_items($item_type = 'rules', $reset = FALSE) {
  static $configurations = array();
  if ($reset) {
    $configurations = array();
  }
  if (isset($item_type) && !isset($configurations[$item_type])) {
    $info = rules_get_items($item_type);

    //get and add altered default items
    $result = db_query("SELECT * FROM {" . $info['db_table'] . "} ORDER by name");
    $configurations[$item_type] = array();
    while ($row = db_fetch_object($result)) {
      $configurations[$item_type][$row->name] = unserialize(db_decode_blob($row->data));
    }

    //add not altered default items
    $configurations[$item_type] += rules_get_item_defaults($item_type);
  }
  return isset($item_type) ? $configurations[$item_type] : array();
}