|
pix_icon | $actionicon |
| An icon to use for the toggling the secondary menu (dropdown).
|
|
array | $actionlabel = null |
| The string to use for the accessible label for the menu.
|
|
array | $actiontext = null |
| The string to use next to the icon for the action icon relating to the secondary (dropdown) menu.
|
|
array | $attributes = [] |
| An array of attributes added to the container of the action menu.
|
|
array | $attributesprimary = [] |
| An array of attributes added to the container of the primary actions.
|
|
array | $attributessecondary = [] |
| An array of attributes added to the container of the secondary actions.
|
|
string | $dropdownalignment = '' |
| Dropdown menu alignment class.
|
|
string | $menutrigger = '' |
| Any text to use for the toggling the secondary menu (dropdown).
|
|
bool | $prioritise = false |
| Place the action menu before all other actions.
|
|
array | $triggerattributes = [] |
| An array of attributes added to the trigger element of the secondary menu.
|
|
string | $triggerextraclasses = '' |
| Any extra classes for toggling to the secondary menu.
|
|
const | BL = 3 |
| Top right alignment.
|
|
const | BR = 4 |
| Top right alignment.
|
|
const | DEFAULT_KEBAB_TRIGGER_CLASSES = 'btn btn-icon d-flex no-caret' |
| Classes for the trigger menu.
|
|
const | TL = 1 |
| Top right alignment.
|
|
const | TR = 2 |
| Top right alignment.
|
|
- Copyright
- 2013 Sam Hemelryk
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
core\output\action_menu::__construct |
( |
array | $actions = [] | ) |
|
Constructs the action menu with the given items.
- Parameters
-
array | $actions | An array of actions (action_menu_link|pix_icon|string). |
◆ add()
core\output\action_menu::add |
( |
| $action | ) |
|
Adds an action to this action menu.
- Parameters
-
action_link | pix_icon | subpanel | string | $action | |
◆ add_primary_action()
core\output\action_menu::add_primary_action |
( |
| $action | ) |
|
Adds a primary action to the action menu.
- Parameters
-
action_menu_link | action_link | pix_icon | string | $action | |
◆ add_secondary_action()
core\output\action_menu::add_secondary_action |
( |
| $action | ) |
|
Adds a secondary action to the action menu.
- Parameters
-
action_link | pix_icon | string | $action | |
◆ add_secondary_subpanel()
core\output\action_menu::add_secondary_subpanel |
( |
subpanel | $subpanel | ) |
|
Adds a secondary subpanel.
- Parameters
-
◆ do_not_enhance()
core\output\action_menu::do_not_enhance |
( |
| ) |
|
◆ export_for_template()
core\output\action_menu::export_for_template |
( |
renderer_base | $output | ) |
|
Export for template.
- Parameters
-
renderer_base | $output | The renderer. |
- Return values
-
Implements core\output\templatable.
◆ export_primary_actions_for_template()
core\output\action_menu::export_primary_actions_for_template |
( |
renderer_base | $output | ) |
|
|
protected |
Export the primary actions for the template.
- Parameters
-
- Return values
-
◆ export_secondary_actions_for_template()
core\output\action_menu::export_secondary_actions_for_template |
( |
renderer_base | $output | ) |
|
|
protected |
Export the secondary actions for the template.
- Parameters
-
- Return values
-
◆ get_align_string()
core\output\action_menu::get_align_string |
( |
| $align | ) |
|
|
protected |
Returns a string to describe the alignment.
- Parameters
-
int | $align | One of action_menu::TL, action_menu::TR, action_menu::BL, action_menu::BR. |
- Return values
-
◆ get_primary_actions()
core\output\action_menu::get_primary_actions |
( |
?core_renderer | $output = null | ) |
|
Returns the primary actions ready to be rendered.
- Parameters
-
null | core_renderer | $output | The renderer to use for getting icons. |
- Return values
-
◆ get_secondary_actions()
core\output\action_menu::get_secondary_actions |
( |
| ) |
|
Returns the secondary actions ready to be rendered.
- Return values
-
◆ initialise_js()
core\output\action_menu::initialise_js |
( |
moodle_page | $page | ) |
|
Initialises JS required fore the action menu.
The JS is only required once as it manages all action menu's on the page.
- Parameters
-
◆ is_empty()
core\output\action_menu::is_empty |
( |
| ) |
|
Return true if there is at least one visible link in the menu.
- Return values
-
◆ set_action_label()
core\output\action_menu::set_action_label |
( |
| $label | ) |
|
Sets the label for the menu trigger.
- Parameters
-
◆ set_additional_classes()
core\output\action_menu::set_additional_classes |
( |
string | $class = '' | ) |
|
Add classes to the action menu for an easier styling.
- Parameters
-
string | $class | The class to add to attributes. |
◆ set_alignment()
core\output\action_menu::set_alignment |
( |
| ) |
|
◆ set_boundary()
core\output\action_menu::set_boundary |
( |
string | $boundary | ) |
|
◆ set_constraint()
core\output\action_menu::set_constraint |
( |
| ) |
|
◆ set_kebab_trigger()
core\output\action_menu::set_kebab_trigger |
( |
?string | $triggername = null, |
|
|
?core_renderer | $output = null, |
|
|
?string | $extraclasses = '' ) |
Setup trigger as in the kebab menu.
- Parameters
-
string | null | $triggername | |
core_renderer | null | $output | |
string | null | $extraclasses | extra classes for the trigger { |
- See also
- self::set_menu_trigger()}
- Exceptions
-
◆ set_menu_trigger()
core\output\action_menu::set_menu_trigger |
( |
| $trigger, |
|
|
| $extraclasses = '' ) |
Sets the menu trigger text.
- Parameters
-
string | $trigger | The text |
string | $extraclasses | Extra classes to style the secondary menu toggle. |
◆ set_nowrap_on_items()
core\output\action_menu::set_nowrap_on_items |
( |
| $value = true | ) |
|
Sets nowrap on items.
If true menu items should not wrap lines if they are longer than the available space.
This property can be useful when the action menu is displayed within a parent element that is either floated or relatively positioned. In that situation the width of the menu is determined by the width of the parent element which may not be large enough for the menu items without them wrapping. This disables the wrapping so that the menu takes on the width of the longest item.
- Parameters
-
bool | $value | If true nowrap gets set, if false it gets removed. Defaults to true. |
◆ set_owner_selector()
core\output\action_menu::set_owner_selector |
( |
| $selector | ) |
|
Sets the selector that should be used to find the owning node of this menu.
- Parameters
-
string | $selector | A CSS/YUI selector to identify the owner of the menu. |
◆ will_be_enhanced()
core\output\action_menu::will_be_enhanced |
( |
| ) |
|
Returns true if this action menu will be enhanced.
- Return values
-
◆ $attributes
array core\output\action_menu::$attributes = [] |
An array of attributes added to the container of the action menu.
Initialised with defaults during construction.
◆ $attributesprimary
array core\output\action_menu::$attributesprimary = [] |
An array of attributes added to the container of the primary actions.
Initialised with defaults during construction.
◆ $attributessecondary
array core\output\action_menu::$attributessecondary = [] |
An array of attributes added to the container of the secondary actions.
Initialised with defaults during construction.
◆ $instance
int core\output\action_menu::$instance = 0 |
|
protected |
The instance number.
This is unique to this instance of the action menu.
◆ $primaryactions
array core\output\action_menu::$primaryactions = [] |
|
protected |
An array of primary actions.
Please use {
- See also
- action_menu::add_primary_action()} to add actions.
◆ $secondaryactions
array core\output\action_menu::$secondaryactions = [] |
|
protected |
An array of secondary actions.
Please use {
- See also
- action_menu::add_secondary_action()} to add actions.
The documentation for this class was generated from the following file:
- lib/classes/output/action_menu.php