You are here

views_xml_backend_handler_field_markup.inc in Views XML Backend 7

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

Contains views_xml_backend_handler_field_markup.

File

handlers/views_xml_backend_handler_field_markup.inc
View source
<?php

/**
 * @file
 * Contains views_xml_backend_handler_field_markup.
 */

/**
 * HTML field handler for views_xml_backend.
 */
class views_xml_backend_handler_field_markup extends views_xml_backend_handler_field {
  public function option_definition() {
    $options = parent::option_definition();
    $options['format'] = array(
      'default' => '',
    );
    return $options;
  }
  public function options_form(&$form, &$form_state) {
    parent::options_form($form, $form_state);
    global $user;
    foreach (filter_formats($user) as $id => $format) {
      $options[$id] = $format->name;
    }
    $form['format'] = array(
      '#title' => t('Format'),
      '#description' => t('The filter format'),
      '#type' => 'select',
      '#default_value' => $this->options['format'],
      '#required' => TRUE,
      '#options' => $options,
    );
  }
  public function render_field($value) {
    if ($value) {
      $value = str_replace('<!--break-->', '', $value);
      return check_markup($value, $this->options['format'], '');
    }
  }
  public 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 HTML field handler for views_xml_backend.