Mercurial > hg > isophonics-drupal-site
diff core/modules/history/history.views.inc @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children | 129ea1e6d783 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/history/history.views.inc Wed Nov 29 16:09:58 2017 +0000 @@ -0,0 +1,45 @@ +<?php + +/** + * @file + * Provide views data for history.module. + */ + +/** + * Implements hook_views_data(). + */ +function history_views_data() { + // History table + + // We're actually defining a specific instance of the table, so let's + // alias it so that we can later add the real table for other purposes if we + // need it. + $data['history']['table']['group'] = t('Content'); + + // Explain how this table joins to others. + $data['history']['table']['join'] = [ + // Directly links to node table. + 'node_field_data' => [ + 'table' => 'history', + 'left_field' => 'nid', + 'field' => 'nid', + 'extra' => [ + ['field' => 'uid', 'value' => '***CURRENT_USER***', 'numeric' => TRUE], + ], + ], + ]; + + $data['history']['timestamp'] = [ + 'title' => t('Has new content'), + 'field' => [ + 'id' => 'history_user_timestamp', + 'help' => t('Show a marker if the content is new or updated.'), + ], + 'filter' => [ + 'help' => t('Show only content that is new or updated.'), + 'id' => 'history_user_timestamp', + ], + ]; + + return $data; +}