You are here

function panels_uid_context in Panels 5.2

Same name and namespace in other branches
  1. 6.2 arguments/uid.inc \panels_uid_context()

Discover if this argument gives us the user we crave.

1 string reference to 'panels_uid_context'
panels_uid_panels_arguments in arguments/uid.inc
@file arguments/uid.inc

File

arguments/uid.inc, line 27
arguments/uid.inc

Code

function panels_uid_context($arg = NULL, $conf = NULL, $empty = FALSE) {

  // If unset it wants a generic, unfilled context.
  if ($empty) {
    return panels_context_create_empty('user');
  }
  if (!is_numeric($arg)) {
    return FALSE;
  }
  $user = user_load(array(
    'uid' => $arg,
  ));
  if (!$user) {
    return FALSE;
  }
  return panels_context_create('user', $user);
}