You are here

function finder_ui_field_list in Finder 7.2

Finder UI field list.

Parameters

$finder: The finder object.

$feid: The element machine name.

Return value

The output.

2 calls to finder_ui_field_list()
finder_ui_element_list in modules/finder_ui/includes/element.inc
Finder UI element list.
finder_ui_field_page in modules/finder_ui/includes/field.inc
Finder UI field page.

File

modules/finder_ui/includes/field.inc, line 223

Code

function finder_ui_field_list($finder, $feid) {
  $element =& $finder->elements[$feid];
  $fields = array();
  if ($finder
    ->esetting($element, 'fields')) {
    foreach ($finder
      ->esetting($element, 'fields') as $field) {
      $field_key = $field->table . '.' . $field->field;
      $field_name = '<em>' . t('Missing field') . '</em>';
      foreach ($finder
        ->fields() as $group => $group_fields) {
        if (isset($group_fields[$field_key])) {
          $field_name = $group . ': ' . $group_fields[$field_key];
          break;
        }
      }
      $fields[] = finder_ui_modal_link($field_name, 'admin/structure/finder/list/' . $finder->name . '/field/' . $element->id . '/' . $field_key . '/nojs', t('Edit'), 'ctools-modal-finder-modal-style');
    }
    $output = array(
      '#theme' => 'item_list',
      '#items' => $fields,
    );
  }
  else {
    $output['no_fields'] = array(
      '#prefix' => '<div class="messages error">',
      '#markup' => t('There are no fields configured.'),
      '#suffix' => '</div>',
    );
  }
  return $output;
}