You are here

function phone_link_field_formatter_settings_form in Phone link 7

Implements hook_field_formatter_settings_form().

File

./phone_link.module, line 23

Code

function phone_link_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $element['title'] = array(
    '#type' => 'textfield',
    '#title' => t('Title tip'),
    '#description' => t('Provide "title" HTML-attribute for phone link. You can use "@phone" replacement (without quotes).'),
    '#default_value' => $settings['title'],
  );
  $element['text'] = array(
    '#type' => 'textfield',
    '#title' => t('Replace phone number'),
    '#description' => t('Text displayed instead of phone. You can use "@phone" replacement (without quotes).'),
    '#default_value' => $settings['text'],
  );
  $element['type'] = array(
    '#type' => 'select',
    '#options' => _phone_link_get_phone_types(),
    '#title' => t('Type of link'),
    '#description' => t('Choose the type of phone link. Default phones: "tel:", or Skype-format "callto:".'),
    '#default_value' => $settings['type'] ?: 'tel',
  );
  return $element;
}