views_handler_field_filter_format_name.inc

Same filename in other branches
  1. 6.x-3.x modules/filter/views_handler_field_filter_format_name.inc

Contains .

File

modules/filter/views_handler_field_filter_format_name.inc

View source
<?php


/**
 * @file
 * Contains .
 */

/**
 * Field handler to output the name of an input format.
 *
 * @ingroup views_field_handlers
 */
class views_handler_field_filter_format_name extends views_handler_field {
    
    /**
     * {@inheritdoc}
     */
    public function construct() {
        parent::construct();
        // Be explicit about the table we are using.
        $this->additional_fields['name'] = array(
            'table' => 'filter_formats',
            'field' => 'name',
        );
    }
    
    /**
     * {@inheritdoc}
     */
    public function query() {
        $this->ensure_my_table();
        $this->add_additional_fields();
    }
    
    /**
     * {@inheritdoc}
     */
    public function render($values) {
        $format_name = $this->get_value($values, 'name');
        if (!$format_name) {
            // Default or invalid input format.
            // filter_formats() will reliably return the default format even if the
            // current user is unprivileged.
            $format = filter_formats(filter_default_format());
            return $this->sanitize_value($format->name);
        }
        return $this->sanitize_value($format_name);
    }

}

Classes

Title Deprecated Summary
views_handler_field_filter_format_name Field handler to output the name of an input format.