You are here

function mostpopular_services_admin_form_validate in Drupal Most Popular 7

File

./mostpopular.services.inc, line 140
Provides an admin GUI for configuring services.

Code

function mostpopular_services_admin_form_validate($form, $form_state) {
  foreach ($form_state['values']['blocks'] as $bid => $block) {
    if (isset($block['services'])) {
      foreach ($block['services'] as $sid => $service) {
        $title = $service['title'];
        $enabled = $service['enabled'];
        if ($enabled && empty($title)) {
          form_set_error("blocks][{$bid}][{$sid}][title", t('You must choose a title to be displayed this service.'));
        }
      }
    }
  }
}