CoolCMS API

GalleryPickerTrait

Article gallery picker: a multiplier row selects a `Gallery`.

The label is the translated title in the current language. Plain many-to-many without an order. Offers a suggester and a modal with the show grid :Admin:Blog:Gallery. Requires $this->galleryManager.

Table of Contents

Methods

addGalleryControls()  : void
galleryPicker()  : PickerConfig
galleryName()  : string
Gallery title in the current language (falls back to the first non-empty one).
resolveGalleryLabel()  : string|null
suggestGalleries()  : array<int, array{id: int, label: string}>

Methods

addGalleryControls()

protected addGalleryControls(Container $parent[, string $targetField = 'galleryId' ][, string $displayField = 'gallery' ]) : void
Parameters
$parent : Container
$targetField : string = 'galleryId'
$displayField : string = 'gallery'

galleryPicker()

protected galleryPicker([string $formName = 'editForm' ][, string|null $container = 'galleries' ][, string $targetField = 'galleryId' ][, string $displayField = 'gallery' ]) : PickerConfig
Parameters
$formName : string = 'editForm'
$container : string|null = 'galleries'
$targetField : string = 'galleryId'
$displayField : string = 'gallery'
Return values
PickerConfig

galleryName()

Gallery title in the current language (falls back to the first non-empty one).

private galleryName(Gallery $gallery) : string
Parameters
$gallery : Gallery
Return values
string

resolveGalleryLabel()

private resolveGalleryLabel(int $id) : string|null
Parameters
$id : int
Return values
string|null

suggestGalleries()

private suggestGalleries(string $query) : array<int, array{id: int, label: string}>
Parameters
$query : string
Return values
array<int, array{id: int, label: string}>
On this page

Search results