Projet

Général

Profil

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

root / drupal7 / sites / all / modules / ctools / plugins / content_types / node_form / node_form_language.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 languages'),
13
  'description' => t('The language selection form.'),
14
  'required context' => new ctools_context_required(t('Form'), 'node_form'),
15
  'category' => t('Form'),
16
);
17

    
18
function ctools_node_form_language_content_type_render($subtype, $conf, $panel_args, &$context) {
19
  $block = new stdClass();
20
  $block->module = 'node_form';
21

    
22
  $block->delta = 'language-options';
23

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

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

    
40
function ctools_node_form_language_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
}