Skip to content

Extension points

phil/content-warnings-bundle

What an application configures, implements, replaces or listens to. The catalogue, warnings, preferences and decisions are phil/content-warnings's.

The catalogue

PointHow
The themes and categoriesbase_catalogue, catalogue_files and catalogue — see Configuration
The languages of labelsThe labels of the definitions; fallback_locales
Reading the catalogueThe service Phil\ContentWarnings\Catalogue, and CatalogueLabels for labels in the current locale

Preferences

PointHow
Where preferences are keptAn implementation of WarningPreferencesStore, named by preferences_store — see Preferences
The display for a reader who chose nothingdefault_display
Deciding in codeWarningScreen::decide() for the current reader, or WarningMatcher of the library for another

Storage and forms

PointHow
Where warnings are keptThe column type phil_content_warnings — see Doctrine
Picking warningsContentWarningsType and its options; a severity or a note through the application's own fields
Choosing preferencesWarningPreferencesType and its options
LabelsThe phil_content_warnings translation domain: an application's translations override the shipped ones
More than the fields doA form type extension of the application's on ContentWarningsType or WarningPreferencesType

Display

PointHow
The markup@PhilContentWarnings/fold.html.twig overridden in templates/bundles/PhilContentWarningsBundle/, or the application's own from content_warnings_decision
The form theme@PhilContentWarnings/form/theme.html.twig; a theme of the application's listed after it overrides its block
Behaviour on revealphil--content-warnings-bundle--reveal dispatches revealed and concealed, and offers reveal and conceal
The lookassets/styles/content-warnings.css, its classes phil-content-warning*

Other tools

A safety tool reads the same catalogue and preferences: Catalogue::themes() and categories() for the themes, and a reader's WarningPreferences::themesWith(Display::Hide) and themesWith(Display::Fold) for lines and veils.