You are here

function flysystem_config_form in Flysystem 7

Page callback for the Flysystem configuration form.

1 string reference to 'flysystem_config_form'
flysystem_menu in ./flysystem.module
Implements hook_menu().

File

./flysystem.admin.inc, line 11
Configuration page callbacks for Flysystem.

Code

function flysystem_config_form(array $form, array &$form_state) {
  if (!flysystem_dependencies_check()) {
    drupal_set_message(t('The Flysystem dependencies are not installed correctly.'));
    return $form;
  }
  $schemes = array_keys(variable_get('flysystem', array()));
  $form['sync_from'] = array(
    '#type' => 'select',
    '#options' => array_combine($schemes, $schemes),
    '#title' => t('Sync from'),
    '#required' => TRUE,
  );
  $form['sync_to'] = array(
    '#type' => 'select',
    '#options' => array_combine($schemes, $schemes),
    '#title' => t('Sync to'),
    '#required' => TRUE,
  );
  $form['force'] = array(
    '#type' => 'checkbox',
    '#title' => t('Force'),
    '#description' => t('Normally, existing files will be ignored. Selecting this option will overwrite any existing files.'),
  );
  $form['actions']['#type'] = 'actions';
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Sync'),
  );
  return $form;
}