You are here

function environment_indicator_ui_form_submit in Environment Indicator 7.2

Submit callback for environment_indicator_ui_form().

1 string reference to 'environment_indicator_ui_form_submit'
environment_indicator_ui.inc in plugins/export_ui/environment_indicator_ui.inc

File

./environment_indicator.module, line 245
Module implementation file.

Code

function environment_indicator_ui_form_submit(&$form, &$form_state) {
  $form_state['item']->settings = array(
    'color' => $form_state['values']['color'],
    'text_color' => $form_state['values']['text_color'],
    'weight' => $form_state['values']['weight'],
    'position' => $form_state['values']['position'],
    'fixed' => $form_state['values']['fixed'],
  );

  // We need to flush admin_menu module cache so that the new indicator shows
  // up properly.
  $integrations = variable_get('environment_indicator_integration', array(
    'toolbar' => 'toolbar',
    'admin_menu' => 'admin_menu',
    'navbar' => 'navbar',
  ));
  if (module_exists('admin_menu') && user_access('access administration menu') && !empty($integrations['admin_menu'])) {
    admin_menu_flush_caches();
  }

  // Invalidate the environment_indicator cache.
  cache_clear_all('environment_indicator', 'cache');
}