You are here

function contact_preprocess_author_pane in Author Pane 6

Same name and namespace in other branches
  1. 5 modules/contact.author-pane.inc \contact_preprocess_author_pane()
  2. 6.2 modules/contact.author-pane.inc \contact_preprocess_author_pane()
  3. 7.2 modules/contact.author-pane.inc \contact_preprocess_author_pane()

Implementation of hook_preprocess_author_pane().

File

modules/contact.author-pane.inc, line 11
This file provides a preprocess function on behalf of the contact module.

Code

function contact_preprocess_author_pane(&$variables) {
  global $user;
  $account = $variables['account'];
  $account_id = $account->uid;
  $image_path = $variables['image_path'];
  if ($account->contact && $account_id != $user->uid && $user->uid != 0) {
    $variables['contact'] = l(theme('image', "{$image_path}/contact.png", t('Contact user'), t('Contact user'), NULL, TRUE), "user/{$account_id}/contact", array(
      'html' => TRUE,
    ));
    $variables['contact_link'] = l(t('Contact user'), "user/{$account_id}/contact");
  }
}