You are here

function sharerich_admin_form_submit in Sharerich 7

Implements sharerich_admin_form_submit().

1 string reference to 'sharerich_admin_form_submit'
sharerich_admin_form in ./sharerich.admin.inc
Implements hook_form().

File

./sharerich.admin.inc, line 106
Admin page.

Code

function sharerich_admin_form_submit(&$form, $form_state) {
  $reset = FALSE;
  foreach ($form_state['values']['sharerich_services'] as $service_name) {

    // If the file is not stored in the variables, read the file, otherwise
    // save the changes on existing variable.
    $var_name = 'sharerich_custom_' . $service_name;
    $var_get = variable_get($var_name, '');
    if (empty($var_get) || $reset) {
      variable_set($var_name, sharerich_load_service($service_name));
    }
    else {
      if (isset($form_state['values']['sharerich_custom_' . $service_name])) {
        variable_set($var_name, $form_state['values']['sharerich_custom_' . $service_name]);
      }
    }
  }
}