You are here

function rules_forms_action_adjust_weight in Rules 6

Action implementation: Adjust weight of a form element.

Related topics

File

rules_forms/rules_forms.rules.inc, line 199
Rules integration to provide form support

Code

function rules_forms_action_adjust_weight(&$form, $element, $weight) {

  // CCK overrides weight settings in #content_extra_fields
  if (isset($form['#content_extra_fields'][$element]['weight'])) {
    $form['#content_extra_fields'][$element]['weight'] = $weight;
  }
  else {
    $form_element =& _rules_forms_get_element($form, $element);
    $form_element['#weight'] = $weight;
  }
}