You are here

class footnotes_views_handler_field_body_footnotes in Footnotes 6.2

Same name and namespace in other branches
  1. 7.3 footnotes_views_handler_field_body_footnotes.inc \footnotes_views_handler_field_body_footnotes
  2. 7.2 footnotes_views_handler_field_body_footnotes.inc \footnotes_views_handler_field_body_footnotes

@file Views handler for the body footnotes.

Hierarchy

Expanded class hierarchy of footnotes_views_handler_field_body_footnotes

1 string reference to 'footnotes_views_handler_field_body_footnotes'
footnotes_views_views_data in ./footnotes_views.views.inc
Implementation of hook_views_data().

File

./footnotes_views_handler_field_body_footnotes.inc, line 8
Views handler for the body footnotes.

View source
class footnotes_views_handler_field_body_footnotes extends footnotes_views_handler_field {
  function init(&$view, $options) {
    parent::init($view, $options);
  }
  function render_name($data, $values) {
    $start = strpos($data, '<ul class="footnotes">');

    // By default footnotes are at the end, but they could be anywhere really.
    // $end   = strpos($data, '</ul><!-- end footnotes -->')+strlen('</ul><!-- end footnotes -->');
    if ($start !== FALSE) {

      // $data = substr($data, $start, $end);
      $data = substr($data, $start);
    }
    else {

      // There are no footnotes.
      $data = '';
    }
    return $data;
  }
  function render($values) {
    $body = parent::render($values);
    return $this
      ->render_link($this
      ->render_name($body, $values), $values);
  }

}

Members