ctools_context_create_user($empty, $data = NULL, $conf = FALSE)It's important to remember that $conf is optional here, because contexts are not always created from the UI.
contributions/ctools/plugins/contexts/user.inc, line 32
<?php
function ctools_context_create_user($empty, $data = NULL, $conf = FALSE) {
$context = new ctools_context('user');
$context->plugin = 'user';
if ($empty) {
return $context;
}
if ($conf) {
if ($data['type'] == 'current') {
global $user;
$data = $user;
}
else {
$data = user_load(array('uid' => $data['uid']));
}
}
if (!empty($data)) {
$context->data = $data;
$context->title = isset($data->name) ? $data->name : t('Anonymous');
$context->argument = $data->uid;
return $context;
}
}
?>