Backend\Classes\RichEditorManager
Overview
RichEditorManager manages named toolbar definitions for the rich editor. Definitions are seeded by plugins via the registerRichEditorToolbars registration method, stored as editor toolbar records and managed in the editor settings area.
Protected Properties
protected array|null $seedDefinitions
seedDefinitions registered in code, keyed by code
protected array|null $toolbarRows
toolbarRows stored in the database, keyed by code
Public Methods
public getDefaultButtons()
public getDefaultButtons(): string|null
getDefaultButtons returns the default toolbar only when it differs from the seeded definition, a null return means the client-side registry defaults apply
public getSeedDefinitions()
public getSeedDefinitions(): array
getSeedDefinitions returns definitions registered in code, keyed by code, each with label, description, buttons and owner keys, definitions without buttons inherit the default toolbar
public getToolbarButtons()
public getToolbarButtons($code): string|null
getToolbarButtons returns the resolved button list for a definition code, where stored records take precedence over seeded definitions, and empty definitions inherit the default toolbar
public static instance()
public static instance(): static
instance creates a new instance of this singleton
public resetCache()
public resetCache(): void
resetCache clears the collected definitions and records
public syncToolbars()
public syncToolbars(): void
syncToolbars creates missing toolbar records from the seeded definitions, migrating the legacy default toolbar setting when found
Protected Methods
protected getBuiltInDefinitions()
protected getBuiltInDefinitions(): array
getBuiltInDefinitions seeds the default, minimal and full definitions
protected getToolbarRows()
protected getToolbarRows(): array
getToolbarRows returns the stored button lists, keyed by code
protected normalizeButtons()
protected normalizeButtons($buttons): string
normalizeButtons cleans a button list to a comma separated string