You are here

function spaces_site_frontpage_validate in Spaces 6.3

Same name and namespace in other branches
  1. 7.3 spaces.admin.inc \spaces_site_frontpage_validate()
  2. 7 spaces.admin.inc \spaces_site_frontpage_validate()

Validation for site_frontpage setting in spaces forms.

1 string reference to 'spaces_site_frontpage_validate'
spaces_features_form in ./spaces.admin.inc
Spaces features form.

File

./spaces.admin.inc, line 87

Code

function spaces_site_frontpage_validate($element, &$form_state) {
  if ($element['#value'] == 'spaces-other') {
    $path = $form_state['values']['site_frontpage_path'];
    $form_state['values']['site_frontpage'] = $element['#value'] = $path;
    unset($form_state['values']['site_frontpage_path']);
  }
  if ($element['#value'] !== 'spaces-frontpage') {
    $item = menu_get_item($element['#value']);
    if (!$item) {
      form_error($element, t('Invalid front page selected'));
    }
  }
}