You are here

function rules_admin_form_edit in Rules 6

Returns the form for the edit operation This handles editing conditions and actions

Parameters

$id The id of the the element where the condition / action is to be added:

1 string reference to 'rules_admin_form_edit'
rules_admin_menu in rules_admin/rules_admin.module
Implementation of hook_menu().

File

rules_admin/rules_admin.rule_forms.inc, line 435

Code

function rules_admin_form_edit(&$form_state, $proxy, $element) {
  if (!isset($form_state['element'])) {

    //initial step!
    $form_state += array(
      'element' => $element,
      'step' => 1,
    );
  }

  //just call the add form with the appropriate step.
  $type = in_array($element['#type'], array(
    'action',
    'condition',
  )) ? $element['#type'] : 'op';
  return rules_admin_form_add($form_state, $proxy, $type);
}