setCompileDir($compileDir); $smarty->setTemplateDir(dirname(__DIR__) . '/resources/views/venix'); $smarty->assign('config', ['appName' => 'Venix Test', 'jump_delay' => 1000]); $smarty->assign('cdn', ''); $smarty->assign('user', (object) ['user_name' => '演示用户']); $smarty->assign('admin_can_manage', false); $smarty->assign('user_iso_enabled', false); $preview = '用户页面预览此处仅使用合成数据,公告首屏使用安全摘要并在打开后静默校验。' . str_repeat('预览内容用于检查打开公告前后页面滚动位置。', 8); $smarty->assign('cloud_page', 'fixture'); $smarty->assign('cloud_title', '我的实例'); $smarty->assign('cloud_vm_id', ''); $smarty->assign('cloud_invoice_id', ''); $now = time(); $items = []; for ($id = 12; $id >= 1; --$id) { $kind = $id === 12 ? 'maintenance' : ($id === 11 ? 'incident' : 'notice'); $publishedAt = '2026-09-' . str_pad((string) (17 + $id), 2, '0', STR_PAD_LEFT) . ' 10:00:00'; $items[] = ['id' => $id, 'title' => $id === 12 ? '香港区域计划维护通知' : ($id === 11 ? '区域网络故障说明' : '站点服务通知 ' . $id), 'type' => $kind, 'type_label' => ['notice' => '通知', 'maintenance' => '维护', 'incident' => '故障'][$kind], 'body' => $id === 12 ? "维护时间:2026-10-01 02:00 至 03:00(站点时间)。\n维护期间可能短暂中断,请提前保存工作。\n这是一条预览公告,不代表真实维护安排。" : ($id === 11 ? "历史故障说明,仅用于预览。\nHTML 不执行:\n" : "服务通知正文。\n保持段落换行,使用原有用户页面主题。"), 'status' => 'published', 'published_at' => $publishedAt, 'published_at_epoch' => strtotime($publishedAt), 'updated_at' => $publishedAt, 'updated_at_epoch' => strtotime($publishedAt)]; } $pages = []; foreach ([1, 2] as $page) { $pages[$page] = ['items' => array_slice($items, ($page - 1) * 10, 10), 'pagination' => ['page' => $page, 'per_page' => 10, 'total' => 12, 'total_pages' => 2], 'generated_at' => $now]; } $empty = ['items' => [], 'pagination' => ['page' => 1, 'per_page' => 10, 'total' => 0, 'total_pages' => 1], 'generated_at' => $now]; $smarty->assign('panel_announcements_bootstrap_json', json_encode($pages[1], JSON_UNESCAPED_UNICODE | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_INVALID_UTF8_SUBSTITUTE | JSON_THROW_ON_ERROR)); $accountHtml = $smarty->fetch('string:{include file="user/layout_header.tpl" vu_title="账户设置" vu_active="edit"}') . $preview . $smarty->fetch('string:{include file="user/layout_footer.tpl"}{include file="user/layout_scripts.tpl"}
此处仅使用合成数据,公告首屏使用安全摘要并在打开后静默校验。
用于检查打开公告前后页面滚动位置。