Projet

Général

Profil

Paste
Télécharger (1,29 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / ctools / plugins / content_types / user_context / user_signature.inc @ c304a780

1
<?php
2

    
3
/**
4
 * @file
5
 * Plugins are described by creating a $plugin array which will be used
6
 * by the system that includes this file.
7
 */
8

    
9
$plugin = array(
10
  'title' => t('User signature'),
11
  'icon' => 'icon_user.png',
12
  'description' => t('The signature of a user.'),
13
  'required context' => new ctools_context_required(t('User'), 'user'),
14
  'category' => t('User'),
15
);
16

    
17
function ctools_user_signature_content_type_render($subtype, $conf, $panel_args, $context) {
18
  $account = isset($context->data) ? clone $context->data : NULL;
19
  $block = new stdClass();
20
  $block->module = 'user-signature';
21

    
22
  if ($account === FALSE || ($account->access == 0 && !user_access('administer users'))) {
23
    return;
24
  }
25

    
26
  $element['user_signature'] = array(
27
    '#theme' => 'user_signature',
28
    '#signature' => check_markup($account->signature, $account->signature_format),
29
  );
30

    
31
  $block->content = $element;
32
  return $block;
33
}
34

    
35
/**
36
 * Display the administrative title for a panel pane in the drag & drop UI.
37
 */
38
function ctools_user_signature_content_type_admin_title($subtype, $conf, $context) {
39
  return t('"@s" user signature', array('@s' => $context->identifier));
40
}
41

    
42
function ctools_user_signature_content_type_edit_form($form, &$form_state) {
43
  // Provide a blank form so we have a place to have context setting.
44
  return $form;
45
}