You are here

function apachesolr_confgen_form in Apache Solr Config Generator 7

Same name and namespace in other branches
  1. 6 apachesolr_confgen.admin.inc \apachesolr_confgen_form()

Implements hook_form().

Parameters

unknown_type $form_state:

Return value

unknown_type

1 string reference to 'apachesolr_confgen_form'
apachesolr_confgen_menu in ./apachesolr_confgen.module
Implements hook_menu().

File

./apachesolr_confgen.admin.inc, line 18
Schema generator

Code

function apachesolr_confgen_form($form_state) {
  drupal_set_message(t('The zip archives could not be extracted using the built-in archive manager of OS X. If you use a Mac you have to extract the archive using a third party tool. See this !link for details.', array(
    '!link' => l(t('issue'), 'https://drupal.org/node/2066277'),
  )), 'warning');
  foreach (variable_realm_keys('solr_version') as $solr_version => $solr_version_name) {
    $form['set_' . $solr_version] = array(
      '#type' => 'fieldset',
      '#title' => t('%version Configuration Download', array(
        '%version' => $solr_version_name,
      )),
      '#collapsible' => FALSE,
      '#collapsed' => FALSE,
    );
    $form['set_' . $solr_version]['submit_zip_' . $solr_version] = array(
      '#type' => 'submit',
      '#name' => 'button|zip|' . $solr_version,
      '#value' => t('Download all files for !version as zip archive', array(
        '!version' => $solr_version_name,
      )),
    );
    $form['set_' . $solr_version]['single_files'] = array(
      '#type' => 'fieldset',
      '#title' => t('Download single files'),
      '#description' => t('You can also download some of the configuration files separately.'),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
    );
    $form['set_' . $solr_version]['single_files']['submit_schema_' . $solr_version] = array(
      '#type' => 'submit',
      '#name' => 'button|schema|' . $solr_version,
      '#value' => t('Download !file for !version', array(
        '!file' => 'schema.xml',
        '!version' => $solr_version_name,
      )),
    );
    $form['set_' . $solr_version]['single_files']['submit_solrconfig_' . $solr_version] = array(
      '#type' => 'submit',
      '#name' => 'button|solrconfig|' . $solr_version,
      '#value' => t('Download !file for !version', array(
        '!file' => 'solrconfig.xml',
        '!version' => $solr_version_name,
      )),
    );
    $form['set_' . $solr_version]['single_files']['submit_elevate_' . $solr_version] = array(
      '#type' => 'submit',
      '#name' => 'button|elevate|' . $solr_version,
      '#value' => t('Download !file for !version', array(
        '!file' => 'elevate.xml',
        '!version' => $solr_version_name,
      )),
    );
    if (strpos($solr_version, '1.') !== 0) {
      $form['set_' . $solr_version]['single_files']['submit_currency_' . $solr_version] = array(
        '#type' => 'submit',
        '#name' => 'button|currency|' . $solr_version,
        '#value' => t('Download !file for !version', array(
          '!file' => 'currency.xml',
          '!version' => $solr_version_name,
        )),
      );
    }
  }
  return $form;
}