|
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 = array() |
| An array of attributes added to the container of the action menu. More...
|
|
array | $attributesprimary = array() |
| An array of attributes added to the container of the primary actions. More...
|
|
array | $attributessecondary = array() |
| An array of attributes added to the container of the secondary actions. More...
|
|
string | $menutrigger = '' |
| Any text to use for the toggling the secondary menu (dropdown).
|
|
bool | $prioritise = false |
| Place the action menu before all other actions.
|
|
string | $triggerextraclasses = '' |
| Any extra classes for toggling to the secondary menu.
|
|
const | BL = 3 |
| Top right alignment.
|
|
const | BR = 4 |
| Top right alignment.
|
|
const | TL = 1 |
| Top right alignment.
|
|
const | TR = 2 |
| Top right alignment.
|
|
◆ __construct()
action_menu::__construct |
( |
array |
$actions = array() | ) |
|
Constructs the action menu with the given items.
- Parameters
-
array | $actions | An array of actions (action_menu_link|pix_icon|string). |
◆ add()
action_menu::add |
( |
|
$action | ) |
|
Adds an action to this action menu.
- Parameters
-
◆ add_primary_action()
action_menu::add_primary_action |
( |
|
$action | ) |
|
Adds a primary action to the action menu.
- Parameters
-
◆ add_secondary_action()
action_menu::add_secondary_action |
( |
|
$action | ) |
|
Adds a secondary action to the action menu.
- Parameters
-
◆ do_not_enhance()
action_menu::do_not_enhance |
( |
| ) |
|
If you call this method the action menu will be displayed but will not be enhanced.
By not displaying the menu enhanced all items will be displayed in a single row.
- Deprecated:
- since Moodle 3.2
◆ export_for_template()
Export for template.
- Parameters
-
- Return values
-
Implements templatable.
◆ get_align_string()
action_menu::get_align_string |
( |
|
$align | ) |
|
|
protected |
Returns a string to describe the alignment.
- Parameters
-
- Return values
-
◆ get_primary_actions()
Returns the primary actions ready to be rendered.
- Parameters
-
- Return values
-
◆ get_secondary_actions()
action_menu::get_secondary_actions |
( |
| ) |
|
Returns the secondary actions ready to be rendered.
- Return values
-
◆ initialise_js()
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()
action_menu::is_empty |
( |
| ) |
|
Return true if there is at least one visible link in the menu.
- Return values
-
◆ set_action_label()
action_menu::set_action_label |
( |
|
$label | ) |
|
Sets the label for the menu trigger.
- Parameters
-
◆ set_alignment()
action_menu::set_alignment |
( |
|
$dialogue, |
|
|
|
$button |
|
) |
| |
Sets the alignment of the dialogue in relation to button used to toggle it.
- Parameters
-
◆ set_constraint()
action_menu::set_constraint |
( |
|
$ancestorselector | ) |
|
Sets a constraint for the dialogue.
The constraint is applied when the dialogue is shown and limits the display of the dialogue to within the element the constraint identifies.
This is required whenever the action menu is displayed inside any CSS element with the .no-overflow class (flexible_table and any of it's child classes are a likely candidate).
- Parameters
-
string | $ancestorselector | A snippet of CSS used to identify the ancestor to contrain the dialogue to. |
◆ set_menu_trigger()
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()
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()
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()
action_menu::will_be_enhanced |
( |
| ) |
|
Returns true if this action menu will be enhanced.
- Return values
-
◆ $attributes
array action_menu::$attributes = array() |
An array of attributes added to the container of the action menu.
Initialised with defaults during construction.
◆ $attributesprimary
array action_menu::$attributesprimary = array() |
An array of attributes added to the container of the primary actions.
Initialised with defaults during construction.
◆ $attributessecondary
array action_menu::$attributessecondary = array() |
An array of attributes added to the container of the secondary actions.
Initialised with defaults during construction.
◆ $instance
int action_menu::$instance = 0 |
|
protected |
The instance number.
This is unique to this instance of the action menu.
◆ $primaryactions
array action_menu::$primaryactions = array() |
|
protected |
◆ $secondaryactions
array action_menu::$secondaryactions = array() |
|
protected |
The documentation for this class was generated from the following file: