Project

General

Profile

Revision d719f12f

Added by Assos Assos over 8 years ago

Weekly update of contrib modules

View differences:

drupal7/sites/all/modules/views/plugins/views_plugin_style_rss.inc
71 71
    return array();
72 72
  }
73 73

  
74
  /**
75
   * Return an atom:link XHTML element to add to the channel to comply with
76
   * the RSS 2.0 specification.
77
   *
78
   * @see http://validator.w3.org/feed/docs/warning/MissingAtomSelfLink.html
79
   *
80
   * @return
81
   *   An array that can be passed to format_xml_elements().
82
   */
83
  function get_channel_elements_atom_link() {
84
    $url_options = array('absolute' => TRUE);
85
    $input = $this->view->get_exposed_input();
86
    if ($input) {
87
      $url_options['query'] = $input;
88
    }
89
    $url = url($this->view->get_url(), $url_options);
90

  
91
    return array(
92
      array(
93
        'namespace' => array('xmlns:atom' => 'http://www.w3.org/2005/Atom'),
94
        'key' => 'atom:link',
95
        'attributes' => array(
96
          'href' => $url,
97
          'rel' => 'self',
98
          'type' => 'application/rss+xml',
99
        ),
100
      ),
101
    );
102
  }
103

  
74 104
  /**
75 105
   * Get RSS feed description.
76 106
   *
......
99 129

  
100 130
    // Fetch any additional elements for the channel and merge in their
101 131
    // namespaces.
102
    $this->channel_elements = $this->get_channel_elements();
132
    $this->channel_elements = array_merge(
133
      $this->get_channel_elements(),
134
      $this->get_channel_elements_atom_link()
135
    );
103 136
    foreach ($this->channel_elements as $element) {
104 137
      if (isset($element['namespace'])) {
105 138
        $this->namespaces = array_merge($this->namespaces, $element['namespace']);

Also available in: Unified diff