You are here

compact_forms.admin.inc in Compact Forms 5

Same filename and directory in other branches
  1. 6 compact_forms.admin.inc
  2. 7 compact_forms.admin.inc

Compact Forms administration functions.

File

compact_forms.admin.inc
View source
<?php

/**
 * @file
 * Compact Forms administration functions.
 */

/**
 * Form builder function for Compact Forms settings.
 */
function compact_forms_admin_form() {
  $form['compact_forms_ids'] = array(
    '#type' => 'textarea',
    '#title' => t('Form CSS IDs'),
    '#rows' => 3,
    '#cols' => 40,
    '#default_value' => variable_get('compact_forms_ids', 'user-login-form'),
    '#description' => t('Enter the CSS IDs of the forms to display compact. One per line.'),
  );
  $form['compact_forms_colons'] = array(
    '#type' => 'checkbox',
    '#title' => t('Keep trailing colons after field labels'),
    '#default_value' => variable_get('compact_forms_colons', 0),
  );
  $form['compact_forms_descriptions'] = array(
    '#type' => 'checkbox',
    '#title' => t('Hide field descriptions'),
    '#default_value' => variable_get('compact_forms_descriptions', 1),
  );
  $form['compact_forms_stars'] = array(
    '#type' => 'radios',
    '#title' => t('Required field marker'),
    '#options' => array(
      0 => t('Remove star'),
      1 => t('Leave star after the label'),
      2 => t('Append star after the form element'),
    ),
    '#default_value' => variable_get('compact_forms_stars', 2),
  );
  $form['compact_forms_field_size'] = array(
    '#type' => 'textfield',
    '#title' => t('Enforced text field size'),
    '#size' => 3,
    '#default_value' => variable_get('compact_forms_field_size', ''),
    '#field_suffix' => t('characters'),
    '#description' => t("If not empty, the size of all text fields in compact forms will be set to the entered size."),
  );
  return system_settings_form($form);
}

Functions

Namesort descending Description
compact_forms_admin_form Form builder function for Compact Forms settings.