You are here

views_xml_backend_handler_field_markup.inc in Views XML Backend 6

Same filename and directory in other branches
  1. 7 handlers/views_xml_backend_handler_field_markup.inc

HTML field handler for views_xml_backend.

File

handlers/views_xml_backend_handler_field_markup.inc
View source
<?php

/**
 * @file
 * HTML field handler for views_xml_backend.
 */
class views_xml_backend_handler_field_markup extends views_xml_backend_handler_field {
  function option_definition() {
    $options = parent::option_definition();
    $options['format'] = array(
      'default' => '',
    );
    return $options;
  }
  function options_form(&$form, &$form_state) {
    parent::options_form($form, $form_state);
    foreach (filter_formats() as $id => $format) {
      $options[$id] = $format->name;
    }
    $form['xml']['format'] = array(
      '#title' => t('Format'),
      '#description' => t('The filter format'),
      '#type' => 'select',
      '#default_value' => $this->options['format'],
      '#required' => TRUE,
      '#options' => $options,
      '#parents' => array(
        'options',
        'format',
      ),
    );
  }
  function render_field($value) {
    if ($value) {
      $value = str_replace('<!--break-->', '', $value);
      return check_markup($value, $this->options['format'], FALSE);
    }
  }
  function element_type($none_supported = FALSE, $default_empty = FALSE, $inline = FALSE) {
    if ($inline) {
      return 'span';
    }
    if (isset($this->definition['element type'])) {
      return $this->definition['element type'];
    }
    return 'div';
  }

}

Classes

Namesort descending Description
views_xml_backend_handler_field_markup @file HTML field handler for views_xml_backend.