You are here

protected function SearchApiElasticsearchConnector::viewSettingElement in Elasticsearch Connector 7

Same name and namespace in other branches
  1. 7.5 modules/elasticsearch_connector_search_api/service.inc \SearchApiElasticsearchConnector::viewSettingElement()
  2. 7.2 modules/elasticsearch_connector_search_api/service.inc \SearchApiElasticsearchConnector::viewSettingElement()

Helper function. Display a setting element.

1 call to SearchApiElasticsearchConnector::viewSettingElement()
SearchApiElasticsearchConnector::viewSettings in modules/elasticsearch_connector_search_api/service.inc
Overrides viewSettings().

File

modules/elasticsearch_connector_search_api/service.inc, line 248
Provides a Elasticsearch-based service class for the Search API using Elasticsearch Connector module.

Class

SearchApiElasticsearchConnector
Search service class.

Code

protected function viewSettingElement($element) {
  $output = '';
  if (is_array($element['option'])) {
    $value = '';
    foreach ($element['option'] as $sub_element) {
      $value .= $this
        ->viewSettingElement($sub_element);
    }
  }
  else {
    $value = $this
      ->getOption($element['option']);
    $value = nl2br(check_plain(print_r($value, TRUE)));
  }
  $output .= '<dt><em>' . check_plain($element['label']) . '</em></dt>' . "\n";
  $output .= '<dd>' . $value . '</dd>' . "\n";
  return "<dl>\n{$output}</dl>";
}