Projet

Général

Profil

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

root / drupal7 / sites / all / modules / ctools / plugins / content_types / node_form / node_form_log.inc @ c2ac6d1d

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
  'single' => TRUE,
11
  'icon' => 'icon_node_form.png',
12
  'title' => t('Node form revision log message'),
13
  'description' => t('Revision log message for the node.'),
14
  'required context' => new ctools_context_required(t('Form'), 'node_form'),
15
  'category' => t('Form'),
16
);
17

    
18
function ctools_node_form_log_content_type_render($subtype, $conf, $panel_args, &$context) {
19
  $block = new stdClass();
20
  $block->module = 'node_form';
21
  $block->title = t('Revision information');
22

    
23
  if (isset($context->form)) {
24
    if (isset($context->form['revision_information'])) {
25
      $block->content['revision_information'] = $context->form['revision_information'];
26
      unset($block->content['revision_information']['#pre_render']);
27
      unset($block->content['revision_information']['#theme_wrappers']);
28
      $block->content['revision_information']['#type'] = '';
29

    
30
      // Set access to false on the original rather than removing so that
31
      // vertical tabs doesn't clone it. I think this is due to references.
32
      $context->form['revision_information']['#access'] = FALSE;
33
    }
34
  }
35
  else {
36
    $block->content = t('Revision information.');
37
  }
38

    
39
  return $block;
40
}
41

    
42
function ctools_node_form_log_content_type_admin_title($subtype, $conf, $context) {
43
  return t('"@s" node form revision log', array('@s' => $context->identifier));
44
}
45

    
46
function ctools_node_form_log_content_type_edit_form($form, &$form_state) {
47
  // Provide a blank form so we have a place to have context setting.
48
  return $form;
49
}