You are here

function book_access_ui_rebuild_all_submit in Book access 7.2

Form submissions handler for book_access_ui_rebuild_all().

See also

book_access_ui_rebuild_all()

File

./book_access_ui.admin.inc, line 406
Administration interface for the Book access module.

Code

function book_access_ui_rebuild_all_submit($form, &$form_state) {
  $allBids = array();
  $resultSet = db_select('book', 'book')
    ->fields('book', array(
    'bid',
  ))
    ->distinct()
    ->execute();
  while ($row = $resultSet
    ->fetchAssoc()) {
    $allBids[] = $row['bid'];
  }
  $batch = array(
    'title' => t('Rebuilding all book access permissions'),
    'operations' => array(
      array(
        '_book_access_ui_rebuild_batch_operation',
        array(
          $allBids,
        ),
      ),
    ),
    'finished' => '_book_access_ui_rebuild_batch_finished',
    'progress_message' => '',
    'file' => drupal_get_path('module', 'book_access') . '/book_access_ui.admin.inc',
  );
  batch_set($batch);
}