You are here

function _spaces_og_make_hidden in Spaces 5.2

Same name and namespace in other branches
  1. 6.3 spaces_og/spaces_og.pages.inc \_spaces_og_make_hidden()
  2. 6 spaces_og/spaces_og.module \_spaces_og_make_hidden()
  3. 6.2 spaces_og/spaces_og.module \_spaces_og_make_hidden()
  4. 7.3 spaces_og/spaces_og.pages.inc \_spaces_og_make_hidden()
  5. 7 spaces_og/spaces_og.pages.inc \_spaces_og_make_hidden()

Set all elements in a given form to 'value'. Using value preserves the tree and prevents The element from being rendered.

2 calls to _spaces_og_make_hidden()
_spaces_og_form_alter_group in ./spaces_og.module
Group node form_alter()
_spaces_og_form_alter_node in ./spaces_og.module
Group-enabled node form_alter()

File

./spaces_og.module, line 708

Code

function _spaces_og_make_hidden(&$form) {
  if (isset($form['#type'])) {
    $form['#type'] = 'value';
    $form['#required'] = false;
  }
  if (is_array($form)) {
    foreach ($form as $key => $value) {
      if (is_array($value) && strpos($key, '#') !== 0) {
        _spaces_og_make_hidden($form[$key]);
      }
    }
  }
}