user_picture.inc

Go to the documentation of this file.
00001 <?php
00002 // $Id: user_picture.inc,v 1.1.2.3 2008/05/27 20:21:11 sdboyer Exp $
00003 
00004 
00005 /**
00006  * Callback function to supply a list of content types.
00007  */
00008 function panels_user_picture_panels_content_types() {
00009   $items['user_picture'] = array(
00010     'title' => t('User picture'),
00011     'content_types' => 'panels_admin_content_types_user_picture',
00012     'single' => TRUE,
00013     'render callback' => 'panels_content_user_picture',
00014     'title callback' => 'panels_admin_title_user_picture',
00015   );
00016   return $items;
00017 }
00018 
00019 /**
00020  * Output function for the 'node' content type. Outputs a node
00021  * based on the module and delta supplied in the configuration.
00022  */
00023 function panels_content_user_picture($conf, $panel_args, $context) {
00024   $account = isset($context->data) ? drupal_clone($context->data) : NULL;
00025   $block = new stdClass();
00026   $block->module = 'term-list';
00027 
00028   if ($account === FALSE || ($account->access == 0 && !user_access('administer users'))) {
00029     return drupal_not_found();
00030   }
00031 
00032   $block->title = check_plain($account->name);
00033   $block->content = theme('user_picture', $account);
00034 
00035   return $block;
00036 }
00037 
00038 /**
00039  * Return all content types available.
00040  */
00041 function panels_admin_content_types_user_picture() {
00042   return array(
00043     'description' => array(
00044       'title' => t('User picture'),
00045       'icon' => 'icon_user.png',
00046       'path' => panels_get_path('content_types/user'),
00047       'description' => t('The picture of a user.'),
00048       'required context' => new panels_required_context(t('User'), 'user'),
00049       'category' => array(t('User context'), -9),
00050     ),
00051   );
00052 }
00053 
00054 /**
00055  * Display the administrative title for a panel pane in the drag & drop UI
00056  */
00057 function panels_admin_title_user_picture($conf, $context) {
00058   return t('"@s" user picture', array('@s' => $context->identifier));
00059 }
00060 

Generated on Sun Feb 5 05:00:12 2012 for Panels 2 by  doxygen 1.5.6