You are here

function colorpicker_example_callback_form in Colorpicker 5

Same name and namespace in other branches
  1. 6.2 examples/colorpicker_example.module \colorpicker_example_callback_form()
  2. 6 examples/colorpicker_example.module \colorpicker_example_callback_form()
1 string reference to 'colorpicker_example_callback_form'
colorpicker_example_callback in examples/colorpicker_example.module

File

examples/colorpicker_example.module, line 40

Code

function colorpicker_example_callback_form() {
  $form = array();
  $form['colorpicker_example'] = array(
    '#type' => 'colorpicker',
    '#title' => t('Color picker'),
    '#description' => t('This is the Farbtastic colorpicker.'),
  );
  $form['colorpicker_example_textfield'] = array(
    '#type' => 'colorpicker_textfield',
    '#title' => t('Color picker textfield'),
    '#description' => t('This is a textfield associated with the first Farbtastic color picker'),
    '#default_value' => variable_get('colorpicker_example_textfield', '#ff33dd'),
    '#colorpicker' => 'colorpicker_example',
  );
  $form['colorpicker_example_textfield_2'] = array(
    '#type' => 'colorpicker_textfield',
    '#title' => t('Color picker textfield 2'),
    '#description' => t('This is another textfield associated with the first Farbtastic color picker'),
    '#default_value' => variable_get('colorpicker_example_textfield', '#eedd55'),
    '#colorpicker' => 'colorpicker_example',
  );
  $form['colorpicker_example_2'] = array(
    '#type' => 'colorpicker',
    '#title' => t('Color picker'),
    '#description' => t('This is another Farbtastic colorpicker.'),
  );
  $form['colorpicker_example_textfield_3'] = array(
    '#type' => 'colorpicker_textfield',
    '#title' => t('Color picker textfield 3'),
    '#description' => t('This is a textfield associated with the second Farbtastic color picker'),
    '#default_value' => variable_get('colorpicker_example_textfield', '#cccccc'),
    '#colorpicker' => 'colorpicker_example_2',
  );
  $form['colorpicker_example_textfield_4'] = array(
    '#type' => 'colorpicker_textfield',
    '#title' => t('Color picker textfield 4'),
    '#description' => t('This is another textfield associated with the second Farbtastic color picker'),
    '#default_value' => variable_get('colorpicker_example_textfield', '#000000'),
    '#colorpicker' => 'colorpicker_example_2',
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#title' => t('Save'),
    '#description' => t('Save the default values of this form'),
    '#value' => t('Submit'),
    '#submit' => TRUE,
  );
  return $form;
}