$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')) ); ?>
items',
'settings' => '' . t('acp.srv.settings_link') . '',
]) ?>
= h($row['help']) ?>
= t_default('acp.srv.edit_entries', 'Edit entries') ?>= t('acp.srv.published', ['count' => number_format((int)$row['count'])]) ?> = t('acp.srv.nothing_published') ?> = h(serverdata_human_size((int)$row['upload_size'])) ?> 1): ?> = t('acp.srv.xml_files', ['count' => number_format((int)$row['files'])]) ?>
| = t('acp.srv.col_source') ?> | = h($row['path_label']) ?> |
| = t('acp.srv.col_uploaded') ?> | = $row['upload_date'] ? h(date('Y-m-d H:i', (int)$row['upload_date'])) : '—' ?> |
| = t('acp.srv.col_published') ?> | = $row['cache_date'] ? h(date('Y-m-d H:i', (int)$row['cache_date'])) : '—' ?> |
| = t('acp.srv.col_public_page') ?> | = h($row['page']) ?> |
= t('acp.srv.storage_hint', [
'path' => '' . h(ZNOTE_SERVERDATA_DIR) . '',
'size' => h(serverdata_human_size($maxUpload)),
]) ?>