public function ContentLockViewsHandlerFieldLocked::render in Content locking (anti-concurrent editing) 7.3
Same name and namespace in other branches
- 7.2 views/ContentLockViewsHandlerFieldLocked.inc \ContentLockViewsHandlerFieldLocked::render()
Render.
Overrides views_handler_field_boolean::render
File
- views/
ContentLockViewsHandlerFieldLocked.inc, line 31 - Handler to identify if node is locked or not.
Class
- ContentLockViewsHandlerFieldLocked
- Class ContentLockViewsHandlerFieldLocked.
Code
public function render($values) {
$value = $values->content_lock_timestamp ? TRUE : FALSE;
if (!empty($this->options['not'])) {
$value = !$value;
}
switch ($this->options['type']) {
case 'true-false':
return $value ? t('True') : t('False');
case 'on-off':
return $value ? t('On') : t('Off');
case 'custom':
return $value ? $this->options['type_custom_true'] : $this->options['type_custom_false'];
case 'yes-no':
default:
return $value ? t('Yes') : t('No');
}
}