You are here

function views_plugin_display_feed::attach_to in Views (for Drupal 7) 6.2

Same name and namespace in other branches
  1. 6.3 plugins/views_plugin_display_feed.inc \views_plugin_display_feed::attach_to()
  2. 7.3 plugins/views_plugin_display_feed.inc \views_plugin_display_feed::attach_to()

Attach to another view.

Overrides views_plugin_display::attach_to

File

plugins/views_plugin_display_feed.inc, line 181
Contains the feed display plugin.

Class

views_plugin_display_feed
The plugin that handles a feed, such as RSS or atom.

Code

function attach_to($display_id) {
  $displays = $this
    ->get_option('displays');
  if (empty($displays[$display_id])) {
    return;
  }

  // Defer to the feed style; it may put in meta information, and/or
  // attach a feed icon.
  $plugin = $this
    ->get_plugin();
  if ($plugin) {
    $clone = $this->view
      ->clone_view();
    $clone
      ->set_display($this->display->id);
    $clone
      ->build_title();
    $plugin
      ->attach_to($display_id, $this
      ->get_path(), $clone
      ->get_title());

    // Clean up
    $clone
      ->destroy();
    unset($clone);
  }
}