You are here

public function deploy_views_handler_related_plans_field::render in Deploy - Content Staging 7.3

Render the field.

Parameters

array $values: The values retrieved from the database.

Overrides deploy_views_handler_base::render

File

includes/views/handler_related_plans_field.inc, line 16
Deploy Views Related Plans field handler.

Class

deploy_views_handler_related_plans_field
Class for handling the Deploy Manager Related Plans "field",

Code

public function render($values) {
  $plans = [];
  $matched_plans = deploy_find_entity($values->entity_type, $values->entity_id, $values->plan_name);
  if ($matched_plans) {
    foreach ($matched_plans as $name => $rev) {
      $link_label = t('@title [rev:@rev_id]', [
        '@title' => $name,
        '@rev_id' => $rev,
      ]);
      $plans[] = l($link_label, 'admin/structure/deploy/plans/list/' . $name);
    }
    return theme('item_list', [
      'items' => $plans,
    ]);
  }
  return '';
}