You are here

function apachesolr_index_action_form in Apache Solr Search 7

Same name and namespace in other branches
  1. 8 apachesolr.admin.inc \apachesolr_index_action_form()
  2. 6.3 apachesolr.admin.inc \apachesolr_index_action_form()
  3. 6.2 apachesolr.admin.inc \apachesolr_index_action_form()

Form builder for the Apachesolr Indexer actions form.

_state

Parameters

array $form:

string $env_id: The machine name of the environment.

Return value

array $form

See also

apachesolr_index_action_form_delete_submit().

1 string reference to 'apachesolr_index_action_form'
apachesolr_status_page in ./apachesolr.admin.inc
Gets information about the fields already in solr index.

File

./apachesolr.admin.inc, line 876
Administrative pages for the Apache Solr framework.

Code

function apachesolr_index_action_form(array $form, array $form_state, $env_id) {
  $form = array();
  $form['action'] = array(
    '#type' => 'fieldset',
    '#title' => t('Actions'),
    '#collapsible' => TRUE,
  );
  $form['action']['env_id'] = array(
    '#type' => 'value',
    '#value' => $env_id,
  );
  $form['action']['cron'] = array(
    '#prefix' => '<div>',
    '#type' => 'submit',
    '#value' => t('Index queued content (!amount)', array(
      '!amount' => variable_get('apachesolr_cron_limit', 50),
    )),
    '#submit' => array(
      'apachesolr_index_action_form_cron_submit',
    ),
  );
  $form['action']['cron_description'] = array(
    '#prefix' => '<span>',
    '#suffix' => '</span></div>',
    '#markup' => t('Indexes just as many items as 1 cron run would do.'),
  );
  $form['action']['remaining'] = array(
    '#prefix' => '<div>',
    '#type' => 'submit',
    '#value' => t('Index all queued content'),
    '#submit' => array(
      'apachesolr_index_action_form_remaining_submit',
    ),
  );
  $form['action']['remaining_description'] = array(
    '#prefix' => '<span>',
    '#suffix' => '</span></div>',
    '#markup' => t('Could take time and could put an increased load on your server.'),
  );
  $form['action']['reset'] = array(
    '#prefix' => '<div>',
    '#suffix' => '</div>',
    '#type' => 'submit',
    '#value' => t('Queue all content for reindexing'),
    '#submit' => array(
      'apachesolr_index_action_form_reset_submit',
    ),
  );
  $form['action']['delete'] = array(
    '#prefix' => '<div>',
    '#type' => 'submit',
    '#value' => t('Delete the Search & Solr index'),
    '#submit' => array(
      'apachesolr_index_action_form_delete_submit',
    ),
  );
  $form['action']['delete_description'] = array(
    '#prefix' => '<span>',
    '#suffix' => '</span></div>',
    '#markup' => t('Useful with a corrupt index or a new schema.xml.'),
  );
  return $form;
}