Toolbar
ToolBar handler
since |
1.5 |
---|---|
package |
Joomla CMS |
Methods
__call
Magic method proxy.
__call( name, mixed||string|int args) : \Joomla\CMS\Toolbar\ToolbarButton
throws |
|
---|---|
since |
4.0.0 |
Arguments
- name
string
The method name.- args
array<string|int, mixed>
The method arguments.
Response
__construct
Constructor
__construct( name = 'toolbar', \Joomla\CMS\Toolbar\ToolbarFactoryInterface factory = null) :
since |
1.5 |
---|
Arguments
- name
string
The toolbar name.- factory
ToolbarFactoryInterface
The toolbar factory.
Response
mixed
addButtonPath
Add a directory where Toolbar should search for button types in LIFO order.
addButtonPath( path) :
You may either pass a string or an array of directories.
Toolbar will be searching for an element type in the same order you added them. If the parameter type cannot be found in the custom folders, it will look in libraries/joomla/html/toolbar/button.
since |
1.5 |
---|---|
deprecated |
4.0 will be removed in 6.0 ToolbarButton classes should be autoloaded via namespaces |
Arguments
- path
mixed
Directory or directories to search.
Response
void
addNew
Writes the common 'new' icon for the button bar.
addNew( task, text = 'JTOOLBAR_NEW') : \Joomla\CMS\Toolbar\Button\StandardButton
since |
4.0.0 |
---|
Arguments
- task
string
The task name of this button.- text
string
The text of this button.
Response
appendButton
Append a button to toolbar.
appendButton(\Joomla\CMS\Toolbar\ToolbarButton button, mixed||string|int args) : \Joomla\CMS\Toolbar\ToolbarButton|bool
since |
1.5 |
---|
Arguments
- button
ToolbarButton
The button instance.- args
array<string|int, mixed>
The more arguments.
Response
ToolbarButton|bool
Return button instance to help chaining configure. If using legacy arguments
returns true
apply
Writes a save button for a given option.
apply( task, text = 'JTOOLBAR_APPLY') : \Joomla\CMS\Toolbar\Button\StandardButton
Apply operation leads to a save action only (does not leave edit mode).
since |
4.0.0 |
---|
Arguments
- task
string
The task name of this button.- text
string
The text of this button.
Response
archive
Writes a common 'archive' button.
archive( task, text = 'JTOOLBAR_ARCHIVE') : \Joomla\CMS\Toolbar\Button\StandardButton
since |
4.0.0 |
---|
Arguments
- task
string
The task name of this button.- text
string
The text of this button.
Response
assign
Writes a common 'assign' button for a record.
assign( task, text = 'JTOOLBAR_ASSIGN') : \Joomla\CMS\Toolbar\Button\StandardButton
since |
4.0.0 |
---|
Arguments
- task
string
The task name of this button.- text
string
The text of this button.
Response
back
Writes a cancel button that will go back to the previous page without doing any other operation.
back( text = 'JTOOLBAR_BACK') : \Joomla\CMS\Toolbar\Button\LinkButton
basicButton
basicButton( name = '', text = '', task = '') : \Joomla\CMS\Toolbar\Button\BasicButton
cancel
Writes a cancel button and invokes a cancel operation (eg a checkin).
cancel( task, text = 'JTOOLBAR_CLOSE') : \Joomla\CMS\Toolbar\Button\StandardButton
since |
4.0.0 |
---|
Arguments
- task
string
The task name of this button.- text
string
The text of this button.
Response
checkin
Writes a checkin button for a given option.
checkin( task, text = 'JTOOLBAR_CHECKIN') : \Joomla\CMS\Toolbar\Button\StandardButton
since |
4.0.0 |
---|
Arguments
- task
string
The task name of this button.- text
string
The text of this button.
Response
confirmButton
confirmButton( name = '', text = '', task = '') : \Joomla\CMS\Toolbar\Button\ConfirmButton
createChild
Create child toolbar.
createChild( name) :
since |
4.0.0 |
---|
Arguments
- name
string
The toolbar name.
Response
static
customButton
customButton( name = '', text = '', task = '') : \Joomla\CMS\Toolbar\Button\CustomButton
customHtml
Writes a custom HTML to toolbar.
customHtml( html, name = 'custom') : \Joomla\CMS\Toolbar\Button\CustomButton
since |
4.0.0 |
---|
Arguments
- html
string
The HTML string to write.- name
string
The button name.
Response
delete
Writes a common 'delete' button.
delete( task, text = 'JTOOLBAR_DELETE') : \Joomla\CMS\Toolbar\Button\ConfirmButton
since |
4.0.0 |
---|
Arguments
- task
string
The task name of this button.- text
string
The text of this button.
Response
divider
Writes a divider between dropdown menu items.
divider( text = '') : \Joomla\CMS\Toolbar\Button\SeparatorButton
dropdownButton
dropdownButton( name = '', text = '', task = '') : \Joomla\CMS\Toolbar\Button\DropdownButton
edit
Writes a common 'edit' button.
edit( task, text = 'JTOOLBAR_EDIT') : \Joomla\CMS\Toolbar\Button\StandardButton
since |
4.0.0 |
---|
Arguments
- task
string
The task name of this button.- text
string
The text of this button.
Response
editCss
Writes a common 'editCss' button.
editCss( task, text = 'JTOOLBAR_EDIT_CSS') : \Joomla\CMS\Toolbar\Button\StandardButton
since |
4.0.0 |
---|
Arguments
- task
string
The task name of this button.- text
string
The text of this button.
Response
editHtml
Writes a common 'editHtml' button.
editHtml( task, text = 'JTOOLBAR_EDIT_HTML') : \Joomla\CMS\Toolbar\Button\StandardButton
since |
4.0.0 |
---|
Arguments
- task
string
The task name of this button.- text
string
The text of this button.
Response
getButtonPath
Get the lookup paths for button objects
getButtonPath() : mixed||string|int
since |
4.0.0 |
---|---|
deprecated |
4.0 will be removed in 6.0 ToolbarButton buttons should be autoloaded via namespaces |
Response
array<string|int, mixed>
getInstance
Returns the global Toolbar object, only creating it if it doesn't already exist.
getInstance( name = 'toolbar') : \Joomla\CMS\Toolbar\Toolbar
since |
1.5 |
---|---|
deprecated |
4.0 will be removed in 6.0 Use the ToolbarFactoryInterface instead Example: Factory::getContainer()->get(ToolbarFactoryInterface::class)->createToolbar($name) |
todo |
Needs a proper replacement before removal as ToolbarFactoryInterface alone does not share the object everywhere |
throws |
|
Arguments
- name
string
The name of the toolbar.
Response
Toolbar
The Toolbar object.
getItems
Get the list of toolbar links.
getItems() : mixed||string|int
since |
1.6 |
---|
Response
array<string|int, mixed>
getName
Get the name of the toolbar.
getName() :
since |
1.6 |
---|
Response
string
help
Writes a help button for a given option (opens a popup window).
help( ref, useComponent = false, url = null, component = null) : \Joomla\CMS\Toolbar\Button\HelpButton
since |
4.0.0 |
---|
Arguments
- ref
string
The name of the popup file (excluding the file extension for an xml file).- useComponent
bool
Use the help file in the component directory.- url
string
Use this URL instead of any other.- component
string
Name of component to get Help (null for current component)
Response
helpButton
helpButton( name = '', text = '', task = '') : \Joomla\CMS\Toolbar\Button\HelpButton
inlinehelp
Writes a help button for a given option (opens a popup window).
inlinehelp( class = 'hide-aware-inline-help') : \Joomla\CMS\Toolbar\Button\InlinehelpButton
since |
4.3.0 |
---|
Arguments
- class
string
The class used by the inline help items.
Response
inlinehelpButton
inlinehelpButton( name = '', text = '', task = '') : \Joomla\CMS\Toolbar\Button\InlinehelpButton
jooa11y
Writes a jooa11y accessibility checker button for a given option (opens a popup window).
jooa11y( url, text = 'JGLOBAL_JOOA11Y', newWindow = false) : \Joomla\CMS\Toolbar\Button\PopupButton|\Joomla\CMS\Toolbar\Button\LinkButton
since |
4.1.0 |
---|
Arguments
- url
string
The url to open- text
string
The text of button.- newWindow
bool
Whether to open the preview in _blank or just a modal
Response
link
Creates a button to redirect to a link.
link( text, url) : \Joomla\CMS\Toolbar\Button\LinkButton
linkButton
linkButton( name = '', text = '', task = '') : \Joomla\CMS\Toolbar\Button\LinkButton
loadButtonType
Loads a button type.
loadButtonType( type, new = false) : false|\Joomla\CMS\Toolbar\ToolbarButton
makeDefault
Writes a common 'default' button for a record.
makeDefault( task, text = 'JTOOLBAR_DEFAULT') : \Joomla\CMS\Toolbar\Button\StandardButton
since |
4.0.0 |
---|
Arguments
- task
string
An override for the task.- text
string
An override for the alt text.
Response
mediaManager
Writes a media_manager button.
mediaManager( directory, text = 'JTOOLBAR_UPLOAD') : \Joomla\CMS\Toolbar\Button\PopupButton
since |
4.0.0 |
---|
Arguments
- directory
string
The subdirectory to upload the media to.- text
string
An override for the alt text.
Response
popupButton
popupButton( name = '', text = '', task = '') : \Joomla\CMS\Toolbar\Button\PopupButton
preferences
Writes a configuration button and invokes a cancel operation (eg a checkin).
preferences( component, text = 'JTOOLBAR_OPTIONS', path = '') : \Joomla\CMS\Toolbar\Button\LinkButton
since |
4.0.0 |
---|
Arguments
- component
string
The name of the component, eg, com_content.- text
string
The text of this button.- path
string
An alternative path for the configuration xml relative to JPATH_SITE.
Response
prependButton
Prepend a button to toolbar.
prependButton(\Joomla\CMS\Toolbar\ToolbarButton button, mixed||string|int args) : \Joomla\CMS\Toolbar\ToolbarButton|bool
since |
1.5 |
---|
Arguments
- button
ToolbarButton
The button instance.- args
array<string|int, mixed>
The more arguments.
Response
ToolbarButton|bool
Return button instance to help chaining configure. If using legacy arguments
returns true
preview
Writes a preview button for a given option (opens a popup window).
preview( url, text = 'JGLOBAL_PREVIEW', newWindow = false) : \Joomla\CMS\Toolbar\Button\PopupButton|\Joomla\CMS\Toolbar\Button\LinkButton
since |
4.0.0 |
---|
Arguments
- url
string
The name of the popup file (excluding the file extension)- text
string
The text of button.- newWindow
bool
Whether to open the preview in _blank or just a modal
Response
publish
Writes a common 'publish' button.
publish( task, text = 'JTOOLBAR_PUBLISH') : \Joomla\CMS\Toolbar\Button\StandardButton
since |
4.0.0 |
---|
Arguments
- task
string
The task name of this button.- text
string
The text of this button.
Response
render
Render a toolbar.
render(mixed||string|int options = []) :
throws |
|
---|---|
since |
1.5 |
Arguments
- options
array<string|int, mixed>
The options of toolbar.
Response
string
HTML for the toolbar.
renderButton
Render a button.
renderButton(mixed||string|int &node) :
since |
1.5 |
---|---|
throws |
|
Arguments
- node
array<string|int, mixed>
A toolbar node.
Response
string
save
Writes a save button for a given option.
save( task, text = 'JTOOLBAR_SAVE') : \Joomla\CMS\Toolbar\Button\StandardButton
Save operation leads to a save and then close action.
since |
4.0.0 |
---|
Arguments
- task
string
The task name of this button.- text
string
The text of this button.
Response
save2copy
Writes a save as copy button for a given option.
save2copy( task, text = 'JTOOLBAR_SAVE_AS_COPY') : \Joomla\CMS\Toolbar\Button\StandardButton
Save as copy operation leads to a save after clearing the key, then returns user to edit mode with new key.
since |
4.0.0 |
---|
Arguments
- task
string
The task name of this button.- text
string
The text of this button.
Response
save2new
Writes a save and create new button for a given option.
save2new( task, text = 'JTOOLBAR_SAVE_AND_NEW') : \Joomla\CMS\Toolbar\Button\StandardButton
Save and create operation leads to a save and then add action.
since |
4.0.0 |
---|
Arguments
- task
string
The task name of this button.- text
string
The text of this button.
Response
separatorButton
separatorButton( name = '', text = '', task = '') : \Joomla\CMS\Toolbar\Button\SeparatorButton
setFactory
Set the factory instance
setFactory(\Joomla\CMS\Toolbar\ToolbarFactoryInterface factory) :
setItems
Set the button list.
setItems(\Joomla\CMS\Toolbar\ToolbarButton||string|int items) :
standardButton
standardButton( name = '', text = '', task = '') : \Joomla\CMS\Toolbar\Button\StandardButton
trash
Writes a common 'trash' button.
trash( task, text = 'JTOOLBAR_TRASH') : \Joomla\CMS\Toolbar\Button\StandardButton
since |
4.0.0 |
---|
Arguments
- task
string
The task name of this button.- text
string
The text of this button.
Response
unarchive
Writes a common 'unarchive' button.
unarchive( task, text = 'JTOOLBAR_UNARCHIVE') : \Joomla\CMS\Toolbar\Button\StandardButton
since |
4.0.0 |
---|
Arguments
- task
string
The task name of this button.- text
string
The text of this button.
Response
unpublish
Writes a common 'unpublish' button.
unpublish( task, text = 'JTOOLBAR_UNPUBLISH') : \Joomla\CMS\Toolbar\Button\StandardButton
since |
4.0.0 |
---|
Arguments
- task
string
The task name of this button.- text
string
The text of this button.
Response
versions
Writes a version history
versions( typeAlias, itemId, height = 800, width = 500, text = 'JTOOLBAR_VERSIONS') : \Joomla\CMS\Toolbar\Button\CustomButton
since |
4.0.0 |
---|
Arguments
- typeAlias
string
The component and type, for example 'com_content.article'- itemId
int
The id of the item, for example the article id.- height
int
The height of the popup.- width
int
The width of the popup.- text
string
The name of the button.
Response
Properties
_name
Toolbar name
since |
1.5 |
---|
Type(s)
string
_bar
Toolbar array
since |
1.5 |
---|
Type(s)
array<string|int, mixed>
_buttonPath
Directories, where button types can be stored.
since |
1.5 |
---|
Type(s)
array<string|int, mixed>
instances
Stores the singleton instances of various toolbar.