You are here

function shariff_field_widget_form in Shariff Social Media Buttons 7

Implements hook_field_widget_form().

File

./shariff.module, line 570
Integrating Shariff library, providing settings form and block.

Code

function shariff_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {
  $value = isset($items[$delta]['value']) ? $items[$delta]['value'] : 1;
  $widget = $element;
  $widget['#delta'] = $delta;
  unset($widget['#title']);
  $widget += array(
    '#type' => 'checkbox',
    '#title' => t('Display Shariff sharing buttons'),
    '#default_value' => $value,
  );
  $element['value'] = $widget;
  return $element;
}