You are here

function markup_view_widget_settings in Markup 6

Implements hook_widget_settings().

File

contrib/markup_view/markup_view.module, line 76
Defines a field type for displaying a view on the node/edit form.

Code

function markup_view_widget_settings($op, $widget) {
  switch ($op) {
    case 'form':
      $form = array();
      $form['display_style'] = array(
        '#type' => 'radios',
        '#title' => t('Display Style'),
        '#default_value' => !empty($widget['display_style']) ? $widget['display_style'] : '',
        '#options' => array(
          'none' => t('Hide Field Wrapper & Label'),
          'wrapper' => t('Display Field Wrapper & Hide Label'),
          'all' => t('Display Field Wrapper & Label'),
        ),
        '#required' => TRUE,
        '#description' => t('Choose how the markup_view field should be displayed on the node form.') . '<br />' . htmlentities(t('A field wrapper consists of a <div class="form-item"></div> wrapper around the markup_view to follow form standards.')),
      );
      $form['use_view_title'] = array(
        '#type' => 'checkbox',
        '#title' => t('Use View Title as Label'),
        '#default_value' => isset($widget['use_view_title']) ? $widget['use_view_title'] : '',
        '#description' => t('Replace the field label with the title provided by the view.'),
      );
      return $form;
    case 'save':
      return array(
        'display_style',
        'use_view_title',
      );
  }
}