function prepare_beans_button_submit in GlobalLink Connect for Drupal 7.7
Beans batch sets .
1 string reference to 'prepare_beans_button_submit'
- globallink_useful_tools in ./
globallink_settings.inc - Globallink Useful Tools form.
File
- ./
globallink_settings.inc, line 1335
Code
function prepare_beans_button_submit($form, &$form_state) {
$batch = array(
'operations' => array(),
'finished' => 'globallink_settings_beans_batch_finished',
'title' => t('Updating Beans'),
'init_message' => t('Update Beans is starting.'),
'progress_message' => t('Processed @current out of @total.'),
'error_message' => t('Update Beans has encountered an error.'),
'file' => drupal_get_path('module', 'globallink') . '/globallink_settings.inc',
);
$progress = 0;
$limit = 10;
$result = db_query("SELECT * FROM {bean_type}")
->fetchAll();
$max = count($result);
while ($progress <= $max) {
$batch['operations'][] = array(
'globallink_settings_beans_process',
array(
$progress,
$limit,
$result,
),
);
$progress = $progress + $limit;
}
batch_set($batch);
}