You are here

function skype_field_formatter_settings_form in Skype 7

Implements hook_field_formatter_settings_form().

File

./skype.module, line 111

Code

function skype_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $element = array();
  switch ($display['type']) {
    case 'skype_button':
      $element['actions'] = array(
        '#type' => 'checkboxes',
        '#title' => t('Choose what you\'d like your button to do:'),
        '#options' => array(
          'call' => t('Call'),
          'chat' => t('Chat'),
        ),
        '#default_value' => $settings['actions'],
        '#required' => TRUE,
      );
      $element['image_color'] = array(
        '#type' => 'select',
        '#title' => t('Choose how you want your button to look:'),
        '#options' => array(
          'blue' => t('Blue'),
          'white' => t('White'),
        ),
        '#default_value' => $settings['image_color'],
        '#required' => TRUE,
      );
      $element['image_size'] = array(
        '#type' => 'select',
        '#title' => t('Choose the size of your button:'),
        '#options' => array(
          10 => '10px',
          12 => '12px',
          14 => '14px',
          16 => '16px',
          24 => '24px',
          32 => '32px',
        ),
        '#default_value' => $settings['image_size'],
        '#required' => TRUE,
      );
      break;
    case 'skype_uri':
      $element['action'] = array(
        '#type' => 'radios',
        '#title' => t('Choose what you\'d like your URI to do:'),
        '#options' => array(
          'call' => t('Call'),
          'video' => t('Video chat'),
          'chat' => t('Chat'),
        ),
        '#default_value' => $settings['action'],
        '#required' => TRUE,
      );
      $element['link_text'] = array(
        '#type' => 'textfield',
        '#title' => t('Choose the link text:'),
        '#default_value' => $settings['link_text'],
        '#required' => TRUE,
        '#description' => t('For example: "Call me" or "Video chat with me". You can use [skype:id] as token to use in your link text.'),
      );
      break;
  }
  return $element;
}