Projet

Général

Profil

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

root / drupal7 / sites / all / modules / ctools / plugins / content_types / node_form / node_form_buttons.inc @ 651307cd

1
<?php
2

    
3
/**
4
 * Plugins are described by creating a $plugin array which will be used
5
 * by the system that includes this file.
6
 */
7
$plugin = array(
8
  'single' => TRUE,
9
  'icon' => 'icon_node_form.png',
10
  'title' => t('Node form submit buttons'),
11
  'description' => t('Submit buttons for the node form.'),
12
  'required context' => new ctools_context_required(t('Form'), 'node_form'),
13
  'category' => t('Form'),
14
);
15

    
16
function ctools_node_form_buttons_content_type_render($subtype, $conf, $panel_args, &$context) {
17
  $block = new stdClass();
18
  $block->module = t('node_form');
19

    
20
  $block->title = '';
21
  $block->delta = 'buttons';
22

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

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

    
40
function ctools_node_form_buttons_content_type_edit_form($form, &$form_state) {
41
  // provide a blank form so we have a place to have context setting.
42
  return $form;
43
}