You are here

function _sms_sendtophone_filter_inline_settings in SMS Framework 7

Same name and namespace in other branches
  1. 5 modules/sms_sendtophone/sms_sendtophone.module \_sms_sendtophone_filter_inline_settings()
  2. 6.2 modules/sms_sendtophone/sms_sendtophone.module \_sms_sendtophone_filter_inline_settings()
  3. 6 modules/sms_sendtophone/sms_sendtophone.module \_sms_sendtophone_filter_inline_settings()

Filter callback: SMS filter settings form constructor.

See also

sms_sendtophone_filter_info()

1 string reference to '_sms_sendtophone_filter_inline_settings'
sms_sendtophone_filter_info in modules/sms_sendtophone/sms_sendtophone.module
Implements hook_filter_info().

File

modules/sms_sendtophone/sms_sendtophone.module, line 118
Provides various tools for sending bits of information via SMS.

Code

function _sms_sendtophone_filter_inline_settings($form, &$form_state, $filter, $format, $defaults, $filters) {
  $filter->settings += $defaults;
  $elements = array();
  $elements["sms_sendtophone_filter_inline_display"] = array(
    '#type' => 'radios',
    '#title' => t('Show link as'),
    '#description' => t('How to display the the "send to phone" link.'),
    '#options' => array(
      'text' => t('Text'),
      'icon' => t('Icon'),
    ),
    '#default_value' => !empty($filter->settings['sms_sendtophone_filter_inline_display']) ? $filter->settings['sms_sendtophone_filter_inline_display'] : 'icon',
  );
  $elements["sms_sendtophone_filter_inline_display_text"] = array(
    '#type' => 'textfield',
    '#title' => t('Text for link'),
    '#description' => t('If "Text" is selected above, the following text will be appended as a link.'),
    '#size' => 32,
    '#maxlength' => 32,
    '#default_value' => !empty($filter->settings['sms_sendtophone_filter_inline_display_text']) ? $filter->settings['sms_sendtophone_filter_inline_display_text'] : t('Send to phone'),
  );
  $elements["sms_sendtophone_filter_inline_default_icon"] = array(
    '#type' => 'checkbox',
    '#title' => t('Use default icon'),
    '#description' => t('If "Icon" is selected above and this option is enabled, the default icon that came with the module will be used.'),
    '#default_value' => !empty($filter->settings['sms_sendtophone_filter_inline_default_icon']) ? $filter->settings['sms_sendtophone_filter_inline_default_icon'] : 1,
  );
  $elements["sms_sendtophone_filter_inline_custom_icon_path"] = array(
    '#type' => 'textfield',
    '#title' => t('Path to custom icon'),
    '#description' => t('Provide a path to a custom icon. This icon will be used if "Icon" is selected above and the "Use default icon" option is disabled.'),
    '#size' => 40,
    '#maxlength' => 255,
    '#default_value' => !empty($filter->settings['sms_sendtophone_filter_inline_custom_icon_path']) ? $filter->settings['sms_sendtophone_filter_inline_custom_icon_path'] : '',
    '#field_prefix' => url(NULL, array(
      'absolute' => TRUE,
    )),
  );
  return $elements;
}