_locale_batch_build
includes/locale.inc, строка 2571
- Версии
- 6
_locale_batch_build($files, $finished = NULL, $components = array())
Build a locale batch from an array of files.
Параметры
$files
Array of files to import
$finished
Optional finished callback for the batch.
$components
Optional list of component names the batch covers. Used in the installer.
Возвращаемое значение
A batch structure
Связанные темы
Код
<?php
function _locale_batch_build($files, $finished = NULL, $components = array()) {
$t = get_t();
if (count($files)) {
$operations = array();
foreach ($files as $file) {
// We call _locale_batch_import for every batch operation.
$operations[] = array('_locale_batch_import', array($file->filename)); }
$batch = array(
'operations' => $operations,
'title' => $t('Importing interface translations'),
'init_message' => $t('Starting import'),
'error_message' => $t('Error importing interface translations'),
'file' => './includes/locale.inc',
// This is not a batch API construct, but data passed along to the
// installer, so we know what did we import already.
'#components' => $components,
);
if (isset($finished)) {
$batch['finished'] = $finished;
}
return $batch;
}
return FALSE;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии