'Start a support request','alpha-signup.php'=>'Become an Alpha tester','appeal.php'=>'Request a ban review'][$page];
$description = 'Complete the form below. Your request is private to you and authorised staff.';
if ($page === 'alpha-signup.php') $art = 'news-community.webp';
if ($page === 'appeal.php') $art = 'seals/department-ban-appeals-150.png';
} elseif ($page === 'view.php') {
$title = 'Your ticket conversation';
$description = 'Review the conversation, evidence and updates, then reply below.';
} elseif ($page === 'login.php') {
$title = $staff ? 'Staff sign in' : 'Access your support requests';
$description = 'Use the existing secure sign-in options below.';
}
$esc = static fn(string $s): string => htmlspecialchars($s, ENT_QUOTES, 'UTF-8');
$hero = ''
.'
'
.'THE IMPERIAL '.($staff?'CASEWORK':'SUPPORT').' BUREAU
'
.'
'.$esc($title).'
'.$esc($description).'
'.($staff?'Authorised staff workspace':'DuneRealms community support').' '
.'← Account Center';
$navigation = $staff ? [
['Ticket desk','/scp/tickets.php','seals/department-support-150.png',$page==='tickets.php'],
['Support portal','/index.php','nav-support-full-v2.webp',false],
['Account Center','https://cp.dunerealms.com/','nav-account-full-v2.webp',false],
] : [
['Overview','/index.php','nav-support-full-v2.webp',$page==='index.php'||$page===''],
['Your tickets','/tickets.php','seals/department-support-150.png',in_array($page,['tickets.php','view.php'],true)],
['New request','/open.php','seals/department-forum-support-150.png',in_array($page,['open.php','alpha-signup.php','appeal.php'],true)],
['Service targets','/service-targets.php','seals/department-legal-v2-150.png',$page==='service-targets.php'],
['Account Center','https://cp.dunerealms.com/','nav-account-full-v2.webp',false],
];
$submenu = '';
$heading = '
'.$hero.$submenu.'
';
// Only the native content root; forms, messages and navigation are byte-preserved.
$html = preg_replace_callback('~]*\bid=["\']content["\'][^>]*>~i', static fn($m) => $m[0].$heading, $html, 1);
$html = preg_replace_callback('~]*)>~i', static function($m) use ($staff) {
$classes = 'dune-support-workspace '.($staff?'dune-support-staff':'dune-support-client');
$attrs = $m[1];
if (preg_match('~\bclass=(["\'])(.*?)\1~i', $attrs)) $attrs = preg_replace('~\bclass=(["\'])(.*?)\1~i', 'class="$2 '.$classes.'"', $attrs, 1);
else $attrs .= ' class="'.$classes.'"';
return '';
}, $html, 1);
return str_ireplace('', '', $html);
}