You are here

function lti_tool_provider_consumer_view in LTI Tool Provider 7

View a single consumer entity.

Parameters

object $entity: The consumer to view.

string $view_mode: The requested view mode.

Return value

array The content array from the entity.

1 string reference to 'lti_tool_provider_consumer_view'
lti_tool_provider_menu in ./lti_tool_provider.module
Implements hook_menu().

File

./lti_tool_provider.admin.inc, line 524
Admin forms for LTI Tool Provider module.

Code

function lti_tool_provider_consumer_view($entity, $view_mode = 'tweaky') {
  $entity_type = 'lti_tool_provider_consumer';
  $entity->content = array(
    '#view_mode' => $view_mode,
  );
  field_attach_prepare_view($entity_type, array(
    $entity->lti_tool_provider_consumer_id => $entity,
  ), $view_mode);
  entity_prepare_view($entity_type, array(
    $entity->lti_tool_provider_consumer_id => $entity,
  ));
  $entity->content += field_attach_view($entity_type, $entity, $view_mode);
  $entity->content['lti_tool_provider_consumer_consumer'] = array(
    '#type' => 'item',
    '#title' => t('Consumer'),
    '#markup' => $entity->lti_tool_provider_consumer_consumer,
  );
  $entity->content['lti_tool_provider_consumer_key'] = array(
    '#type' => 'item',
    '#title' => t('Key'),
    '#markup' => $entity->lti_tool_provider_consumer_key,
  );
  $entity->content['lti_tool_provider_consumer_secret'] = array(
    '#type' => 'item',
    '#title' => t('Secret'),
    '#markup' => $entity->lti_tool_provider_consumer_secret,
  );
  $entity->content['lti_tool_provider_consumer_domain'] = array(
    '#type' => 'item',
    '#title' => t('Domain'),
    '#markup' => $entity->lti_tool_provider_consumer_domain,
  );
  $entity->content['lti_tool_provider_consumer_dummy_pref'] = array(
    '#type' => 'item',
    '#title' => t('Activate Dummy Account'),
    '#markup' => lti_tool_provider_trans_bool($entity->lti_tool_provider_consumer_dummy_pref),
  );
  $entity->content['date_joined'] = array(
    '#type' => 'item',
    '#title' => t('Date Joined'),
    '#markup' => format_date($entity->date_joined),
  );
  global $language;
  $langcode = $language->language;
  $entity->content['#language'] = $langcode;
  module_invoke_all('entity_view', $entity, $entity_type, $view_mode, $langcode);
  drupal_alter(array(
    'lti_tool_provider_consumer_view',
    'entity_view',
  ), $entity->content, $entity_type);
  return $entity->content;
}