You are here

function xmlsitemap_views_data in XML sitemap 7.2

Same name and namespace in other branches
  1. 8 xmlsitemap.views.inc \xmlsitemap_views_data()
  2. 2.x xmlsitemap.views.inc \xmlsitemap_views_data()

Implements hook_views_data().

Uses the xmlsitemap functions to load information about entity types that are configured for xmlsitemap. Creates separate table aliases so that views can display, filter and sort each entity type.

File

./xmlsitemap.views.inc, line 15
Provides information about the data being made available for views.

Code

function xmlsitemap_views_data() {
  $data = array();
  $link_info = xmlsitemap_get_link_info();
  foreach ($link_info as $info) {
    if (!empty($info['fieldable']) && $info['fieldable']) {
      $table_alias = 'xmlsitemap_' . $info['base table'];
      $data[$table_alias]['table'] = _xmlsitemap_table_data($info);
      $field_data = _xmlsitemap_field_data();
      foreach ($field_data as $field_name => $field) {
        $data[$table_alias][$field_name] = $field;
      }
    }
  }
  return $data;
}