You are here

public function EmptyFieldText::react in Empty fields 7.2

Implementation of EmptyFieldText::react().

Return value

string A rendered string of html for display.

Overrides EmptyFieldHandler::react

File

plugins/empty_fields_handler_text.inc, line 47
Contains the EmptyFieldText plugin for EmptyFieldHandler.

Class

EmptyFieldText
Defines EmptyFieldText.

Code

public function react($context) {
  global $user;
  $args = array(
    $context['entity_type'] => $context['entity'],
    'user' => $user,
  );
  $text = $this->options['empty_text'];
  if (module_exists('i18n_field')) {
    $text = i18n_string('field:' . $context['field_name'] . ':' . $context['instance']['bundle'] . ':' . 'empty_fields:' . $context['view_mode'] . ':text:empty_text', $text, array(
      'langcode' => $context['language'],
    ));
  }
  $text = token_replace($text, $args, array(
    'clear' => TRUE,
  ));
  return filter_xss_admin($text);
}