function _filefield_paths_batch_update_process in File (Field) Paths 6
Same name and namespace in other branches
- 8 filefield_paths.module \_filefield_paths_batch_update_process()
- 7 filefield_paths.module \_filefield_paths_batch_update_process()
1 string reference to '_filefield_paths_batch_update_process'
- filefield_paths_batch_update in ./filefield_paths.module
- Set batch process to update FileField Paths.
File
- ./filefield_paths.module, line 308
- Contains core functions for the FileField Paths module.
Code
function _filefield_paths_batch_update_process($objects, $module, $field, &$context) {
if (!isset($context['sandbox']['progress'])) {
$context['sandbox']['progress'] = 0;
$context['sandbox']['max'] = count($objects);
$context['sandbox']['objects'] = $objects;
}
$count = min(5, count($context['sandbox']['objects']));
for ($i = 1; $i <= $count; $i++) {
$oid = array_shift($context['sandbox']['objects']);
if (function_exists($function = "{$module}_filefield_paths_update")) {
$function($oid, $field);
}
$context['sandbox']['progress']++;
}
if ($context['sandbox']['progress'] != $context['sandbox']['max']) {
$context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];
}
}