Skip to content
Corex

StandalonePage

Corex\Admin\StandalonePage · class · Core layer

Renders a complete, self-contained HTML document for a CoreX interstitial that is served OUTSIDE the enqueued admin shell — the Maintenance-mode 503 shown to anonymous front-end visitors, and the menu-level access-denied / request-access 403. Those responses cannot rely on a registered CoreX stylesheet (they short-circuit the normal page lifecycle), so this class inlines the scoped --corex-admin-* token adapter plus the standalone sheet, producing a fully branded page with no external CSS request. The supplied body HTML is already-escaped, trusted CoreX markup; the document scaffold escapes the dynamic attributes/title it introduces.

__construct(string $assetsPath, string $assetsUrl)

Section titled “__construct(string $assetsPath, string $assetsUrl)”

Build a renderer bound to the corex-core asset directory.

document(string $title, string $bodyHtml, string $variant, bool $indexable): string

Section titled “document(string $title, string $bodyHtml, string $variant, bool $indexable): string”

A full <!DOCTYPE html> document wrapping $bodyHtml in the branded standalone body.

notice(string $title, string $message, string $backUrl, string $backLabel): string

Section titled “notice(string $title, string $message, string $backUrl, string $backLabel): string”

A short branded notice page (403/404/expired-link and similar interstitials that fire from an admin-post front controller, outside the admin shell). Escapes its own dynamic values.

copyField(string $id, string $label, string $value, string $action): string

Section titled “copyField(string $id, string $label, string $value, string $action): string”

A value somebody has to copy, in a read-only field with a button that copies it (spec 101, FR-011a): the preview link, which is shown once and has to leave the page whole. The button is written hidden and the script shows it, so a page whose script does not run has a field to select and copy by hand, and no button that does nothing. The script is inlined, as the stylesheet is, and through WordPress’s own function: a site that sends a Content-Security-Policy adds its nonce with the wp_inline_script_attributes filter. What the script says is written here, so it is translated like the rest of the page. What the button answered is written on the label’s line, at its other end: over the button, and where it takes no room of its own, so the card does not move when the answer comes. The field reads left to right whatever the page’s direction: it is for an address or a code.

The five-square CoreX brand mark as an inline SVG in currentColor, so the surrounding standalone styles own its size and colour. Shared by every standalone interstitial.