You are here

function sexybookmarks_entity_view in Share Buttons, Related Posts, Content Analytics - Shareaholic 7.2

Same name and namespace in other branches
  1. 7 includes/field_ui.inc \sexybookmarks_entity_view()

Implements hook_entity_view().

File

includes/field_ui.inc, line 108
Field UI module integration.

Code

function sexybookmarks_entity_view($entity, $type, $view_mode, $langcode) {
  ctools_include('export');
  $profile = ctools_export_crud_load('sexybookmarks_profiles', variable_get("{$type}_sexybookmarks_profile_{$entity->content['#bundle']}", 'default'));
  if (!empty($profile)) {
    $entity->content['sexybookmarks'] = array(
      '#markup' => theme('sexybookmarks', array(
        'url' => isset($entity->uri['path']) ? url($entity->uri['path'], array(
          'absolute' => TRUE,
        )) : '',
        'title' => isset($entity->title) ? $entity->title : '',
        'profile' => $profile->name,
      )),
      '#weight' => 100,
    );
  }
}