[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/views/handlers/ -> views_handler_field_markup.inc (source)

   1  <?php
   2  
   3  /**
   4   * A handler to run a field through check_markup, using a companion
   5   * format field.
   6   *
   7   * - format: (REQUIRED) The field in this table used to control the format
   8   *           such as the 'format' field in the node, which goes with the
   9   *           'body' field.
  10   *
  11   * @ingroup views_field_handlers
  12   */
  13  class views_handler_field_markup extends views_handler_field {
  14    /**
  15     * Constructor; calls to base object constructor.
  16     */
  17    function construct() {
  18      parent::construct();
  19  
  20      $this->format = $this->definition['format'];
  21  
  22      $this->additional_fields = array();
  23      if (!is_numeric($this->format)) {
  24        $this->additional_fields['format'] = array('field' => $this->format);
  25      }
  26    }
  27  
  28    function render($values) {
  29      $value = $values->{$this->field_alias};
  30      $format = is_numeric($this->format) ? $this->format : $values->{$this->aliases['format']};
  31      if ($value) {
  32        $value = str_replace('<!--break-->', '', $value);
  33        return check_markup($value, $format, FALSE);
  34      }
  35    }
  36  
  37    function element_type() {
  38      if (isset($this->definition['element type'])) {
  39        return $this->definition['element type'];
  40      }
  41  
  42      return 'div';
  43    }
  44  }


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7