示例#1
0
 /**
  * Provide a form for setting options.
  */
 public function buildOptionsForm(&$form, &$form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $options = $this->displayHandler->getFieldLabels();
     if (empty($this->options['inline'])) {
         $this->options['inline'] = array();
     }
     $form['default_field_elements'] = array('#type' => 'checkbox', '#title' => t('Provide default field wrapper elements'), '#default_value' => $this->options['default_field_elements'], '#description' => t('If not checked, fields that are not configured to customize their HTML elements will get no wrappers at all for their field, label and field + label wrappers. You can use this to quickly reduce the amount of markup the view provides by default, at the cost of making it more difficult to apply CSS.'));
     $form['inline'] = array('#type' => 'checkboxes', '#title' => t('Inline fields'), '#options' => $options, '#default_value' => $this->options['inline'], '#description' => t('Inline fields will be displayed next to each other rather than one after another. Note that some fields will ignore this if they are block elements, particularly body fields and other formatted HTML.'), '#states' => array('visible' => array(':input[name="row_options[default_field_elements]"]' => array('checked' => TRUE))));
     $form['separator'] = array('#title' => t('Separator'), '#type' => 'textfield', '#size' => 10, '#default_value' => isset($this->options['separator']) ? $this->options['separator'] : '', '#description' => t('The separator may be placed between inline fields to keep them from squishing up next to each other. You can use HTML in this field.'), '#states' => array('visible' => array(':input[name="row_options[default_field_elements]"]' => array('checked' => TRUE))));
     $form['hide_empty'] = array('#type' => 'checkbox', '#title' => t('Hide empty fields'), '#default_value' => $this->options['hide_empty'], '#description' => t('Do not display fields, labels or markup for fields that are empty.'));
 }
示例#2
0
 public function buildOptionsForm(&$form, &$form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $initial_labels = array('' => t('- None -'));
     $view_fields_labels = $this->displayHandler->getFieldLabels();
     $view_fields_labels = array_merge($initial_labels, $view_fields_labels);
     $form['title_field'] = array('#type' => 'select', '#title' => t('Title field'), '#description' => t('The field that is going to be used as the RSS item title for each row.'), '#options' => $view_fields_labels, '#default_value' => $this->options['title_field'], '#required' => TRUE);
     $form['link_field'] = array('#type' => 'select', '#title' => t('Link field'), '#description' => t('The field that is going to be used as the RSS item link for each row. This must be a drupal relative path.'), '#options' => $view_fields_labels, '#default_value' => $this->options['link_field'], '#required' => TRUE);
     $form['description_field'] = array('#type' => 'select', '#title' => t('Description field'), '#description' => t('The field that is going to be used as the RSS item description for each row.'), '#options' => $view_fields_labels, '#default_value' => $this->options['description_field'], '#required' => TRUE);
     $form['creator_field'] = array('#type' => 'select', '#title' => t('Creator field'), '#description' => t('The field that is going to be used as the RSS item creator for each row.'), '#options' => $view_fields_labels, '#default_value' => $this->options['creator_field'], '#required' => TRUE);
     $form['date_field'] = array('#type' => 'select', '#title' => t('Publication date field'), '#description' => t('The field that is going to be used as the RSS item pubDate for each row. It needs to be in RFC 2822 format.'), '#options' => $view_fields_labels, '#default_value' => $this->options['date_field'], '#required' => TRUE);
     $form['guid_field_options'] = array('#type' => 'details', '#title' => t('GUID settings'), '#open' => TRUE);
     $form['guid_field_options']['guid_field'] = array('#type' => 'select', '#title' => t('GUID field'), '#description' => t('The globally unique identifier of the RSS item.'), '#options' => $view_fields_labels, '#default_value' => $this->options['guid_field_options']['guid_field'], '#required' => TRUE);
     $form['guid_field_options']['guid_field_is_permalink'] = array('#type' => 'checkbox', '#title' => t('GUID is permalink'), '#description' => t('The RSS item GUID is a permalink.'), '#default_value' => $this->options['guid_field_options']['guid_field_is_permalink']);
 }
示例#3
0
 /**
  * {@inheritdoc}
  */
 public function buildOptionsForm(&$form, &$form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $initial_labels = array('' => $this->t('- None -'));
     $view_fields_labels = $this->displayHandler->getFieldLabels();
     $view_fields_labels = array_merge($initial_labels, $view_fields_labels);
     $types = array('rss' => $this->t('RSS'), 'link' => $this->t('Link'), 'include' => $this->t('Include'));
     $types = array_merge($initial_labels, $types);
     $form['type_field'] = array('#type' => 'select', '#title' => $this->t('Type attribute'), '#description' => $this->t('The type of this row.'), '#options' => $types, '#default_value' => $this->options['type_field']);
     $form['text_field'] = array('#type' => 'select', '#title' => $this->t('Text attribute'), '#description' => $this->t('The field that is going to be used as the OPML text attribute for each row.'), '#options' => $view_fields_labels, '#default_value' => $this->options['text_field'], '#required' => TRUE);
     $form['created_field'] = array('#type' => 'select', '#title' => $this->t('Created attribute'), '#description' => $this->t('The field that is going to be used as the OPML created attribute for each row.'), '#options' => $view_fields_labels, '#default_value' => $this->options['created_field']);
     $form['description_field'] = array('#type' => 'select', '#title' => $this->t('Description attribute'), '#description' => $this->t('The field that is going to be used as the OPML description attribute for each row.'), '#options' => $view_fields_labels, '#default_value' => $this->options['description_field'], '#states' => array('visible' => array(':input[name="row_options[type_field]"]' => array('value' => 'rss'))));
     $form['html_url_field'] = array('#type' => 'select', '#title' => $this->t('HTML URL attribute'), '#description' => $this->t('The field that is going to be used as the OPML htmlUrl attribute for each row.'), '#options' => $view_fields_labels, '#default_value' => $this->options['html_url_field'], '#states' => array('visible' => array(':input[name="row_options[type_field]"]' => array('value' => 'rss'))));
     $form['language_field'] = array('#type' => 'select', '#title' => $this->t('Language attribute'), '#description' => $this->t('The field that is going to be used as the OPML language attribute for each row.'), '#options' => $view_fields_labels, '#default_value' => $this->options['language_field'], '#states' => array('visible' => array(':input[name="row_options[type_field]"]' => array('value' => 'rss'))));
     $form['xml_url_field'] = array('#type' => 'select', '#title' => $this->t('XML URL attribute'), '#description' => $this->t('The field that is going to be used as the OPML text attribute for each row.'), '#options' => $view_fields_labels, '#default_value' => $this->options['xml_url_field'], '#states' => array('visible' => array(':input[name="row_options[type_field]"]' => array('value' => 'rss'))));
     $form['url_field'] = array('#type' => 'select', '#title' => $this->t('URL attribute'), '#description' => $this->t('The field that is going to be used as the OPML url attribute for each row.'), '#options' => $view_fields_labels, '#default_value' => $this->options['url_field'], '#states' => array('visible' => array(':input[name="row_options[type_field]"]' => array(array('value' => 'link'), array('value' => 'include')))));
 }