public function SearchApiAbstractService::viewSettings in Search API 7
Implements SearchApiServiceInterface::__construct().
The default implementation does a crude output as a definition list, with option names taken from the configuration form.
Overrides SearchApiServiceInterface::viewSettings
File
- includes/
service.inc, line 353 - Contains SearchApiServiceInterface and SearchApiAbstractService.
Class
- SearchApiAbstractService
- Abstract class with generic implementation of most service methods.
Code
public function viewSettings() {
$output = '';
$form = $form_state = array();
$option_form = $this
->configurationForm($form, $form_state);
$option_names = array();
foreach ($option_form as $key => $element) {
if (isset($element['#title']) && isset($this->options[$key])) {
$option_names[$key] = $element['#title'];
}
}
foreach ($option_names as $key => $name) {
$value = $this->options[$key];
$output .= '<dt>' . check_plain($name) . '</dt>' . "\n";
$output .= '<dd>' . nl2br(check_plain(print_r($value, TRUE))) . '</dd>' . "\n";
}
return $output ? "<dl>\n{$output}</dl>" : '';
}