You are here

public function views_plugin_display_feed::attach_to in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 plugins/views_plugin_display_feed.inc \views_plugin_display_feed::attach_to()
  2. 6.2 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 232
Definition of views_plugin_display_feed.

Class

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

Code

public 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);
  }
}