You are here

function farm_install_configure_form_submit in farmOS 7

Submit function for farmOS configuration install task form.

File

./farm.install, line 159
farmOS install file.

Code

function farm_install_configure_form_submit($form, &$form_state) {

  // Save the list of selected modules to a variable.
  if (!empty($form_state['values']['farm_modules'])) {
    variable_set('farm_install_optional_modules', $form_state['values']['farm_modules']);
  }

  // Save the selected system of measure.
  if (!empty($form_state['values']['farm_quantity_unit_system'])) {
    variable_set('farm_quantity_unit_system', $form_state['values']['farm_quantity_unit_system']);
  }

  // If a Google Maps API key was provided, save it and enable the module.
  if (!empty($form_state['values']['farm_map_google_api_key'])) {
    variable_set('farm_map_google_api_key', $form_state['values']['farm_map_google_api_key']);
    if (!module_exists('farm_map_google')) {
      module_enable(array(
        'farm_map_google',
      ));
    }
  }

  // If a Mapbox API key was provided, save it and enable the module.
  if (!empty($form_state['values']['farm_map_mapbox_api_key'])) {
    variable_set('farm_map_mapbox_api_key', $form_state['values']['farm_map_mapbox_api_key']);
    if (!module_exists('farm_map_mapbox')) {
      module_enable(array(
        'farm_map_mapbox',
      ));
    }
  }
}