You are here

public function ContentLockViewsHandlerFieldLocked::render in Content locking (anti-concurrent editing) 7.2

Same name and namespace in other branches
  1. 7.3 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 'yes-no':
    default:
      return $value ? t('Yes') : t('No');
  }
}