function views_plugin_display::get_field_labels

3.x views_plugin_display.inc views_plugin_display::get_field_labels()
2.x views_plugin_display.inc views_plugin_display::get_field_labels()

Retrieve a list of fields for the current display with the relationship associated if it exists.

File

plugins/views_plugin_display.inc, line 596
Contains the base display plugin.

Class

views_plugin_display
The default display plugin handler. Display plugins handle options and basic mechanisms for different output methods.

Code

function get_field_labels() {
  $options = array();
  foreach ($this->get_handlers('relationship') as $relationship => $handler) {
    if ($label = $handler->label()) {
      $relationships[$relationship] = $label;
    }
    else {
      $relationships[$relationship] = $handler->ui_name();
    }
  }

  foreach ($this->get_handlers('field') as $id => $handler) {
    if ($label = $handler->label()) {
      $options[$id] = $label;
    }
    else {
      $options[$id] = $handler->ui_name();
    }
    if (!empty($handler->options['relationship']) && !empty($relationships[$handler->options['relationship']])) {
      $options[$id] = '(' . $relationships[$handler->options['relationship']] . ') ' . $options[$id];
    }
  }
  return $options;
}