You are here

public function BeanPlugin::view in Bean (for Drupal 7) 7

Return the block content.

Parameters

$bean: The bean object being viewed.

$content: The default content array created by Entity API. This will include any fields attached to the entity.

$view_mode: The view mode passed into $entity->view().

Return value

Return a renderable content array.

Overrides BeanTypePluginInterface::view

File

plugins/BeanPlugin.class.php, line 103
Base Plugin Class

Class

BeanPlugin
@file Base Plugin Class

Code

public function view($bean, $content, $view_mode = 'default', $langcode = NULL) {
  if (!empty($content) && module_exists('contextual')) {
    $content['bean'][$bean
      ->Identifier()]['#contextual_links']['bean'] = array(
      'block',
      array(
        $bean
          ->Identifier(),
        'edit',
      ),
    );
  }
  return $content;
}