You are here

function mostpopular_services_admin_form_submit in Drupal Most Popular 7

1 string reference to 'mostpopular_services_admin_form_submit'
mostpopular_services_admin_form in ./mostpopular.services.inc
Renders a form for configuring the blocks and services.

File

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

Code

function mostpopular_services_admin_form_submit($form, $form_state) {
  $services = $form_state['services'];
  foreach ($form_state['values']['blocks'] as $bid => $block) {
    if (isset($block['services'])) {
      foreach ($block['services'] as $sid => $values) {
        if (isset($services[$bid][$sid])) {
          $service = $services[$bid][$sid];
          foreach ($values as $key => $val) {
            $service->{$key} = $val;
          }
          mostpopular_service_save($service);
        }
      }
    }
  }
  drupal_set_message(t('Your service configuration has been saved.'));
}