You are here

function theme_getlocations_fields_settings_form in Get Locations 7

Same name and namespace in other branches
  1. 7.2 modules/getlocations_fields/getlocations_fields.module \theme_getlocations_fields_settings_form()

The settings form

Parameters

array $variables:

Return value

Returns $output

File

modules/getlocations_fields/getlocations_fields.module, line 4785
getlocations_fields.module @author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function theme_getlocations_fields_settings_form($variables) {
  $form = $variables['form'];
  $output = '';

  // try table
  $header = array();
  $no_striping = TRUE;
  $rows = array(
    array(
      'data' => array(
        array(
          'data' => $form['getlocations_fields_defaults']['input_name_width'],
          'class' => array(
            'getlocations_fields_input_cell1',
          ),
        ),
        array(
          'data' => $form['getlocations_fields_defaults']['input_name_weight'],
          'class' => array(
            'getlocations_fields_input_cell2',
          ),
        ),
        array(
          'data' => $form['getlocations_fields_defaults']['input_name_required'],
          'class' => array(
            'getlocations_fields_input_cell3',
          ),
        ),
      ),
      'no_striping' => $no_striping,
    ),
    array(
      'data' => array(
        array(
          'data' => $form['getlocations_fields_defaults']['input_street_width'],
          'class' => array(
            'getlocations_fields_input_cell1',
          ),
        ),
        array(
          'data' => $form['getlocations_fields_defaults']['input_street_weight'],
          'class' => array(
            'getlocations_fields_input_cell2',
          ),
        ),
        array(
          'data' => $form['getlocations_fields_defaults']['input_street_required'],
          'class' => array(
            'getlocations_fields_input_cell3',
          ),
        ),
      ),
      'no_striping' => $no_striping,
    ),
    array(
      'data' => array(
        array(
          'data' => $form['getlocations_fields_defaults']['input_additional_width'],
          'class' => array(
            'getlocations_fields_input_cell1',
          ),
        ),
        array(
          'data' => $form['getlocations_fields_defaults']['input_additional_weight'],
          'class' => array(
            'getlocations_fields_input_cell2',
          ),
        ),
        array(
          'data' => $form['getlocations_fields_defaults']['input_additional_required'],
          'class' => array(
            'getlocations_fields_input_cell3',
          ),
        ),
      ),
      'no_striping' => $no_striping,
    ),
    array(
      'data' => array(
        array(
          'data' => $form['getlocations_fields_defaults']['input_city_width'],
          'class' => array(
            'getlocations_fields_input_cell1',
          ),
        ),
        array(
          'data' => $form['getlocations_fields_defaults']['input_city_weight'],
          'class' => array(
            'getlocations_fields_input_cell2',
          ),
        ),
        array(
          'data' => $form['getlocations_fields_defaults']['input_city_required'],
          'class' => array(
            'getlocations_fields_input_cell3',
          ),
        ),
      ),
      'no_striping' => $no_striping,
    ),
    array(
      'data' => array(
        array(
          'data' => $form['getlocations_fields_defaults']['input_province_width'],
          'class' => array(
            'getlocations_fields_input_cell1',
          ),
        ),
        array(
          'data' => $form['getlocations_fields_defaults']['input_province_weight'],
          'class' => array(
            'getlocations_fields_input_cell2',
          ),
        ),
        array(
          'data' => $form['getlocations_fields_defaults']['input_province_required'],
          'class' => array(
            'getlocations_fields_input_cell3',
          ),
        ),
      ),
      'no_striping' => $no_striping,
    ),
    array(
      'data' => array(
        array(
          'data' => $form['getlocations_fields_defaults']['input_postal_code_width'],
          'class' => array(
            'getlocations_fields_input_cell1',
          ),
        ),
        array(
          'data' => $form['getlocations_fields_defaults']['input_postal_code_weight'],
          'class' => array(
            'getlocations_fields_input_cell2',
          ),
        ),
        array(
          'data' => $form['getlocations_fields_defaults']['input_postal_code_required'],
          'class' => array(
            'getlocations_fields_input_cell3',
          ),
        ),
      ),
      'no_striping' => $no_striping,
    ),
    array(
      'data' => array(
        array(
          'data' => $form['getlocations_fields_defaults']['input_country_width'],
          'class' => array(
            'getlocations_fields_input_cell1',
          ),
        ),
        array(
          'data' => $form['getlocations_fields_defaults']['input_country_weight'],
          'class' => array(
            'getlocations_fields_input_cell2',
          ),
        ),
        array(
          'data' => $form['getlocations_fields_defaults']['input_country_required'],
          'class' => array(
            'getlocations_fields_input_cell3',
          ),
        ),
      ),
      'no_striping' => $no_striping,
    ),
    array(
      'data' => array(
        array(
          'data' => $form['getlocations_fields_defaults']['input_phone_width'],
          'class' => array(
            'getlocations_fields_input_cell1',
          ),
        ),
        array(
          'data' => $form['getlocations_fields_defaults']['input_phone_weight'],
          'class' => array(
            'getlocations_fields_input_cell2',
          ),
        ),
        array(
          'data' => $form['getlocations_fields_defaults']['input_phone_required'],
          'class' => array(
            'getlocations_fields_input_cell3',
          ),
        ),
      ),
      'no_striping' => $no_striping,
    ),
    array(
      'data' => array(
        array(
          'data' => $form['getlocations_fields_defaults']['input_mobile_width'],
          'class' => array(
            'getlocations_fields_input_cell1',
          ),
        ),
        array(
          'data' => $form['getlocations_fields_defaults']['input_mobile_weight'],
          'class' => array(
            'getlocations_fields_input_cell2',
          ),
        ),
        array(
          'data' => $form['getlocations_fields_defaults']['input_mobile_required'],
          'class' => array(
            'getlocations_fields_input_cell3',
          ),
        ),
      ),
      'no_striping' => $no_striping,
    ),
    array(
      'data' => array(
        array(
          'data' => $form['getlocations_fields_defaults']['input_fax_width'],
          'class' => array(
            'getlocations_fields_input_cell1',
          ),
        ),
        array(
          'data' => $form['getlocations_fields_defaults']['input_fax_weight'],
          'class' => array(
            'getlocations_fields_input_cell2',
          ),
        ),
        array(
          'data' => $form['getlocations_fields_defaults']['input_fax_required'],
          'class' => array(
            'getlocations_fields_input_cell3',
          ),
        ),
      ),
      'no_striping' => $no_striping,
    ),
    array(
      'data' => array(
        array(
          'data' => $form['getlocations_fields_defaults']['input_latitude_width'],
          'class' => array(
            'getlocations_fields_input_cell1',
          ),
        ),
        array(
          'data' => $form['getlocations_fields_defaults']['input_latitude_weight'],
          'class' => array(
            'getlocations_fields_input_cell2',
          ),
        ),
        array(
          'data' => '',
          'class' => array(
            'getlocations_fields_input_cell3',
          ),
        ),
      ),
      'no_striping' => $no_striping,
    ),
    array(
      'data' => array(
        array(
          'data' => $form['getlocations_fields_defaults']['input_longitude_width'],
          'class' => array(
            'getlocations_fields_input_cell1',
          ),
        ),
        array(
          'data' => $form['getlocations_fields_defaults']['input_longitude_weight'],
          'class' => array(
            'getlocations_fields_input_cell2',
          ),
        ),
        array(
          'data' => '',
          'class' => array(
            'getlocations_fields_input_cell3',
          ),
        ),
      ),
      'no_striping' => $no_striping,
    ),
  );
  $attributes = array(
    'class' => array(
      'getlocations_fields_input_table',
    ),
  );
  $table = theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => $attributes,
  ));
  $form['getlocations_fields_defaults']['input_name_width'] = array(
    '#markup' => $table,
  );
  unset($form['getlocations_fields_defaults']['input_name_required']);
  unset($form['getlocations_fields_defaults']['input_name_weight']);
  unset($form['getlocations_fields_defaults']['input_street_width']);
  unset($form['getlocations_fields_defaults']['input_street_required']);
  unset($form['getlocations_fields_defaults']['input_street_weight']);
  unset($form['getlocations_fields_defaults']['input_additional_width']);
  unset($form['getlocations_fields_defaults']['input_additional_required']);
  unset($form['getlocations_fields_defaults']['input_additional_weight']);
  unset($form['getlocations_fields_defaults']['input_city_width']);
  unset($form['getlocations_fields_defaults']['input_city_required']);
  unset($form['getlocations_fields_defaults']['input_city_weight']);
  unset($form['getlocations_fields_defaults']['input_province_width']);
  unset($form['getlocations_fields_defaults']['input_province_required']);
  unset($form['getlocations_fields_defaults']['input_province_weight']);
  unset($form['getlocations_fields_defaults']['input_postal_code_width']);
  unset($form['getlocations_fields_defaults']['input_postal_code_required']);
  unset($form['getlocations_fields_defaults']['input_postal_code_weight']);
  unset($form['getlocations_fields_defaults']['input_country_width']);
  unset($form['getlocations_fields_defaults']['input_country_required']);
  unset($form['getlocations_fields_defaults']['input_country_weight']);
  unset($form['getlocations_fields_defaults']['input_latitude_width']);
  unset($form['getlocations_fields_defaults']['input_latitude_weight']);
  unset($form['getlocations_fields_defaults']['input_longitude_width']);
  unset($form['getlocations_fields_defaults']['input_longitude_weight']);
  unset($form['getlocations_fields_defaults']['input_phone_width']);
  unset($form['getlocations_fields_defaults']['input_phone_required']);
  unset($form['getlocations_fields_defaults']['input_phone_weight']);
  unset($form['getlocations_fields_defaults']['input_mobile_width']);
  unset($form['getlocations_fields_defaults']['input_mobile_required']);
  unset($form['getlocations_fields_defaults']['input_mobile_weight']);
  unset($form['getlocations_fields_defaults']['input_fax_width']);
  unset($form['getlocations_fields_defaults']['input_fax_required']);
  unset($form['getlocations_fields_defaults']['input_fax_weight']);
  $prefix = '<fieldset class="collapsible form-wrapper">';
  $prefix .= '<legend><span class="fieldset-legend">' . t('Default Input form settings') . '</span></legend>';
  $prefix .= '<div class="fieldset-wrapper">';
  $prefix .= '<div class="fieldset-description">' . t('Configure the default input form.') . '</div>';
  $form['getlocations_fields_defaults']['use_address']['#prefix'] = $prefix;
  $form['getlocations_fields_defaults']['use_country_dropdown']['#suffix'] = '</div></fieldset>';
  $prefix = '<fieldset class="collapsible form-wrapper">';
  $prefix .= '<legend><span class="fieldset-legend">' . t('Default Address display settings') . '</span></legend>';
  $prefix .= '<div class="fieldset-wrapper">';
  $prefix .= '<div class="fieldset-description">' . t('Configure the default address display.') . '</div>';
  $form['getlocations_fields_defaults']['display_showmap']['#prefix'] = $prefix;
  $form['getlocations_fields_defaults']['display_fax']['#suffix'] = '</div></fieldset>';
  $output .= drupal_render_children($form);
  return $output;
}