You are here

function uptolike_admin_settings_form in Uptolike share buttons 7

Form builder for admin settings page.

1 string reference to 'uptolike_admin_settings_form'
uptolike_menu in ./uptolike.module
Implements hook_menu().

File

./uptolike.admin.inc, line 170
Code for admin pages of Uptolike module.

Code

function uptolike_admin_settings_form($form, &$form_state) {
  $form['uptolike_language'] = array(
    '#type' => 'select',
    '#title' => t('Language'),
    '#description' => t('Select Uptolike share buttons language.'),
    '#options' => array(
      'en' => t('English'),
      'ru' => t('Russian'),
      'ua' => t('Ukrainian'),
      'de' => t('German'),
      'es' => t('Spanish'),
      'it' => t('Italian'),
      'lt' => t('Lithuanian'),
      'pl' => t('Polish'),
    ),
    '#default_value' => variable_get('uptolike_language', uptolike_default_language()),
  );
  $form['uptolike_number_of_blocks'] = array(
    '#type' => 'select',
    '#title' => t('Number of blocks'),
    '#description' => t('Number of Uptolike share buttons blocks.'),
    // Number of blocks, from 0 to 10.
    '#options' => range(0, 10),
    '#default_value' => variable_get('uptolike_number_of_blocks', 1),
  );

  // Prepare array of options.
  $options = array();
  foreach (entity_get_info() as $entity_type => $entity) {
    $options[$entity_type] = $entity['label'];
  }
  $form['uptolike_entities'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Entities'),
    '#description' => t('Show Uptolike share buttons on selected entities.'),
    '#options' => $options,
    '#default_value' => variable_get('uptolike_entities', array(
      'node',
    )),
  );
  $form['uptolike_every_page'] = array(
    '#type' => 'checkbox',
    '#title' => t('Add main javascript code on every page'),
    '#description' => t('This is useful if you are using content filter.'),
    '#default_value' => variable_get('uptolike_every_page', 0),
  );
  $form['uptolike_feedback'] = array(
    '#type' => 'item',
    '#title' => t('Feedback !email.', array(
      '!email' => l(UPTOLIKE_SUPPORT_EMAIL, 'mailto:' . UPTOLIKE_SUPPORT_EMAIL),
    )),
  );
  return system_settings_form($form);
}