You are here

function rules_admin_rule_proxy::_generate_index in Rules 6

Creates an id for each element and stores a reference on it

1 call to rules_admin_rule_proxy::_generate_index()
rules_admin_rule_proxy::rules_admin_rule_proxy in rules_admin/rules_admin.rule_proxy.inc
Constructor

File

rules_admin/rules_admin.rule_proxy.inc, line 104
Contains the rules proxy class

Class

rules_admin_rule_proxy
This is a smally proxy for the real rule. It provides some useful operations for the admin UI. It builds a small index for the elements of a rule, so that they can be easily identified and modified.

Code

function _generate_index(&$elements) {

  //generate ids
  $this->_counter++;
  $this->map[$this->_counter] =& $elements;

  //recurse
  foreach (element_children($elements) as $key) {
    $this
      ->_generate_index($elements[$key]);
  }
}