You are here

function msnf_alter_extra_weights in Multistep Nodeform 6

Pre-render callback to adjust weights of non-CCK fields.

1 string reference to 'msnf_alter_extra_weights'
msnf_prepare_form_step in ./msnf.module
Function to prepare the current form step and to alter the node form.

File

./msnf.module, line 146
Main functions for module "Multistep Nodeform".

Code

function msnf_alter_extra_weights($elements) {
  if (module_exists('content')) {

    // Use content.module's function if its installed.
    return content_alter_extra_weights($elements);
  }
  if (!isset($elements['type']['#value'])) {
    return $elements;
  }
  $weights = variable_get('content_extra_weights_' . $elements['type']['#value'], array());
  foreach ($weights as $field_name => $weight) {
    if (isset($elements[$field_name])) {
      $elements[$field_name]['#weight'] = $weight;
    }
  }
  return $elements;
}