Projet

Général

Profil

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

root / drupal7 / sites / all / modules / ds / modules / ds_ui / includes / ds.classes.inc @ 3dfa8105

1
<?php
2

    
3
/**
4
 * @file
5
 * Administrative functions for managing CSS classes.
6
 */
7

    
8
/**
9
 * Menu callback, show CSS classes form.
10
 */
11
function ds_classes_form($form, $form_state) {
12
  $form = array();
13

    
14
  $form['ds_classes_regions'] = array(
15
    '#type' => 'textarea',
16
    '#title' => t('CSS classes for regions'),
17
    '#default_value' => variable_get('ds_classes_regions', ''),
18
    '#description' => t('Configure CSS classes which you can add to regions on the "manage display" screens. Add multiple CSS classes line by line.<br />If you want to have a friendly name, separate class and friendly name by |, but this is not required. eg:<br /><em>class_name_1<br />class_name_2|Friendly name<br />class_name_3</em>')
19
  );
20

    
21
  if (module_exists('token')) {
22
    $tokens_mapping = token_get_entity_mapping();
23
    $tokens_list = array();
24
    foreach($tokens_mapping as $token_map => $entity_map) {
25
      $tokens_list[] = $token_map;
26
    }
27
    $form['token'] = array(
28
      '#type' => 'container',
29
      '#theme' => 'token_tree',
30
      '#token_types' => $tokens_list,
31
      '#dialog' => TRUE,
32
    );
33
  }
34

    
35
  $form['ds_classes_fields'] = array(
36
    '#type' => 'textarea',
37
    '#title' => t('CSS classes for fields'),
38
    '#default_value' => variable_get('ds_classes_fields', ''),
39
    '#description' => t('Configure CSS classes which you can add to fields on the "manage display" screens. Add multiple CSS classes line by line.<br />If you want to have a friendly name, separate class and friendly name by |, but this is not required. eg:<br /><em>class_name_1<br />class_name_2|Friendly name<br />class_name_3</em>')
40
  );
41

    
42
  return system_settings_form($form);
43
}