You are here

function book_access_ui_reset_all_to_defaults_submit in Book access 7.2

Form submissions callback for book_access_ui_reset_all_to_defaults().

See also

book_access_ui_reset_all_to_defaults()

File

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

Code

function book_access_ui_reset_all_to_defaults_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('Resetting all book access permissions'),
    'operations' => array(
      array(
        '_book_access_ui_reset_batch_operation',
        array(
          $allBids,
        ),
      ),
    ),
    'finished' => '_book_access_ui_reset_batch_finished',
    'progress_message' => '',
    'file' => drupal_get_path('module', 'book_access') . '/book_access_ui.admin.inc',
  );
  batch_set($batch);
}