You are here

function jstimer_field_formatter_settings_form in Javascript Timer 7

Implements hook_field_formatter_settings_form().

File

./jstimer.field.inc, line 29
Field hooks to implement a jstimer field.

Code

function jstimer_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
  $display = $instance['display'][$view_mode];
  $formatter = $display['type'];
  $widgets = jstimer_get_widgets();
  $widget_found = '';
  foreach ($widgets as $widget) {
    if ($widget->name == $formatter) {
      $widget_found = $widget;
    }
  }
  if (!empty($widget_found)) {
    if (isset($widget->settings)) {
      $form_callback = $widget->name . '_formatter_settings_form';
      return $form_callback($field, $instance, $view_mode, $form, $form_state);
    }
  }
}