You are here

function _patterns_modify_value in Patterns 7

Same name and namespace in other branches
  1. 5 patterns.module \_patterns_modify_value()
  2. 6.2 patterns.module \_patterns_modify_value()
  3. 6 patterns.module \_patterns_modify_value()
  4. 7.2 includes/unused.inc \_patterns_modify_value()

Function callback

File

includes/unused.inc, line 492
Functions that are unused at the moment.

Code

function _patterns_modify_value(&$form) {
  foreach ($form as $key => $value) {
    if (is_array($value) && isset($value['#type']) && $value['#type'] == 'value') {
      $form[$key]['#default_value'] = $value['#value'];
      unset($form[$key]['#value']);
    }
    elseif (is_array($value)) {
      _patterns_modify_value($form[$key]);
    }
  }
}