API / Minn\Front / AdminBar

AdminBar final readonly class

Minn\Front\AdminBar · public/minn/src/Minn/Front/AdminBar.php · 326 lines

The Minn bar on the public site: the same server-rendered chrome the app ships (assets/js/bar.js and assets/css/bar.css from the bundle), built here for a signed-in reader who can edit. There is no other bar and no other admin on the engine, so it is on for everyone who passes the edit_posts gate; the app's per-person opt-in does not apply.

Constants and properties

privatereadonly Minn\Auth\Authenticated $session

Promoted from the constructor.

privatereadonly Minn\Auth\Capabilities $capabilities

Promoted from the constructor.

privatereadonly Minn\Content\Site $site

Promoted from the constructor.

privatereadonly Minn\Front\Permalinks $permalinks

Promoted from the constructor.

privatereadonly Minn\Admin\App $app

Promoted from the constructor.

privatereadonly Minn\Admin\Appearance $appearance

Promoted from the constructor.

privatereadonly Minn\Admin\AdminTypes $types

Promoted from the constructor.

Public

new__construct(Minn\Auth\Authenticated $session, Minn\Auth\Capabilities $capabilities, Minn\Content\Site $site, Minn\Front\Permalinks $permalinks, Minn\Admin\App $app, Minn\Admin\Appearance $appearance, Minn\Admin\AdminTypes $types)#
staticforReader(?Minn\Auth\Authenticated $session, Minn\Auth\Capabilities $capabilities, Minn\Content\Site $site, Minn\Front\Permalinks $permalinks, Minn\Admin\App $app, Minn\Admin\Appearance $appearance, Minn\Admin\AdminTypes $types): ?self#

The bar for a signed-in editor, or null for anyone else.

methodhead(): string#

The stylesheet link for the head.

methodrender(Minn\Front\Resolution $resolution): string#

The bar markup, its config, and the script, for the end of the body.

Internals 18

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatet(string $text): string#

A string of Minn Admin's, in the site's language (its own text domain, as the plugin asks for it).

privatemarkup(?array $status, string $editUrl, string $editLabel): string#
privatesiteMenu(Closure $can): string#

The site menu: the app's main views this user may open.

privatestatusMenu(?array $status, Closure $can): string#

The status menu, only when the page carries a site status. @param array<string, mixed>|null $status

$statusarray<string, mixed>|null
privatenewMenu(Closure $can): string#

The create menu: a post, and a page for those who may edit them.

privatenotificationsMenu(): string#

The notifications menu; bar.js fills the items.

privateuserMenu(Minn\Content\UserRecord $user): string#

The account menu: profile and sign out.

privatestatus(): ?array#

The status chip: the one thing the engine can say about site visibility is whether search engines are asked to stay away.

@return array{tone: string, label: string, title: string, sub: string, fix: ?array}|null
privateeditTarget(Minn\Front\Resolution $resolution): array#
@return array{0: string, 1: string, 2: string} url (or ''), label, hint
privatecommands(string $editUrl, string $editLabel, string $editHint): array#
privatesearchTypes(): array#

post type slug => editor route base, for the palette's content results.

privatecustomSchemeStyle(array $appearance): string#
privateappUrl(): string#
privateappPath(string $path): string#
privateassetUrl(string $relative): string#
privateicon(string $paths): string#
privategridIcon(): string#
privatemenuItem(string $href, string $icon, string $title, string $sub = '', string $meta = ''): string#