Commit 66c70de8 authored by Matthias Hutterer's avatar Matthias Hutterer
Browse files

changes to hook_field_formatter

parent f4a3652b
<?php
// $Id$
/**
* Implementation of hook_help().
......@@ -55,8 +56,16 @@ function email_field($op, &$node, $field, &$node_field, $teaser, $page) {
*/
function email_field_formatter_info() {
return array(
'email' => array(
'label' => 'Email',
'default' => array(
'label' => 'Default Email-Link',
'field types' => array('email'),
),
'invisi' => array(
'label' => 'Email-Invisimail',
'field types' => array('email'),
),
'contact' => array(
'label' => 'Email-Contact Form',
'field types' => array('email'),
),
);
......@@ -67,10 +76,11 @@ function email_field_formatter($field, $item, $formatter, $node) {
return '';
}
else {
if ($field['widget']['link_type'] == 'form') {
if ($field['widget']['link_type'] == 'form' || $formatter == 'contact') {
$mailto = l(t('Email Contact Form'), 'email/'.$node->nid.'/'.$field['field_name']);
}
elseif ($field['widget']['link_type'] == 'mailto_encrypt' && module_exist('invisimail')) {
elseif (($field['widget']['link_type'] == 'mailto_encrypt' || $formatter == 'invisi') && module_exist('invisimail') ||
(module_exist('invisimail') && isset($formatter) && $formatter = "email-invisi")) {
$format = $GLOBALS['invisimail_format'];
if (!(variable_get('invisimail_link_'.$format, TRUE))) {
variable_set('invisimail_link_'.$format, TRUE);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment