You are here

function markup_view_field_settings in Markup 6

Implements hook_field_settings().

File

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

Code

function markup_view_field_settings($op, $field) {
  switch ($op) {
    case 'form':
      $potential_views = markup_view_get_list_of_views();
      $form = array();
      $form['instructions'] = array(
        '#type' => 'markup',
        '#value' => t('This is a special field. It will render the content of the view below on the node/edit form for this content type.'),
        '#weight' => -1,
      );
      $form['view'] = array(
        '#type' => 'select',
        '#title' => t('View'),
        '#description' => t('Choose a view to display on the node insert/edit form.'),
        '#options' => $potential_views,
        '#default_value' => isset($field['view']) ? $field['view'] : '',
      );
      $form['view_args'] = array(
        '#type' => 'textfield',
        '#title' => t('Arguments'),
        '#default_value' => isset($field['view_args']) ? $field['view_args'] : '',
        '#required' => FALSE,
        '#description' => t('Provide a comma separated list of arguments to pass to the view. If an argument contains commas or double quotes, enclose it in double quotes. Replace double quotes that are part of the argument with pairs of double quotes.'),
      );
      return $form;
    case 'validate':
      break;
    case 'save':
      return array(
        'view',
        'view_args',
      );
    case 'database columns':
      return array();
  }
}