Révision c304a780
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/ctools/plugins/content_types/user_context/user_picture.inc | ||
---|---|---|
1 | 1 |
<?php |
2 | 2 |
|
3 | 3 |
/** |
4 |
* @file |
|
4 | 5 |
* Plugins are described by creating a $plugin array which will be used |
5 | 6 |
* by the system that includes this file. |
6 | 7 |
*/ |
8 |
|
|
7 | 9 |
$plugin = array( |
8 | 10 |
'single' => TRUE, |
9 | 11 |
'title' => t('User picture'), |
... | ... | |
22 | 24 |
|
23 | 25 |
$account = clone $context->data; |
24 | 26 |
|
25 |
// Check if user has permissions to access the user |
|
27 |
// Check if user has permissions to access the user.
|
|
26 | 28 |
if ($user->uid != $account->uid && (!user_access('access user profiles') && !user_access('administer users'))) { |
27 | 29 |
return; |
28 | 30 |
} |
... | ... | |
36 | 38 |
'#account' => $account, |
37 | 39 |
); |
38 | 40 |
|
39 |
|
|
40 | 41 |
$block->content = $element; |
41 | 42 |
return $block; |
42 | 43 |
} |
43 | 44 |
|
44 | 45 |
/** |
45 |
* Display the administrative title for a panel pane in the drag & drop UI |
|
46 |
* Display the administrative title for a panel pane in the drag & drop UI.
|
|
46 | 47 |
*/ |
47 | 48 |
function ctools_user_picture_content_type_admin_title($subtype, $conf, $context) { |
48 | 49 |
return t('"@s" user picture', array('@s' => $context->identifier)); |
49 | 50 |
} |
50 | 51 |
|
51 | 52 |
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.
|
|
53 |
// Provide a blank form so we have a place to have context setting.
|
|
53 | 54 |
return $form; |
54 | 55 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules