Removing translation directories
[project/views.git] / modules / user / views_handler_field_user_mail.inc
CommitLineData
fe44beb7 1<?php
fe44beb7
EM
2/**
3 * Field handler to provide acess control for the email field
4 */
5class views_handler_field_user_mail extends views_handler_field_user {
6 function option_definition() {
7 $options = parent::option_definition();
8 $options['link_to_user'] = array('default' => 'mailto');
9 return $options;
10 }
11
12 function options_form(&$form, &$form_state) {
13 parent::options_form($form, $form_state);
14 $form['link_to_user'] = array(
15 '#title' => t('Link this field'),
16 '#type' => 'radios',
17 '#options' => array(
18 0 => t('No link'),
19 'user' => t('To the user'),
20 'mailto' => t("With a mailto:"),
21 ),
22 '#default_value' => $this->options['link_to_user'],
23 );
24 }
25
26 function render($values) {
27 if ($this->options['link_to_user'] == 'mailto') {
28 return l($values->{$this->field_alias}, "mailto:" . $values->{$this->field_alias});
29 }
30 return $this->render_link(check_plain($values->{$this->field_alias}), $values);
31 }
32}