Projet

Général

Profil

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

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

1 85ad3d82 Assos Assos
<?php
2
3
/**
4 c304a780 Assos Assos
 * @file
5 85ad3d82 Assos Assos
 * Plugins are described by creating a $plugin array which will be used
6
 * by the system that includes this file.
7
 */
8 c304a780 Assos Assos
9 85ad3d82 Assos Assos
$plugin = array(
10
  'single' => TRUE,
11
  'icon' => 'icon_node_form.png',
12
  'title' => t('Node form author information'),
13
  'description' => t('Author information on the Node form.'),
14
  'required context' => new ctools_context_required(t('Form'), 'node_form'),
15
  'category' => t('Form'),
16
);
17
18
function ctools_node_form_author_content_type_render($subtype, $conf, $panel_args, &$context) {
19
  $block = new stdClass();
20 c2ac6d1d Assos Assos
  $block->module = 'node_form';
21 85ad3d82 Assos Assos
22
  $block->title = t('Authoring information');
23
  $block->delta = 'author-options';
24
25
  if (isset($context->form)) {
26
    if (!empty($context->form['author'])) {
27
      $block->content['author'] = $context->form['author'];
28
      if (isset($block->content['author']['#group'])) {
29
        unset($block->content['author']['#pre_render']);
30
        unset($block->content['author']['#theme_wrappers']);
31
        $block->content['author']['#type'] = '';
32
        $block->content['author']['name']['#size'] /= 2;
33
        $block->content['author']['date']['#size'] /= 2;
34
      }
35
36
      // Set access to false on the original rather than removing so that
37
      // vertical tabs doesn't clone it. I think this is due to references.
38
      $context->form['author']['#access'] = FALSE;
39
    }
40
  }
41
  else {
42
    $block->content = t('Authoring information.');
43
  }
44
  return $block;
45
}
46
47
function ctools_node_form_author_content_type_admin_title($subtype, $conf, $context) {
48
  return t('"@s" node form author information', array('@s' => $context->identifier));
49
}
50
51
function ctools_node_form_author_content_type_edit_form($form, &$form_state) {
52 c304a780 Assos Assos
  // Provide a blank form so we have a place to have context setting.
53 85ad3d82 Assos Assos
  return $form;
54
}