Update core 8.3.0
This commit is contained in:
parent
da7a7918f8
commit
cd7a898e66
6144 changed files with 132297 additions and 87747 deletions
|
|
@ -19,23 +19,23 @@ class FileWidgetAjaxController {
|
|||
* A JsonResponse object.
|
||||
*/
|
||||
public function progress($key) {
|
||||
$progress = array(
|
||||
$progress = [
|
||||
'message' => t('Starting upload...'),
|
||||
'percentage' => -1,
|
||||
);
|
||||
];
|
||||
|
||||
$implementation = file_progress_implementation();
|
||||
if ($implementation == 'uploadprogress') {
|
||||
$status = uploadprogress_get_info($key);
|
||||
if (isset($status['bytes_uploaded']) && !empty($status['bytes_total'])) {
|
||||
$progress['message'] = t('Uploading... (@current of @total)', array('@current' => format_size($status['bytes_uploaded']), '@total' => format_size($status['bytes_total'])));
|
||||
$progress['message'] = t('Uploading... (@current of @total)', ['@current' => format_size($status['bytes_uploaded']), '@total' => format_size($status['bytes_total'])]);
|
||||
$progress['percentage'] = round(100 * $status['bytes_uploaded'] / $status['bytes_total']);
|
||||
}
|
||||
}
|
||||
elseif ($implementation == 'apc') {
|
||||
$status = apcu_fetch('upload_' . $key);
|
||||
if (isset($status['current']) && !empty($status['total'])) {
|
||||
$progress['message'] = t('Uploading... (@current of @total)', array('@current' => format_size($status['current']), '@total' => format_size($status['total'])));
|
||||
$progress['message'] = t('Uploading... (@current of @total)', ['@current' => format_size($status['current']), '@total' => format_size($status['total'])]);
|
||||
$progress['percentage'] = round(100 * $status['current'] / $status['total']);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue