1
|
<?php
|
2
|
/**
|
3
|
* @file
|
4
|
* This file provides a preprocess function on behalf of the Contact module.
|
5
|
*/
|
6
|
|
7
|
/**
|
8
|
* Implements hook_preprocess_author_pane().
|
9
|
*
|
10
|
* @see _contact_personal_tab_acces()
|
11
|
*/
|
12
|
function contact_preprocess_author_pane(&$variables) {
|
13
|
// Check if this preprocess needs to be run given who's calling it.
|
14
|
if (!author_pane_run_preprocess('contact', $variables['caller'])) {
|
15
|
return;
|
16
|
}
|
17
|
|
18
|
if (_contact_personal_tab_access($variables['account'])) {
|
19
|
$options = array(
|
20
|
'attributes' => array(
|
21
|
'class' => array('author-pane-link'),
|
22
|
'title' => t('Send @accountname an email.', array('@accountname' => $variables['account']->name)),
|
23
|
),
|
24
|
'html' => TRUE,
|
25
|
);
|
26
|
$variables['contact'] = l('<span>' . t('Send Email') . '</span>', 'user/' . $variables['account']->uid . '/contact', $options);
|
27
|
}
|
28
|
}
|
29
|
|
30
|
/**
|
31
|
* Implements hook_author_pane_allow_preprocess_disable().
|
32
|
*/
|
33
|
function contact_author_pane_allow_preprocess_disable() {
|
34
|
return array('contact' => 'Contact');
|
35
|
}
|