user.inc

Go to the documentation of this file.
00001 <?php
00002 // $Id: user.inc,v 1.1.2.7 2008/05/27 20:21:13 sdboyer Exp $
00003 
00004 
00005 /**
00006  * @file contexts/user.inc
00007  *
00008  * Plugin to provide a user context
00009  */
00010 
00011 function panels_user_panels_contexts() {
00012   $args['user'] = array(
00013     'title' => t("User"),
00014     'description' => t('A single user object.'),
00015     'context' => 'panels_context_create_user',
00016     'settings form' => 'panels_context_user_settings_form',
00017     'settings form validate' => 'panels_context_user_settings_form_validate',
00018     'keyword' => 'user',
00019     'no ui' => TRUE,
00020     'context name' => 'user',
00021   );
00022   return $args;
00023 }
00024 
00025 /**
00026  * It's important to remember that $conf is optional here, because contexts
00027  * are not always created from the UI.
00028  */
00029 function panels_context_create_user($empty, $data = NULL, $conf = FALSE) {
00030   $context = new panels_context('user');
00031   $context->plugin = 'user';
00032 
00033   if ($empty) {
00034     return $context;
00035   }
00036 
00037   if ($conf) {
00038     $data = user_load(array('uid' => $data['uid']));
00039   }
00040 
00041   if (!empty($data)) {
00042     $context->data     = $data;
00043     $context->title    = $data->name;
00044     $context->argument = $data->uid;
00045     return $context;
00046   }
00047 }
00048 
00049 function panels_context_user_settings_form($conf, $external = FALSE) {
00050   $form = array();
00051   return $form;
00052 }
00053 

Generated on Thu Jul 29 05:00:14 2010 for Panels 2 by  doxygen 1.5.6