1 |
85ad3d82
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* Plugins are described by creating a $plugin array which will be used
|
5 |
|
|
* by the system that includes this file.
|
6 |
|
|
*/
|
7 |
|
|
$plugin = array(
|
8 |
|
|
'title' => t('User signature'),
|
9 |
|
|
'icon' => 'icon_user.png',
|
10 |
|
|
'description' => t('The signature of a user.'),
|
11 |
|
|
'required context' => new ctools_context_required(t('User'), 'user'),
|
12 |
|
|
'category' => t('User'),
|
13 |
|
|
);
|
14 |
|
|
|
15 |
|
|
function ctools_user_signature_content_type_render($subtype, $conf, $panel_args, $context) {
|
16 |
|
|
$account = isset($context->data) ? clone($context->data) : NULL;
|
17 |
|
|
$block = new stdClass();
|
18 |
|
|
$block->module = 'user-signature';
|
19 |
|
|
|
20 |
|
|
if ($account === FALSE || ($account->access == 0 && !user_access('administer users'))) {
|
21 |
|
|
return;
|
22 |
|
|
}
|
23 |
|
|
|
24 |
|
|
$element['user_signature'] = array(
|
25 |
|
|
'#theme' => 'user_signature',
|
26 |
|
|
'#signature' => check_markup($account->signature, $account->signature_format),
|
27 |
|
|
);
|
28 |
|
|
|
29 |
|
|
$block->content = $element;
|
30 |
|
|
return $block;
|
31 |
|
|
}
|
32 |
|
|
|
33 |
|
|
/**
|
34 |
|
|
* Display the administrative title for a panel pane in the drag & drop UI
|
35 |
|
|
*/
|
36 |
|
|
function ctools_user_signature_content_type_admin_title($subtype, $conf, $context) {
|
37 |
|
|
return t('"@s" user signature', array('@s' => $context->identifier));
|
38 |
|
|
}
|
39 |
|
|
|
40 |
|
|
function ctools_user_signature_content_type_edit_form($form, &$form_state) {
|
41 |
|
|
// provide a blank form so we have a place to have context setting.
|
42 |
|
|
return $form;
|
43 |
|
|
} |