1 search.admin.inc search_reindex_confirm()

Menu callback: confirm rebuilding of the index.

File

core/modules/search/search.admin.inc, line 10
Admin page callbacks for the Search module.

Code

function search_reindex_confirm() {

  $index_stats = search_get_stats();

  $form['#attributes'] = array(
    'class' => array('confirmation'),
  );

  $form['index_type'] = array(
    '#type' => 'radios',
    '#title' => t('Items to index:'),
    '#options' => array(
      'total' => t('Re-index entire site (@total_items)', array('@total_items' => $index_stats['total'] . ' ' . format_plural($index_stats['total'], 'item', 'items'))),
      'remaining' => t('Index only remaining items (@remaining)', array('@remaining' => $index_stats['remaining'] . ' ' . format_plural($index_stats['remaining'], 'item', 'items'))),
    ),
    '#default_value' => 'total',
  );

  $form['description'] = array(
    '#type' => 'help',
    '#markup' => t('This action will rebuild the search index. It may be a lengthy process.'),
  );

  $form['actions'] = array(
    '#type' => 'actions',
    'submit' => array(
      '#type' => 'submit',
      '#value' => t('Rebuild search index'),
    ),
    'cancel' => array(
      '#type' => 'link',
      '#title' => t('Cancel'),
      '#href' => 'admin/config/search/settings',
      '#options' => array(
        'path' => 'admin/config/search/settings',
      ),
    ),
  );

  return $form;
}