You are here

class realname_handler_argument_user_uid in Real Name 6

Argument handler for realnames

Hierarchy

Expanded class hierarchy of realname_handler_argument_user_uid

2 string references to 'realname_handler_argument_user_uid'
realname_views_data in ./realname.views.inc
realname_views_data_alter in ./realname.views.inc
@file Realname VIEW declarations.

File

./realname_handler_argument_user_uid.inc, line 12
The RealName module allows the admin to choose fields from the user profile that will be used to add a "realname" element (method) to a user object.

View source
class realname_handler_argument_user_uid extends views_handler_argument_user_uid {

  /**
   * Override the behavior of title(). Get the realname of the user.
   */
  function title_query() {
    if (!$this->argument) {
      return array(
        variable_get('anonymous', t('Anonymous')),
      );
    }
    $titles = array();
    $placeholders = implode(', ', array_fill(0, sizeof($this->value), '%d'));
    $result = db_query("SELECT r.realname FROM {users} u LEFT JOIN {realname} r ON u.uid=r.uid WHERE u.uid IN ({$placeholders})", $this->value);
    while ($term = db_fetch_object($result)) {
      $titles[] = check_plain($term->realname);
    }
    return $titles;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
realname_handler_argument_user_uid::title_query function Override the behavior of title(). Get the realname of the user.