Batch API

Here's an example of how to use the Batch API, originally introduced in Drupal 6. In this example, you would probably call batch_example() from a form submit handler, where the form submission provided the $options you want to use to update the nodes.

PS! This is only an example. Don't forget to actually read the API documentation.

* The $batch can include the following values. Only 'operations'
* and 'finished' are required, all others will be set to default values.
* @param operations
* An array of callbacks and arguments for the callbacks.
* There can be one callback called one time, one callback
* called repeatedly with different arguments, different
* callbacks with the same arguments, one callback with no
* arguments, etc. (Use an empty array if you want to pass
* no arguments.)
* @param finished
* A callback to be used when the batch finishes.
* @param title
* A title to be displayed to the end user when the batch starts.
* @param init_message
* An initial message to be displayed to the end user when the batch starts.
* @param progress_message
* A progress message for the end user. Placeholders are available.

Subscribe with RSS Subscribe to RSS - batch