You are here

function tagadelic_plugin_style::options_form in Views Tagadelic 7.2

Same name and namespace in other branches
  1. 7 includes/tagadelic_plugin_style.inc \tagadelic_plugin_style::options_form()

Render the given style.

Overrides views_plugin_style_list::options_form

File

includes/tagadelic_plugin_style.inc, line 110
Contains the tagadelic style plugin.

Class

tagadelic_plugin_style
Style plugin to render a weighted set of taxonomy terms.

Code

function options_form(&$form, &$form_state) {
  $handlers = $this->display->handler
    ->get_handlers('field');
  if (empty($handlers)) {
    $form['error_markup'] = array(
      '#markup' => '<div class="error messages">' . t('You need at least one field before you can configure your tagadelic settings') . '</div>',
    );
    return;
  }

  // Create an array of allowed columns from the data we know:
  $columns = $this
    ->sanitize_columns($this->options['columns']);
  $field_names = $this->display->handler
    ->get_field_labels();
  foreach ($columns as $column_name => $column_label) {
    $columns[$column_name] = $field_names[$column_name];
  }
  $form['count_field'] = array(
    '#type' => 'select',
    '#title' => t('Count field'),
    '#default_value' => $this->options['count_field'],
    '#options' => $columns,
    '#description' => t('The field used to count the results for a row.'),
  );

  // standard settings for list style
  parent::options_form($form, $form_state);
}