You are here

function quicktabs_form_validate in Quick Tabs 5

Same name and namespace in other branches
  1. 6.3 includes/admin.inc \quicktabs_form_validate()
  2. 6 quicktabs.module \quicktabs_form_validate()
  3. 6.2 includes/admin.inc \quicktabs_form_validate()
  4. 7.3 quicktabs.admin.inc \quicktabs_form_validate()
  5. 7.2 includes/admin.inc \quicktabs_form_validate()

File

./quicktabs.module, line 395

Code

function quicktabs_form_validate($form_id, $form_values) {
  if ($form_values['op'] == t('Submit')) {
    if (empty($form_values['title'])) {
      form_set_error('title', t('You must give your Quick Tabs block a title.'));
    }
    else {
      foreach ($form_values['tabs'] as $i => $tab) {
        if (empty($tab['tabtext'])) {
          form_set_error($form_values['tabs'][$i]['tabtext'], t('You must give each tab a title.'));
        }
        if ($tab['tabtype'] == 'view' && empty($tab['limit'])) {
          form_set_error($form_values['tabs'][$i]['limit'], t('You must enter a limit for each view.'));
        }
      }
    }
  }
  else {
    return;
  }
}