You are here

function content_profile_preprocess_content_profile_display_view in Content Profile 6

Implementation of content_profile_preprocess_HOOK()

File

./content_profile.theme.inc, line 36
Theme and template preprocessing code

Code

function content_profile_preprocess_content_profile_display_view(&$variables) {
  $element = $variables['element'];
  $node = content_profile_load($element['#content_type'], $element['#uid']);
  $variables['node'] =& $node;
  $variables['uid'] = $element['#uid'];
  $variables['type'] = $element['#content_type'];
  $path = drupal_get_path('module', 'content_profile') . '/content_profile.css';
  drupal_add_css($path, 'module', 'all', FALSE);
  $variables['title'] = check_plain(node_get_types('name', $node->type));
  $tabs = array();
  if ($element['#edit_link']) {
    $tabs[] = theme('content_profile_display_tab_view', $node);
    $tabs[] = theme('content_profile_display_tab_edit', $node);
  }
  if (count($tabs) > 0) {
    $variables['tabs'] = $tabs;
  }
  $variables['content'] = node_view($node, $element['#style'] == 'teaser', TRUE, TRUE);
}