You are here

function getlocations_fields_settings_form in Get Locations 7

Same name and namespace in other branches
  1. 7.2 modules/getlocations_fields/getlocations_fields.admin.inc \getlocations_fields_settings_form()

Function to display the getlocations admin settings form

Return value

Returns the form.

1 string reference to 'getlocations_fields_settings_form'
getlocations_fields_menu in modules/getlocations_fields/getlocations_fields.module
Implements hook_menu().

File

modules/getlocations_fields/getlocations_fields.admin.inc, line 18
getlocations_fields.admin.inc @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function getlocations_fields_settings_form() {
  $getlocations_fields_defaults = getlocations_fields_defaults();
  $form = array();
  $pagetitle = '<div><h4>' . t('Getlocations Fields') . '</h4></div>';
  $form['pagetitle'] = array(
    '#markup' => $pagetitle,
  );
  $form['getlocations_fields_defaults'] = array(
    '#type' => 'fieldset',
    '#title' => t('Getlocations Fields Default settings'),
    '#description' => t('The settings here will provide the defaults for all Getlocations enabled content types.'),
    // This will store all the defaults in one variable.
    '#tree' => TRUE,
  );
  $form['getlocations_fields_defaults'] += getlocations_fields_input_settings_form($getlocations_fields_defaults);
  $form['getlocations_fields_defaults'] += getlocations_fields_display_settings_form($getlocations_fields_defaults);
  $form['getlocations_fields_paths'] = array(
    '#type' => 'fieldset',
    '#title' => t('Javascript paths'),
    '#description' => t('For advanced users who want to supply their own javascript.'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    // This will store all the defaults in one variable.
    '#tree' => TRUE,
  );
  $getlocations_fields_paths = getlocations_fields_paths_get();
  $form['getlocations_fields_paths']['getlocations_fields_path'] = getlocations_element_path(t('Path to getlocations_fields javascript file'), $getlocations_fields_paths['getlocations_fields_path'], 80, 128, t('Where the getlocations_fields javascript file is located.'));
  $form['getlocations_fields_paths']['getlocations_fields_preview_path'] = getlocations_element_path(t('Path to getlocations_fields preview javascript file'), $getlocations_fields_paths['getlocations_fields_preview_path'], 80, 128, t('Where the getlocations_fields preview javascript file is located.'));

  // streetview
  $form['getlocations_fields_paths']['getlocations_fields_streetview_path'] = getlocations_element_path(t('Path to getlocations fields Streetview javascript file'), $getlocations_fields_paths['getlocations_fields_streetview_path'], 80, 128, t('Where the getlocations fields streetview javascript file is located.'));

  // admin
  $form['getlocations_fields_paths']['getlocations_fields_admin_path'] = getlocations_element_path(t('Path to getlocations fields Admin javascript file'), $getlocations_fields_paths['getlocations_fields_admin_path'], 80, 128, t('Where the getlocations fields admin javascript file is located.'));

  // formatter
  $form['getlocations_fields_paths']['getlocations_fields_formatter_path'] = getlocations_element_path(t('Path to getlocations fields Formatter javascript file'), $getlocations_fields_paths['getlocations_fields_formatter_path'], 80, 128, t('Where the getlocations fields formatter javascript file is located.'));

  // views
  $form['getlocations_fields_paths']['getlocations_fields_views_path'] = getlocations_element_path(t('Path to getlocations fields Views javascript file'), $getlocations_fields_paths['getlocations_fields_views_path'], 80, 128, t('Where the getlocations fields views javascript file is located.'));

  // search views
  $form['getlocations_fields_paths']['getlocations_fields_search_views_path'] = getlocations_element_path(t('Path to getlocations fields Search Views javascript file'), $getlocations_fields_paths['getlocations_fields_search_views_path'], 80, 128, t('Where the getlocations fields search views javascript file is located.'));
  $form['getlocations_fields_paths']['reset'] = getlocations_element_dd(t('Reset'), 0, array(
    0 => t('No'),
    1 => t('Reset'),
    2 => t('Reset to minified'),
  ), t('Reset the paths to the defaults.'));
  unset($form['#theme']);
  $form['#theme'] = 'getlocations_fields_settings_form';
  $form['#validate'][] = 'getlocations_fields_settings_validate';
  return system_settings_form($form);
}