public function views_handler_field_history_user_timestamp::init in Views (for Drupal 7) 7.3
Same name and namespace in other branches
- 6.3 modules/node/views_handler_field_history_user_timestamp.inc \views_handler_field_history_user_timestamp::init()
- 6.2 modules/node/views_handler_field_history_user_timestamp.inc \views_handler_field_history_user_timestamp::init()
Init the handler with necessary data.
Parameters
view $view: The $view object this handler is attached to.
array $options: The item from the database; the actual contents of this will vary based upon the type of handler.
Overrides views_handler_field_node::init
File
- modules/
node/ views_handler_field_history_user_timestamp.inc, line 21 - Definition of views_handler_field_history_user_timestamp.
Class
- views_handler_field_history_user_timestamp
- Field handler to display the marker for new content.
Code
public function init(&$view, &$options) {
parent::init($view, $options);
global $user;
if ($user->uid) {
$this->additional_fields['created'] = array(
'table' => 'node',
'field' => 'created',
);
$this->additional_fields['changed'] = array(
'table' => 'node',
'field' => 'changed',
);
if (module_exists('comment') && !empty($this->options['comments'])) {
$this->additional_fields['last_comment'] = array(
'table' => 'node_comment_statistics',
'field' => 'last_comment_timestamp',
);
}
}
}