You are here

function sweaver_plugin_config_plugins_submit in Sweaver 6

Same name and namespace in other branches
  1. 7 sweaver.admin.inc \sweaver_plugin_config_plugins_submit()

Plugins form submit callback.

File

./sweaver.admin.inc, line 87
Administrative functions for sweaver plugins.

Code

function sweaver_plugin_config_plugins_submit(&$form, &$form_state) {

  // Reset cookies.
  setcookie('sweaver_active_tab', 'sweaver_plugin_editor');
  $plugins_order = array();
  foreach ($form['#plugins'] as $plugin_name => $weight) {
    variable_set('sweaver_plugin_status_' . $plugin_name, $form_state['values'][$plugin_name]['status']);
    $plugins_order[$plugin_name] = $form_state['values'][$plugin_name]['weight'];
  }
  variable_set('sweaver_plugins_weight', $plugins_order);
  drupal_flush_all_caches();
  drupal_set_message(t('The configuration options have been saved.'));
}