You are here

function apachesolr_attachments_confirm_submit in Apache Solr Attachments 7

Same name and namespace in other branches
  1. 6.3 apachesolr_attachments.admin.inc \apachesolr_attachments_confirm_submit()
  2. 6 apachesolr_attachments.admin.inc \apachesolr_attachments_confirm_submit()
  3. 6.2 apachesolr_attachments.admin.inc \apachesolr_attachments_confirm_submit()

Form submit handler for the index confirmation form

See also

apachesolr_attachments_confirm()

File

./apachesolr_attachments.admin.inc, line 254
Provides a file attachment search implementation for use with the Apache Solr module

Code

function apachesolr_attachments_confirm_submit($form, &$form_state) {
  switch ($form_state['values']['operation']) {
    case 'delete':
      if (apachesolr_attachments_delete_index() && apachesolr_attachments_solr_reindex()) {
        drupal_set_message(t('File text has been deleted from the Apache Solr index. You must now <a href="@url">run cron</a> until all files have been re-indexed.', array(
          '@url' => url('admin/reports/status/run-cron', array(
            'query' => array(
              'destination' => 'admin/config/search/apachesolr/index',
            ),
          )),
        )));
      }
      else {
        if (module_exists('dblog')) {
          drupal_set_message(t('Could not delete file text from the Apache Solr index. Check <a href="@url">recent log messages</a>.', array(
            '@url' => url('admin/reports/dblog'),
          )));
        }
        else {
          drupal_set_message(t('Could not delete file text from the Apache Solr index.'));
        }
      }
      break;
    case 'clear-cache':
      cache_clear_all('*', 'cache_apachesolr_attachments_file_body', TRUE);
      drupal_set_message(t('The local cache of extracted text has been deleted.'));
      break;
  }
  $form_state['redirect'] = 'admin/config/search/apachesolr/attachments';
}