Projet

Général

Profil

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

root / drupal7 / sites / all / modules / ctools / plugins / content_types / node_form / node_form_title.inc @ 1e39edcb

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 title field'),
11
  'description' => t('The node title form.'),
12
  'required context' => new ctools_context_required(t('Form'), 'node_form'),
13
  'category' => t('Form'),
14
);
15

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

    
20
  $block->delta = 'title-options';
21

    
22
  if (isset($context->form)) {
23
    if (!empty($context->form['title'])) {
24
      $block->content['title'] = $context->form['title'];
25
      unset($context->form['title']);
26
    }
27
  }
28
  else {
29
    $block->content = t('Node title form.');
30
  }
31
  return $block;
32
}
33

    
34
function ctools_node_form_title_content_type_admin_title($subtype, $conf, $context) {
35
  return t('"@s" node form title field', array('@s' => $context->identifier));
36
}
37

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