ImageGalleryWidget
extends Widget
in package
Shows a list of pages that are related to this one
Table of Contents
Properties
- $classname : mixed
- $default_settings : mixed
- Array of default settings for new widgets
- $friendly_desc : mixed
- A description, for display in the admin
- $friendly_name : mixed
- The friendly name, for display in the admin
- $heading : mixed
- Optional HTML H2 heading that's rendered on front-end view
- $settings : mixed
- Settings - These get automatically set in the admin and loaded on the front-end
- $crop_opts : mixed
- $display_opts : mixed
- $order_opts : mixed
Methods
- cleanupSettings() : void
- Run after import of settings, allows extending widgets to clean up settings which may have bad values for some reason
- contentReplace() : string
- Registered content replacement for embedded gallery via the editor
- getDefaultSettings() : mixed
- Returns the default settings for the widget
- getEditUrl() : mixed
- Returns a URL for editing the contents of this widget See {@link Widget::getEditUrl} for full documentation
- getFriendlyDesc() : mixed
- Gets the english name of this widget
- getFriendlyName() : mixed
- Gets the english name of this widget
- getInfoLabels() : mixed
- Returns a label which describes the contents of this widget See {@link Widget::get_info_label} for full documentation
- getNotAvailableReason() : mixed
- Is there sufficent content to add this addon at the moment? If this widget is not available, a string message should be returned If this widget *is* available, NULL should be returned.
- getSettings() : array<string|int, mixed>
- Return the currently loaded settings for the widget
- getSettingsForm() : string
- Returns the settings HTML
- getTitle() : mixed
- Returns the title to use for the widget - should not contain HTML
- importSettings() : mixed
- Imports the settings
- render() : string
- Does the front-end rendering of this widget
- setTitle() : void
- Set widget title
- orderSql() : mixed
- Returns the SQL which should be used for ordering the images
- validateSettings() : bool
- Validate and cleanup the settings fields
Properties
$classname
public
mixed
$classname
= 'ImageGallery'
$default_settings
Array of default settings for new widgets
protected
mixed
$default_settings
= ['limit' => 100, 'captions' => 1, 'order' => 1]
$friendly_desc
A description, for display in the admin
protected
mixed
$friendly_desc
= 'A gallery of images from your media repository'
$friendly_name
The friendly name, for display in the admin
protected
mixed
$friendly_name
= "Image Gallery"
$heading
Optional HTML H2 heading that's rendered on front-end view
protected
mixed
$heading
= ''
$settings
Settings - These get automatically set in the admin and loaded on the front-end
protected
mixed
$settings
= []
$crop_opts
private
mixed
$crop_opts
= array('lt' => 'Top left', 'ct' => 'Top center', 'rt' => 'Top right', 'lc' => 'Middle left', 'cc' => 'Middle center', 'rc' => 'Middle right', 'lb' => 'Bottom left', 'cb' => 'Bottom center', 'rb' => 'Bottom right')
$display_opts
private
mixed
$display_opts
= array('grid' => 'Gallery', 'slider' => 'Slider')
$order_opts
private
mixed
$order_opts
= array(1 => 'Date (most recent at top)', 2 => 'Date (oldest at top)', 3 => 'Alphabetical by name', 4 => 'Alphabetical (reverse)', 5 => 'Manual (in category options)', 6 => 'Stable random', 7 => 'True random')
Methods
cleanupSettings()
Run after import of settings, allows extending widgets to clean up settings which may have bad values for some reason
public
cleanupSettings() : void
contentReplace()
Registered content replacement for embedded gallery via the editor
public
static contentReplace(string $html) : string
Parameters
- $html : string
-
HTML content
Return values
string —Modified HTML content
getDefaultSettings()
Returns the default settings for the widget
public
final getDefaultSettings() : mixed
getEditUrl()
Returns a URL for editing the contents of this widget See {@link Widget::getEditUrl} for full documentation
public
getEditUrl() : mixed
getFriendlyDesc()
Gets the english name of this widget
public
getFriendlyDesc() : mixed
getFriendlyName()
Gets the english name of this widget
public
getFriendlyName() : mixed
getInfoLabels()
Returns a label which describes the contents of this widget See {@link Widget::get_info_label} for full documentation
public
getInfoLabels() : mixed
getNotAvailableReason()
Is there sufficent content to add this addon at the moment? If this widget is not available, a string message should be returned If this widget *is* available, NULL should be returned.
public
getNotAvailableReason() : mixed
getSettings()
Return the currently loaded settings for the widget
public
getSettings() : array<string|int, mixed>
Return values
array<string|int, mixed> —The widget settings
getSettingsForm()
Returns the settings HTML
public
getSettingsForm() : string
Return values
string —The output HTML.
getTitle()
Returns the title to use for the widget - should not contain HTML
public
getTitle() : mixed
importSettings()
Imports the settings
public
importSettings(array<string|int, mixed> $settings) : mixed
Parameters
- $settings : array<string|int, mixed>
-
The widget settings
render()
Does the front-end rendering of this widget
public
render(int $orientation) : string
Parameters
- $orientation : int
-
The orientation of the widget
Return values
string —The output HTML.
setTitle()
Set widget title
public
setTitle(string $str) : void
Parameters
- $str : string
-
Widget title (heading)
orderSql()
Returns the SQL which should be used for ordering the images
private
orderSql(string $order) : mixed
Parameters
- $order : string
-
One of the $this->order_opts order types
validateSettings()
Validate and cleanup the settings fields
private
validateSettings() : bool
Return values
bool —True on success false on failure