You are here

function _webform_edit_signaturefield in SignatureField 6

Same name and namespace in other branches
  1. 7.2 includes/webform.inc \_webform_edit_signaturefield()
  2. 7 includes/webform.inc \_webform_edit_signaturefield()

Generate the form for editing a component.

Create a set of form elements to be displayed on the form for editing this component. Use care naming the form items, as this correlates directly to the database schema. The component "Name" and "Description" fields are added to every component type and are not necessary to specify here (although they may be overridden if desired).

Parameters

$component: A Webform component array.

Return value

An array of form items to be displayed on the edit component page

File

modules/webform.inc, line 49
Webform module integration.

Code

function _webform_edit_signaturefield($component) {
  $form = array();

  // Disabling the description if not wanted.
  $form['description'] = array();

  // Most options are stored in the "extra" array, which stores any settings
  // unique to a particular component type.
  $form['extra']['color'] = array(
    '#type' => 'textfield',
    '#title' => t('Color'),
    '#default_value' => $component['extra']['color'],
    '#description' => t('Hex value for pen color'),
    '#maxlength' => 7,
    '#size' => 7,
    '#required' => FALSE,
  );
  $form['extra']['width'] = array(
    '#type' => 'textfield',
    '#title' => t('Width'),
    '#default_value' => $component['extra']['width'],
    '#description' => t('Override default signature width'),
    '#maxlength' => 3,
    '#size' => 3,
    '#required' => FALSE,
  );
  $form['extra']['height'] = array(
    '#type' => 'textfield',
    '#title' => t('Height'),
    '#default_value' => $component['extra']['height'],
    '#description' => t('Override default signature height'),
    '#maxlength' => 2,
    '#size' => 2,
    '#required' => FALSE,
  );
  return $form;
}