ChildrenPagesWidget
extends Widget
in package
Shows a list of pages that are related to this one
Table of Contents
Properties
- $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
Methods
- cleanupSettings() : void
- Run after import of settings, allows extending widgets to clean up settings which may have bad values for some reason
- getDefaultSettings() : mixed
- Returns the default settings for the widget
- getEditUrl() : mixed
- This function should return a URL which can be used to edit the *content* which is displayed by this widget.
- getFriendlyDesc() : mixed
- Gets the english name of this widget
- getFriendlyName() : mixed
- Gets the english name of this widget
- getInfoLabels() : mixed
- This function should return a summary of what this widget's *content* is.
- 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
- This function should return the content of the widget settings form.
- 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
Properties
$default_settings
Array of default settings for new widgets
protected
mixed
$default_settings
= []
$friendly_desc
A description, for display in the admin
protected
mixed
$friendly_desc
= 'An list of the children pages as a textual list'
$friendly_name
The friendly name, for display in the admin
protected
mixed
$friendly_name
= "Children pages"
$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
= []
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
getDefaultSettings()
Returns the default settings for the widget
public
final getDefaultSettings() : mixed
getEditUrl()
This function should return a URL which can be used to edit the *content* which is displayed by this widget.
public
getEditUrl() : mixed
Most widgets show content using a category selection box; the URL should in that case direct the user to the contents list for that category.
Return NULL if there isn't an appropriate URL to use.
getFriendlyDesc()
Gets the english name of this widget
public
getFriendlyDesc() : mixed
getFriendlyName()
Gets the english name of this widget
public
getFriendlyName() : mixed
getInfoLabels()
This function should return a summary of what this widget's *content* is.
public
getInfoLabels() : mixed
Don't specify the widget name; we already know that!
Most widgets show content using a category selection box; in that case the most useful thing is probably the category name, perhaps also the order and limit.
Return NULL if there isn't an appropriate label to use.
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()
This function should return the content of the widget settings form.
public
getSettingsForm() : string
The content should be returned as well-formed HTML. The content will be contained within a DIV element, which is inside a FORM element.
This function will be called from an AJAX request, so Needs cannot be used. Inline CSS and Javascript should be loaded correctly by the jQuery library.
Form fields must be generated using the Form helper, to ensure correct field prefix as well as reloading of field values
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)