CoolCMS API

EditResponsesTrait

"Responses to the advert" section of the edit page.

Lists the responses to the edited advert and shows the detail of one response in a modal window (ModalWindow) without leaving the page.

Tags
requires

EditAdvertFormTrait: shares $advert; renderEdit() calls prepareEditResponses()

Table of Contents

Constants

responseDetailModalTarget  : mixed = 'responseDetailModal'
Unique key of the response detail modal in `ModalRegistry`.

Properties

$eventDispatcher  : EventDispatcher
$modalRegistry  : ModalRegistry
$responseManager  : ResponseManager

Methods

handleShowResponseDetailModal()  : void
Handles the signal that shows the response detail in a modal window.
prepareEditResponses()  : void
Prepares the data of the responses tab; `renderEdit()` calls it only when the tab is active.
buildResponseDetailContent()  : string
Builds the response detail HTML (a partial rendered to a string) for the modal content.
buildResponseDetailError()  : string
showResponseDetailModal()  : void
Registers the response detail modal and tells the container to show it.

Constants

responseDetailModalTarget

Unique key of the response detail modal in `ModalRegistry`.

private mixed responseDetailModalTarget = 'responseDetailModal'

Properties

Methods

handleShowResponseDetailModal()

Handles the signal that shows the response detail in a modal window.

public handleShowResponseDetailModal(int $responseId) : void

Loads the response, verifies that it belongs to the edited advert, marks it as read and sends the rendered detail to ModalWindow.

Parameters
$responseId : int

prepareEditResponses()

Prepares the data of the responses tab; `renderEdit()` calls it only when the tab is active.

protected prepareEditResponses() : void

buildResponseDetailContent()

Builds the response detail HTML (a partial rendered to a string) for the modal content.

private buildResponseDetailContent(Response $response, object|null $currency) : string
Parameters
$response : Response
$currency : object|null
Return values
string

buildResponseDetailError()

private buildResponseDetailError() : string
Return values
string

showResponseDetailModal()

Registers the response detail modal and tells the container to show it.

private showResponseDetailModal(string $content[, int|null $responseId = null ]) : void
Parameters
$content : string
$responseId : int|null = null
On this page

Search results