public function EntityLabelEmptyFieldHandler::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_label.inc, line 51 - Contains the EntityLabelEmptyFieldHandler plugin for Empty Fields module.
Class
- EntityLabelEmptyFieldHandler
- Defines EntityLabelEmptyFieldHandler.
Code
public function react($context) {
$title = entity_label($context['entity_type'], $context['entity']);
switch ($this->options['display']) {
case 'link':
if ($url = entity_uri($context['entity_type'], $context['entity'])) {
return l($title, $url['path'], $url['options']);
}
// Fall through.
case 'text':
default:
return check_plain($title);
}
}