4 * Plugins are described by creating a $plugin array which will be used
5 * by the system that includes this file.
9 'title' => t('User picture'),
10 'icon' => 'icon_user.png',
11 'description' => t('The picture of a user.'),
12 'required context' => new ctools_context_required(t('User'), 'user'),
13 'category' => t('User'),
16 function ctools_user_picture_content_type_render($subtype, $conf, $panel_args, $context) {
19 if (empty($context->data)) {
23 $account = clone $context->data;
25 // Check if user has permissions to access the user
26 if ($user->uid != $account->uid && (!user_access('access user profiles') && !user_access('administer users'))) {
30 $block = new stdClass();
31 $block->module = 'user-profile';
32 $block->title = check_plain($account->name);
34 $element['user_picture'] = array(
35 '#theme' => 'user_picture',
36 '#account' => $account,
40 $block->content = $element;
45 * Display the administrative title for a panel pane in the drag & drop UI
47 function ctools_user_picture_content_type_admin_title($subtype, $conf, $context) {
48 return t('"@s" user picture', array('@s' => $context->identifier));
51 function ctools_user_picture_content_type_edit_form($form, &$form_state) {
52 // provide a blank form so we have a place to have context setting.