You are here

function panelizer_handler_panelizer_status::render in Panelizer 7.2

Same name and namespace in other branches
  1. 7.3 plugins/views/panelizer_handler_panelizer_status.inc \panelizer_handler_panelizer_status::render()

Render the field.

Parameters

array $values: The values retrieved from the database.

Overrides views_handler_field::render

File

plugins/views/panelizer_handler_panelizer_status.inc, line 30

Class

panelizer_handler_panelizer_status
Views field handler for rendering node links that point to panelizer tabs.

Code

function render($values) {
  if ($entity = $this
    ->get_value($values)) {
    if (!empty($entity->panelizer->name)) {
      $panelizer = ctools_export_crud_load('panelizer_defaults', $entity->panelizer->name);
      $status = !empty($panelizer->title) ? check_plain($panelizer->title) : t('Default');
    }
    else {
      if (!empty($entity->panelizer->did)) {
        $status = $this->options['custom'];
      }
      else {
        $status = $this->options['not_panelized'];
      }
    }
    return $status;
  }
}