Skip to content
Corex

AdminPage

Corex\Admin\AdminPage · class · Core layer

Shared, presentation-only markup for CoreX-owned wp-admin pages.

__construct(?AccessRequestSurfaceState $requestState, ?RequestableAbilities $requestable)

Section titled “__construct(?AccessRequestSurfaceState $requestState, ?RequestableAbilities $requestable)”

open(string $section, string $title, string $description, string $crumbSuffix, array $subnav): string

Section titled “open(string $section, string $title, string $description, string $crumbSuffix, array $subnav): string”

pageSlugForSection(string $section): ?string

Section titled “pageSlugForSection(string $section): ?string”

The admin page slug a section belongs to, or null when the section is not a CoreX screen. Returning null rather than a fallback slug is deliberate: this answers “where did this person come from”, and the only honest answer for an unknown section is “nowhere I know of”. A caller that guessed corex-settings would send someone who was refused one screen to a different screen they may also be refused from.

state(string $tone, string $title, string $message): string

Section titled “state(string $tone, string $title, string $message): string”

tabs(string $pageSlug, array $tabs, string $active, string $label): string

Section titled “tabs(string $pageSlug, array $tabs, string $active, string $label): string”

A tokenized CoreX tab strip (no browser-default links). Each tab links to the same page with a tab query arg; the active tab carries is-active + aria-current. Shared by every multi-tab CoreX screen so tabs look and behave identically.

The designed denied surface framed as an explicit preview — what the Access screen’s “Access denied” tab embeds for administrators. Never fires the audit event: the viewer has access; nothing was denied.

The designed access-denied surface (design: “Corex Access & Abilities” → Access denied): lock mark, the missing capability named precisely, a real way back, and a real request-access form that submits to the CoreX access request workflow. Rendered for real by {@see permissionDenied()}.

requestAbilityFor(string $section): string

Section titled “requestAbilityFor(string $section): string”

The CoreX ability an access request from this section should ask for. Public and static because the submission handler resolves it from the posted section rather than trusting a posted ability. The browser says which screen it was refused from; the server decides what that screen requires. A client-supplied ability key would let anyone request any ability from any screen, and the request would be indistinguishable from a legitimate one in the approval queue.