$label, 'page' => $sources[$key]['page']])); acp_redirect('serverinfo'); } if ($do === 'rebuild') { $error = null; if (serverdata_rebuild($key, $error)) { $count = serverdata_count($key, serverdata_load($key)); acp_log('serverdata.rebuild', $key, ['records' => $count]); acp_flash_success(t('acp.srv.rebuilt', ['label' => $label, 'count' => number_format($count)])); if ($error !== null) { acp_flash_info($error); } } else { acp_flash_error($label . ': ' . (string)$error); } acp_redirect('serverinfo'); } if ($do === 'upload') { $file = $_FILES['payload'] ?? null; if (!is_array($file) || ($file['error'] ?? UPLOAD_ERR_NO_FILE) === UPLOAD_ERR_NO_FILE) { acp_flash_error(t('acp.srv.select_file')); acp_redirect('serverinfo'); } if (($file['error'] ?? UPLOAD_ERR_OK) !== UPLOAD_ERR_OK) { $reasons = [ UPLOAD_ERR_INI_SIZE => t('acp.srv.err_ini_size'), UPLOAD_ERR_FORM_SIZE => t('acp.srv.err_form_size'), UPLOAD_ERR_PARTIAL => t('acp.srv.err_partial'), UPLOAD_ERR_NO_TMP_DIR => t('acp.srv.err_no_tmp_dir'), UPLOAD_ERR_CANT_WRITE => t('acp.srv.err_cant_write'), UPLOAD_ERR_EXTENSION => t('acp.srv.err_extension'), ]; acp_flash_error($reasons[(int)$file['error']] ?? t('acp.srv.upload_failed')); acp_redirect('serverinfo'); } if (!is_uploaded_file((string)$file['tmp_name'])) { acp_flash_error(t('acp.srv.upload_unverified')); acp_redirect('serverinfo'); } $error = null; if (serverdata_publish_upload($key, (string)$file['tmp_name'], (string)$file['name'], $error)) { $count = serverdata_count($key, serverdata_load($key)); acp_log('serverdata.upload', $key, [ 'file' => basename((string)$file['name']), 'records' => $count, ]); acp_flash_success(t('acp.srv.uploaded', [ 'label' => $label, 'count' => number_format($count), 'page' => $sources[$key]['page'], ])); if ($error !== null) { acp_flash_info($error); } } else { acp_flash_error($label . ': ' . (string)$error); } acp_redirect('serverinfo'); } } $status = serverdata_status(); $itemsPage = !empty($config['items']); $maxUpload = min( (int)serverdata_ini_bytes((string)ini_get('upload_max_filesize')), (int)serverdata_ini_bytes((string)ini_get('post_max_size')) ); ?>
(int)$ready, 'total' => count($status)]) ?>
'items', 'settings' => '' . t('acp.srv.settings_link') . '', ]) ?>
'config_editor', 'items' => 'items_editor', 'creatures' => 'creatures_editor'); ?> $row): ?>

number_format((int)$row['count'])]) ?> 1): ?> number_format((int)$row['files'])]) ?>

'' . h(ZNOTE_SERVERDATA_DIR) . '', 'size' => h(serverdata_human_size($maxUpload)), ]) ?>