You are here

function spaces_og_nodeform_validate in Spaces 7

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

Element validator for group targeting selector.

File

spaces_og/spaces_og.pages.inc, line 191

Code

function spaces_og_nodeform_validate($element, &$form_state) {
  if ($element['#value'] == 0) {
    if ($group_types = og_get_types('group')) {
      $typename = node_type_get_name(array_shift($group_types));
    }
    form_error($element, t('Please choose a !typename to post to.', array(
      '!typename' => strtolower($typename),
    )));
  }
}