You are here

function _spaces_og_make_hidden in Spaces 6.3

Same name and namespace in other branches
  1. 5.2 spaces_og.module \_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/spaces_og.pages.inc
Group node form_alter(). @TODO: repair default values on node previews.
_spaces_og_form_alter_node in spaces_og/spaces_og.pages.inc
Group-enabled node form_alter()

File

spaces_og/spaces_og.pages.inc, line 201

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]);
      }
    }
  }
}