You are here

revisioning_handler_field_node_last_editor.inc in Revisioning 7

Handler for the 'Node: last edited by' field.

File

views/revisioning_handler_field_node_last_editor.inc
View source
<?php

/**
 * @file
 * Handler for the 'Node: last edited by' field.
 */
class revisioning_handler_field_node_last_editor extends views_handler_field {

  /**
   * Call constructor.
   */
  public function construct() {
    parent::construct();
    $this->additional_fields['nid'] = 'nid';
  }

  /**
   * Check for access.
   */
  public function access() {
    return user_access('access content');
  }

  /**
   * Help build the query.
   */
  public function query() {

    // Not calling parent::query() as it will treat 'last_editor' as a real db
    // field.
    $this
      ->ensure_my_table();
    $this
      ->add_additional_fields();
  }

  /**
   * Render data.
   */
  public function render($values) {
    $nid = $values->{$this->aliases['nid']};
    $uid = revisioning_get_last_editor($nid, FALSE);
    $account = user_load($uid);
    return $account->name;
  }

}

Classes

Namesort descending Description
revisioning_handler_field_node_last_editor @file Handler for the 'Node: last edited by' field.