You are here

function mobile_codes_presets_form in Mobile Codes 6

Same name and namespace in other branches
  1. 5 mobile_codes.admin.inc \mobile_codes_presets_form()

Mobile Codes presets form.

1 call to mobile_codes_presets_form()
mobile_codes_presets_form_edit in ./mobile_codes.admin.inc
1 string reference to 'mobile_codes_presets_form'
mobile_codes_menu in ./mobile_codes.module
Implementation of hook_menu().

File

./mobile_codes.admin.inc, line 54

Code

function mobile_codes_presets_form(&$form_state) {
  $form = array(
    '#validate' => array(
      'mobile_codes_presets_form_validate',
    ),
    '#submit' => array(
      'mobile_codes_presets_form_submit',
    ),
    '#redirect' => 'admin/settings/mobile_codes',
  );

  // Preset settings
  $form['preset'] = array(
    '#type' => 'fieldset',
    '#title' => 'Preset settings',
  );
  $form['preset']['name'] = array(
    '#type' => 'textfield',
    '#title' => 'Name',
    '#required' => TRUE,
    '#default_value' => '',
    '#description' => t('Please only use alphanumeric characters, underscores (_), and hyphens (-) for Preset names') . '.',
  );

  // Mobile codes settings
  $form['mobile_codes'] = array(
    '#type' => 'fieldset',
    '#title' => 'Mobile Codes settings',
  );
  $form['mobile_codes']['type'] = array(
    '#type' => 'select',
    '#title' => t('Code type'),
    '#options' => array(
      'dm' => t('Datamatrix'),
      'qr' => t('QR Code'),
    ),
    '#default_value' => 'qr',
    '#description' => t('
      Set the default Mobile Code type - <a href="http://en.wikipedia.org/wiki/Datamatrix">Datamatrix</a> or <a href="http://en.wikipedia.org/wiki/QR_Code">QR Code</a>.
    '),
  );
  $form['mobile_codes']['data'] = array(
    '#type' => 'select',
    '#title' => t('Data type'),
    '#options' => array(
      'phone' => t('Phone Number'),
      'text' => t('Text'),
      'link' => t('URL'),
    ),
    '#default_value' => 'text',
    '#description' => t('Set the default Mobile Code data type.'),
  );
  $form['mobile_codes']['size'] = array(
    '#type' => 'select',
    '#title' => t('Mobile Code size'),
    '#options' => array(
      's' => t('Small'),
      'm' => t('Medium'),
      'l' => t('Large'),
    ),
    '#default_value' => 'm',
    '#description' => t('Set the default Mobile Code size.'),
  );
  $form['mobile_codes']['tinyurl'] = array(
    '#type' => 'checkbox',
    '#title' => t('Convert URLs to TinyURLs'),
    '#default_value' => FALSE,
    '#description' => t('
      Set the default Mobile Code TinyURL behavior<br />
      <strong>Note:</strong> URLs over 60 characters will always get converted to TinyURLs.
    '),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => 'Save Preset',
  );
  return $form;
}