function views_plugin_row_node_view::options_form

3.x views_plugin_row_node_view.inc views_plugin_row_node_view::options_form(&$form, &$form_state)
2.x views_plugin_row_node_view.inc views_plugin_row_node_view::options_form(&$form, &$form_state)

Provide a form for setting options.

Overrides views_plugin_row::options_form

File

modules/node/views_plugin_row_node_view.inc, line 35
Contains the node view row style plugin.

Class

views_plugin_row_node_view
Plugin which performs a node_view on the resulting object.

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);

  // CCK holds the registry of available build modes, but can hardly
  // push them as options for the node row style, so we break the normal
  // rule of not directly relying on non-core modules.
  if ($modes = module_invoke('content', 'build_modes')) {
    $options = array();
    foreach ($modes as $key => $value) {
      if (isset($value['views style']) && $value['views style']) {
        $options[$key] = $value['title'];
      }
    }
  }
  else {
    $options = array(
      'teaser' => t('Teaser'),
      'full' => t('Full node')
    );
  }
  $form['build_mode'] = array(
    '#type' => 'select',
    '#options' => $options,
    '#title' => t('Build mode'),
    '#default_value' => $this->options['build_mode'],
  );
  $form['links'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display links'),
    '#default_value' => $this->options['links'],
  );
  $form['comments'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display node comments'),
    '#default_value' => $this->options['comments'],
  );
}