diff --git a/core/modules/aggregator/aggregator.views.inc b/core/modules/aggregator/aggregator.views.inc deleted file mode 100644 index 062bea176da..00000000000 --- a/core/modules/aggregator/aggregator.views.inc +++ /dev/null @@ -1,286 +0,0 @@ - 'iid', - 'title' => t('Aggregator item'), - 'help' => t('Aggregator items are imported from external RSS and Atom news feeds.'), - ); - $data['aggregator_item']['table']['entity type'] = 'aggregator_item'; - - $data['aggregator_item']['iid'] = array( - 'title' => t('Item ID'), - 'help' => t('The unique ID of the aggregator item.'), - 'field' => array( - 'id' => 'numeric', - ), - 'argument' => array( - 'id' => 'aggregator_iid', - 'name field' => 'title', - 'numeric' => TRUE, - ), - 'filter' => array( - 'id' => 'numeric', - ), - 'sort' => array( - 'id' => 'standard', - ), - ); - - $data['aggregator_item']['title'] = array( - 'title' => t('Title'), - 'help' => t('The title of the aggregator item.'), - 'field' => array( - 'id' => 'aggregator_title_link', - 'extra' => array('link'), - ), - 'argument' => array( - 'id' => 'string', - ), - 'sort' => array( - 'id' => 'standard', - ), - 'filter' => array( - 'id' => 'string', - ), - ); - - $data['aggregator_item']['link'] = array( - 'title' => t('Link'), - 'help' => t('The link to the original source URL of the item.'), - 'field' => array( - 'id' => 'url', - ), - 'argument' => array( - 'id' => 'string', - ), - 'sort' => array( - 'id' => 'standard', - ), - 'filter' => array( - 'id' => 'string', - ), - ); - - $data['aggregator_item']['author'] = array( - 'title' => t('Author'), - 'help' => t('The author of the original imported item.'), - 'field' => array( - 'id' => 'aggregator_xss', - ), - 'argument' => array( - 'id' => 'string', - ), - 'sort' => array( - 'id' => 'standard', - ), - 'filter' => array( - 'id' => 'string', - ), - ); - - $data['aggregator_item']['guid'] = array( - 'title' => t('GUID'), - 'help' => t('The guid of the original imported item.'), - 'field' => array( - 'id' => 'standard', - ), - 'argument' => array( - 'id' => 'string', - ), - 'sort' => array( - 'id' => 'standard', - ), - 'filter' => array( - 'id' => 'string', - ), - ); - - $data['aggregator_item']['description'] = array( - 'title' => t('Body'), - 'help' => t('The actual content of the imported item.'), - 'field' => array( - 'id' => 'aggregator_xss', - 'click sortable' => FALSE, - ), - 'argument' => array( - 'id' => 'string', - ), - 'filter' => array( - 'id' => 'string', - ), - 'sort' => array( - 'id' => 'standard', - ), - ); - - $data['aggregator_item']['timestamp'] = array( - 'title' => t('Timestamp'), - 'help' => t('The date the original feed item was posted. (With some feeds, this will be the date it was imported.)'), - 'field' => array( - 'id' => 'date', - ), - 'sort' => array( - 'id' => 'date', - ), - 'filter' => array( - 'id' => 'date', - ), - 'argument' => array( - 'id' => 'date', - ), - ); - - $data['aggregator_feed']['table']['group'] = t('Aggregator feed'); - - $data['aggregator_feed']['table']['base'] = array( - 'field' => 'fid', - 'title' => t('Aggregator feed'), - ); - - $data['aggregator_feed']['table']['entity type'] = 'aggregator_feed'; - - $data['aggregator_feed']['table']['join'] = array( - 'aggregator_item' => array( - 'left_field' => 'fid', - 'field' => 'fid', - ), - ); - - $data['aggregator_feed']['fid'] = array( - 'title' => t('Feed ID'), - 'help' => t('The unique ID of the aggregator feed.'), - 'field' => array( - 'id' => 'numeric', - ), - 'argument' => array( - 'id' => 'aggregator_fid', - 'name field' => 'title', - 'numeric' => TRUE, - ), - 'filter' => array( - 'id' => 'numeric', - ), - 'sort' => array( - 'id' => 'standard', - ), - ); - - $data['aggregator_feed']['title'] = array( - 'title' => t('Title'), - 'help' => t('The title of the aggregator feed.'), - 'field' => array( - 'id' => 'aggregator_title_link', - 'extra' => array('link'), - ), - 'sort' => array( - 'id' => 'standard', - ), - 'filter' => array( - 'id' => 'string', - ), - 'argument' => array( - 'id' => 'string', - ), - ); - - $data['aggregator_feed']['url'] = array( - 'title' => t('URL'), - 'help' => t('The fully-qualified URL of the feed.'), - 'field' => array( - 'id' => 'url', - ), - 'argument' => array( - 'id' => 'string', - ), - 'sort' => array( - 'id' => 'standard', - ), - 'filter' => array( - 'id' => 'string', - ), - ); - - $data['aggregator_feed']['link'] = array( - 'title' => t('Link'), - 'help' => t('The link to the source URL of the feed.'), - 'field' => array( - 'id' => 'url', - ), - 'argument' => array( - 'id' => 'string', - ), - 'sort' => array( - 'id' => 'standard', - ), - 'filter' => array( - 'id' => 'string', - ), - ); - - $data['aggregator_feed']['checked'] = array( - 'title' => t('Last checked'), - 'help' => t('The date the feed was last checked for new content.'), - 'field' => array( - 'id' => 'date', - ), - 'sort' => array( - 'id' => 'date', - ), - 'filter' => array( - 'id' => 'date', - ), - 'argument' => array( - 'id' => 'date', - ), - ); - - $data['aggregator_feed']['description'] = array( - 'title' => t('Description'), - 'help' => t('The description of the aggregator feed.'), - 'field' => array( - 'id' => 'xss', - 'click sortable' => FALSE, - ), - 'filter' => array( - 'id' => 'string', - ), - 'argument' => array( - 'id' => 'string', - ), - 'sort' => array( - 'id' => 'standard', - ), - ); - - $data['aggregator_feed']['modified'] = array( - 'title' => t('Last modified'), - 'help' => t('The date of the most recent new content on the feed.'), - 'field' => array( - 'id' => 'date', - ), - 'sort' => array( - 'id' => 'date', - ), - 'filter' => array( - 'id' => 'date', - ), - 'argument' => array( - 'id' => 'date', - ), - ); - - return $data; -} diff --git a/core/modules/aggregator/src/AggregatorFeedViewsData.php b/core/modules/aggregator/src/AggregatorFeedViewsData.php new file mode 100644 index 00000000000..cc962263e4d --- /dev/null +++ b/core/modules/aggregator/src/AggregatorFeedViewsData.php @@ -0,0 +1,166 @@ + 'fid', + 'title' => t('Aggregator feed'), + ); + + $data['aggregator_feed']['table']['entity type'] = 'aggregator_feed'; + + $data['aggregator_feed']['table']['join'] = array( + 'aggregator_item' => array( + 'left_field' => 'fid', + 'field' => 'fid', + ), + ); + + $data['aggregator_feed']['fid'] = array( + 'title' => t('Feed ID'), + 'help' => t('The unique ID of the aggregator feed.'), + 'field' => array( + 'id' => 'numeric', + ), + 'argument' => array( + 'id' => 'aggregator_fid', + 'name field' => 'title', + 'numeric' => TRUE, + ), + 'filter' => array( + 'id' => 'numeric', + ), + 'sort' => array( + 'id' => 'standard', + ), + ); + + $data['aggregator_feed']['title'] = array( + 'title' => t('Title'), + 'help' => t('The title of the aggregator feed.'), + 'field' => array( + 'id' => 'aggregator_title_link', + 'extra' => array('link'), + ), + 'sort' => array( + 'id' => 'standard', + ), + 'filter' => array( + 'id' => 'string', + ), + 'argument' => array( + 'id' => 'string', + ), + ); + + $data['aggregator_feed']['url'] = array( + 'title' => t('URL'), + 'help' => t('The fully-qualified URL of the feed.'), + 'field' => array( + 'id' => 'url', + ), + 'argument' => array( + 'id' => 'string', + ), + 'sort' => array( + 'id' => 'standard', + ), + 'filter' => array( + 'id' => 'string', + ), + ); + + $data['aggregator_feed']['link'] = array( + 'title' => t('Link'), + 'help' => t('The link to the source URL of the feed.'), + 'field' => array( + 'id' => 'url', + ), + 'argument' => array( + 'id' => 'string', + ), + 'sort' => array( + 'id' => 'standard', + ), + 'filter' => array( + 'id' => 'string', + ), + ); + + $data['aggregator_feed']['checked'] = array( + 'title' => t('Last checked'), + 'help' => t('The date the feed was last checked for new content.'), + 'field' => array( + 'id' => 'date', + ), + 'sort' => array( + 'id' => 'date', + ), + 'filter' => array( + 'id' => 'date', + ), + 'argument' => array( + 'id' => 'date', + ), + ); + + $data['aggregator_feed']['description'] = array( + 'title' => t('Description'), + 'help' => t('The description of the aggregator feed.'), + 'field' => array( + 'id' => 'xss', + 'click sortable' => FALSE, + ), + 'filter' => array( + 'id' => 'string', + ), + 'argument' => array( + 'id' => 'string', + ), + 'sort' => array( + 'id' => 'standard', + ), + ); + + $data['aggregator_feed']['modified'] = array( + 'title' => t('Last modified'), + 'help' => t('The date of the most recent new content on the feed.'), + 'field' => array( + 'id' => 'date', + ), + 'sort' => array( + 'id' => 'date', + ), + 'filter' => array( + 'id' => 'date', + ), + 'argument' => array( + 'id' => 'date', + ), + ); + + return $data; + } + +} + diff --git a/core/modules/aggregator/src/AggregatorItemViewsData.php b/core/modules/aggregator/src/AggregatorItemViewsData.php new file mode 100644 index 00000000000..cdaae27d093 --- /dev/null +++ b/core/modules/aggregator/src/AggregatorItemViewsData.php @@ -0,0 +1,159 @@ + 'iid', + 'title' => t('Aggregator item'), + 'help' => t('Aggregator items are imported from external RSS and Atom news feeds.'), + ); + $data['aggregator_item']['table']['entity type'] = 'aggregator_item'; + + $data['aggregator_item']['iid'] = array( + 'title' => t('Item ID'), + 'help' => t('The unique ID of the aggregator item.'), + 'field' => array( + 'id' => 'numeric', + ), + 'argument' => array( + 'id' => 'aggregator_iid', + 'name field' => 'title', + 'numeric' => TRUE, + ), + 'filter' => array( + 'id' => 'numeric', + ), + 'sort' => array( + 'id' => 'standard', + ), + ); + + $data['aggregator_item']['title'] = array( + 'title' => t('Title'), + 'help' => t('The title of the aggregator item.'), + 'field' => array( + 'id' => 'aggregator_title_link', + 'extra' => array('link'), + ), + 'argument' => array( + 'id' => 'string', + ), + 'sort' => array( + 'id' => 'standard', + ), + 'filter' => array( + 'id' => 'string', + ), + ); + + $data['aggregator_item']['link'] = array( + 'title' => t('Link'), + 'help' => t('The link to the original source URL of the item.'), + 'field' => array( + 'id' => 'url', + ), + 'argument' => array( + 'id' => 'string', + ), + 'sort' => array( + 'id' => 'standard', + ), + 'filter' => array( + 'id' => 'string', + ), + ); + + $data['aggregator_item']['author'] = array( + 'title' => t('Author'), + 'help' => t('The author of the original imported item.'), + 'field' => array( + 'id' => 'aggregator_xss', + ), + 'argument' => array( + 'id' => 'string', + ), + 'sort' => array( + 'id' => 'standard', + ), + 'filter' => array( + 'id' => 'string', + ), + ); + + $data['aggregator_item']['guid'] = array( + 'title' => t('GUID'), + 'help' => t('The guid of the original imported item.'), + 'field' => array( + 'id' => 'standard', + ), + 'argument' => array( + 'id' => 'string', + ), + 'sort' => array( + 'id' => 'standard', + ), + 'filter' => array( + 'id' => 'string', + ), + ); + + $data['aggregator_item']['description'] = array( + 'title' => t('Body'), + 'help' => t('The actual content of the imported item.'), + 'field' => array( + 'id' => 'aggregator_xss', + 'click sortable' => FALSE, + ), + 'argument' => array( + 'id' => 'string', + ), + 'filter' => array( + 'id' => 'string', + ), + 'sort' => array( + 'id' => 'standard', + ), + ); + + $data['aggregator_item']['timestamp'] = array( + 'title' => t('Timestamp'), + 'help' => t('The date the original feed item was posted. (With some feeds, this will be the date it was imported.)'), + 'field' => array( + 'id' => 'date', + ), + 'sort' => array( + 'id' => 'date', + ), + 'filter' => array( + 'id' => 'date', + ), + 'argument' => array( + 'id' => 'date', + ), + ); + + return $data; + } + +} + diff --git a/core/modules/aggregator/src/Entity/Feed.php b/core/modules/aggregator/src/Entity/Feed.php index 6362d2d3499..d70ec7d1364 100644 --- a/core/modules/aggregator/src/Entity/Feed.php +++ b/core/modules/aggregator/src/Entity/Feed.php @@ -24,6 +24,7 @@ use Drupal\aggregator\FeedInterface; * "storage" = "Drupal\aggregator\FeedStorage", * "view_builder" = "Drupal\aggregator\FeedViewBuilder", * "access" = "Drupal\aggregator\FeedAccessControlHandler", + * "views_data" = "Drupal\aggregator\AggregatorFeedViewsData", * "form" = { * "default" = "Drupal\aggregator\FeedForm", * "delete" = "Drupal\aggregator\Form\FeedDeleteForm", diff --git a/core/modules/aggregator/src/Entity/Item.php b/core/modules/aggregator/src/Entity/Item.php index 5d6670cbd6c..f41080a50e6 100644 --- a/core/modules/aggregator/src/Entity/Item.php +++ b/core/modules/aggregator/src/Entity/Item.php @@ -25,6 +25,7 @@ use Drupal\Core\Url; * "storage" = "Drupal\aggregator\ItemStorage", * "view_builder" = "Drupal\aggregator\ItemViewBuilder", * "access" = "Drupal\aggregator\FeedAccessControlHandler", + * "views_data" = "Drupal\aggregator\AggregatorItemViewsData" * }, * uri_callback = "Drupal\aggregator\Entity\Item::buildUri", * base_table = "aggregator_item",