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
| private | readonly Minn\Auth\Authenticated $session | Promoted from the constructor. |
| private | readonly Minn\Auth\Capabilities $capabilities | Promoted from the constructor. |
| private | readonly Minn\Content\Site $site | Promoted from the constructor. |
| private | readonly Minn\Front\Permalinks $permalinks | Promoted from the constructor. |
| private | readonly Minn\Admin\App $app | Promoted from the constructor. |
| private | readonly Minn\Admin\Appearance $appearance | Promoted from the constructor. |
| private | readonly 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)# | |
| static | forReader(?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. |
| method | head(): string# | The stylesheet link for the head. |
| method | render(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.
| private | t(string $text): string# | A string of Minn Admin's, in the site's language (its own text domain, as the plugin asks for it). | |||
| private | markup(?array $status, string $editUrl, string $editLabel): string# | ||||
| private | siteMenu(Closure $can): string# | The site menu: the app's main views this user may open. | |||
| private | statusMenu(?array $status, Closure $can): string# | The status menu, only when the page carries a site status. @param array<string, mixed>|null $status
| |||
| private | newMenu(Closure $can): string# | The create menu: a post, and a page for those who may edit them. | |||
| private | notificationsMenu(): string# | The notifications menu; bar.js fills the items. | |||
| private | userMenu(Minn\Content\UserRecord $user): string# | The account menu: profile and sign out. | |||
| private | status(): ?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 | |||
| private | editTarget(Minn\Front\Resolution $resolution): array# | @return array{0: string, 1: string, 2: string} url (or ''), label, hint | |||
| private | commands(string $editUrl, string $editLabel, string $editHint): array# | ||||
| private | searchTypes(): array# | post type slug => editor route base, for the palette's content results. | |||
| private | customSchemeStyle(array $appearance): string# | ||||
| private | appUrl(): string# | ||||
| private | appPath(string $path): string# | ||||
| private | assetUrl(string $relative): string# | ||||
| private | icon(string $paths): string# | ||||
| private | gridIcon(): string# | ||||
| private | menuItem(string $href, string $icon, string $title, string $sub = '', string $meta = ''): string# |
Nothing matches.