You are here

function og_context_configure_form_submit in Organic groups 7

Same name and namespace in other branches
  1. 7.2 og_context/og_context.admin.inc \og_context_configure_form_submit()

Submit handler for og_context negotiation settings.

Related topics

1 string reference to 'og_context_configure_form_submit'
og_context_configure_form in og_context/og_context.admin.inc
Setting for language negotiation options

File

og_context/og_context.admin.inc, line 165
Administration functions for Group context module.

Code

function og_context_configure_form_submit($form, &$form_state) {
  $type = 'group_context';
  $negotiation = array();
  $enabled_providers = $form_state['values'][$type]['enabled'];
  $providers_weight = $form_state['values'][$type]['weight'];
  foreach ($providers_weight as $id => $weight) {
    if ($enabled_providers[$id]) {
      $provider = $form[$type]['#group_context_providers'][$id];
      $provider['weight'] = $weight;
      $negotiation[$id] = $provider;
    }
  }
  og_context_negotiation_set($negotiation);
  variable_set("og_context_providers_weight_{$type}", $providers_weight);
  $form_state['redirect'] = 'admin/config/group/context';
  drupal_set_message(t('Group context negotiation configuration saved.'));
}