Projet

Général

Profil

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

root / drupal7 / sites / all / modules / ctools / plugins / content_types / node_form / node_form_buttons.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 submit buttons'),
13
  'description' => t('Submit buttons for 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_buttons_content_type_render($subtype, $conf, $panel_args, &$context) {
19
  $block = new stdClass();
20
  $block->module = 'node_form';
21

    
22
  $block->title = '';
23
  $block->delta = 'buttons';
24

    
25
  if (isset($context->form)) {
26
    $block->content = array();
27
    foreach (array('actions', 'form_token', 'form_build_id', 'form_id') as $element) {
28
      $block->content[$element] = isset($context->form[$element]) ? $context->form[$element] : NULL;
29
      unset($context->form[$element]);
30
    }
31
  }
32
  else {
33
    $block->content = t('Node form buttons.');
34
  }
35
  return $block;
36
}
37

    
38
function ctools_node_form_buttons_content_type_admin_title($subtype, $conf, $context) {
39
  return t('"@s" node form submit buttons', array('@s' => $context->identifier));
40
}
41

    
42
function ctools_node_form_buttons_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
}