You are here

private function GatherContentCurl::fieldSettings in GatherContent 7.2

Generate individual field options.

1 call to GatherContentCurl::fieldSettings()
GatherContentCurl::generateFormSettings in includes/curl.inc
Generate page settings for pages_import page.

File

includes/curl.inc, line 665
Contains functions used to process and retrieve data from GatherContent.

Class

GatherContentCurl
@file Contains functions used to process and retrieve data from GatherContent.

Code

private function fieldSettings($id, $field, $tab = 'content', $tab_label = '', $val = '') {
  if ($field['type'] == 'section') {
    return '';
  }
  $fieldid = $id . '_' . md5($tab . '_' . $field['label']);
  $idcounter = 0;
  while (isset($this->idsUsed[$fieldid])) {
    $fieldid = $fieldid . $idcounter++;
  }
  $this->idsUsed[$fieldid] = TRUE;
  $arr = array(
    '#prefix' => '<div class="gc_settings_field gc_cf" data-field-tab="' . $tab . '" id="field_' . $fieldid . '"><div class="gc_move_field"></div>',
    '#suffix' => '</div>',
    'label' => array(
      '#markup' => '<div class="gc_field_name gc_left"><div class="gc_tab_name gc_tooltip" title="' . t('Tab') . '">' . check_plain($tab_label) . '</div>' . check_plain($field['label']) . '</div>',
    ),
    'map_to' => array(
      '#type' => 'hidden',
      '#prefix' => '<div class="gc_field_map gc_right" id="gc_field_map_' . $fieldid . '"><span>' . t('Map to') . '</span>' . $this
        ->dropdownHtml('<span></span>', $this->data['map_to_select']),
      '#suffix' => '</div>',
      '#parents' => array(
        'map_to',
        $id,
        '',
      ),
      '#default_value' => $val,
    ),
    'field_tab' => array(
      '#type' => 'hidden',
      '#default_value' => $tab,
      '#parents' => array(
        'field_tab',
        $id,
        '',
      ),
    ),
    'field_name' => array(
      '#type' => 'hidden',
      '#default_value' => $field['name'],
      '#parents' => array(
        'field_name',
        $id,
        '',
      ),
    ),
  );
  return $arr;
}