Projet

Général

Profil

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

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

1
<?php
2

    
3
/**
4
 * @file
5
 * Publishing options form for the node. This contains the basic settings
6
 * like published, moderated, node revision, etc.
7
 */
8

    
9
/**
10
 * Plugins are described by creating a $plugin array which will be used
11
 * by the system that includes this file.
12
 */
13
$plugin = array(
14
  'single' => TRUE,
15
  'title' => t('Node form publishing options'),
16
  'icon' => 'icon_node_form.png',
17
  'description' => t('Publishing options on the Node form.'),
18
  'required context' => new ctools_context_required(t('Form'), 'node_form'),
19
  'category' => t('Form'),
20
);
21

    
22
function ctools_node_form_publishing_content_type_render($subtype, $conf, $panel_args, &$context) {
23
  $block = new stdClass();
24

    
25
  $block->title = t('Publishing options');
26
  $block->module = 'node_form';
27
  $block->delta = 'publishing-options';
28

    
29
  if (isset($context->form)) {
30
    if (isset($context->form['options'])) {
31
      $block->content['options'] = $context->form['options'];
32
      unset($block->content['options']['#pre_render']);
33
      unset($block->content['options']['#theme_wrappers']);
34
      $block->content['options']['#type'] = '';
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['options']['#access'] = FALSE;
39
    }
40
  }
41
  else {
42
    $block->content = t('Publishing options.');
43
  }
44
  return $block;
45
}
46

    
47
function ctools_node_form_publishing_content_type_admin_title($subtype, $conf, $context) {
48
  return t('"@s" node form publishing options', array('@s' => $context->identifier));
49
}
50

    
51
function ctools_node_form_publishing_content_type_edit_form($form, &$form_state) {
52
  // Provide a blank form so we have a place to have context setting.
53
  return $form;
54
}