NotificationTypeFormTrait
Add/edit form of a notification type.
The skeleton comes from BasePresenter::createForm(), the multilingual
fields and conversions from AdminFormHelpersTrait.
Translated: name. Untranslated: key, active (the header toggle). moduleId was not edited by
the legacy form, so it keeps its default on a new record.
Table of Contents
Methods
- createComponentEditForm() : Form
- prepareAdminPageOptions() : array<int, string>
- Returns target admin page options as `page_id => "Title (presenter:action)"`.
- saveNotificationTypeForm() : bool
- setNotificationTypeFormDefaults() : void
Methods
createComponentEditForm()
protected
createComponentEditForm() : Form
Return values
FormprepareAdminPageOptions()
Returns target admin page options as `page_id => "Title (presenter:action)"`.
private
prepareAdminPageOptions() : array<int, string>
IMPORTANT: only pages with the edit action are offered. The page code list does not know
whether an action takes an id parameter and the notification always appends id to the link,
so for :…:del the notification would become a delete link. The filter is a safeguard, not cleanup.
The title comes from the page translation (as in the admin suggest); without a translation only the target stays, so the row remains recognizable.
Return values
array<int, string>saveNotificationTypeForm()
private
saveNotificationTypeForm(ArrayHash<string|int, mixed> $values) : bool
Parameters
- $values : ArrayHash<string|int, mixed>
Return values
boolsetNotificationTypeFormDefaults()
private
setNotificationTypeFormDefaults(Form $form) : void
Parameters
- $form : Form