CoreButtonsTrait

Enhance Toolbar class to add more pre-defined methods.

since

4.0.0

package

Joomla CMS

Methods

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

stringThe task name of this button.

text

stringThe text of this button.

Response

StandardButton

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

stringThe task name of this button.

text

stringThe text of this button.

Response

StandardButton

archive

Writes a common 'archive' button.

archive( task,  text = 'JTOOLBAR_ARCHIVE') : \Joomla\CMS\Toolbar\Button\StandardButton
since

4.0.0

Arguments

task

stringThe task name of this button.

text

stringThe text of this button.

Response

StandardButton

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

stringThe task name of this button.

text

stringThe text of this button.

Response

StandardButton

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
since

4.0.0

Arguments

text

stringThe text of button.

Response

LinkButton

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

stringThe task name of this button.

text

stringThe text of this button.

Response

StandardButton

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

stringThe task name of this button.

text

stringThe text of this button.

Response

StandardButton

customHtml

Writes a custom HTML to toolbar.

customHtml( html,  name = 'custom') : \Joomla\CMS\Toolbar\Button\CustomButton
since

4.0.0

Arguments

html

stringThe HTML string to write.

name

stringThe button name.

Response

CustomButton

delete

Writes a common 'delete' button.

delete( task,  text = 'JTOOLBAR_DELETE') : \Joomla\CMS\Toolbar\Button\ConfirmButton
since

4.0.0

Arguments

task

stringThe task name of this button.

text

stringThe text of this button.

Response

ConfirmButton

divider

Writes a divider between dropdown menu items.

divider( text = '') : \Joomla\CMS\Toolbar\Button\SeparatorButton
since

4.0.0

Arguments

text

stringThe text of button.

Response

SeparatorButton

edit

Writes a common 'edit' button.

edit( task,  text = 'JTOOLBAR_EDIT') : \Joomla\CMS\Toolbar\Button\StandardButton
since

4.0.0

Arguments

task

stringThe task name of this button.

text

stringThe text of this button.

Response

StandardButton

editCss

Writes a common 'editCss' button.

editCss( task,  text = 'JTOOLBAR_EDIT_CSS') : \Joomla\CMS\Toolbar\Button\StandardButton
since

4.0.0

Arguments

task

stringThe task name of this button.

text

stringThe text of this button.

Response

StandardButton

editHtml

Writes a common 'editHtml' button.

editHtml( task,  text = 'JTOOLBAR_EDIT_HTML') : \Joomla\CMS\Toolbar\Button\StandardButton
since

4.0.0

Arguments

task

stringThe task name of this button.

text

stringThe text of this button.

Response

StandardButton

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

stringThe name of the popup file (excluding the file extension for an xml file).

useComponent

boolUse the help file in the component directory.

url

stringUse this URL instead of any other.

component

stringName of component to get Help (null for current component)

Response

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

stringThe class used by the inline help items.

Response

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

stringThe url to open

text

stringThe text of button.

newWindow

boolWhether to open the preview in _blank or just a modal

Response

PopupButton|LinkButton

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

stringAn override for the task.

text

stringAn override for the alt text.

Response

StandardButton

mediaManager

Writes a media_manager button.

mediaManager( directory,  text = 'JTOOLBAR_UPLOAD') : \Joomla\CMS\Toolbar\Button\PopupButton
since

4.0.0

Arguments

directory

stringThe subdirectory to upload the media to.

text

stringAn override for the alt text.

Response

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

stringThe name of the component, eg, com_content.

text

stringThe text of this button.

path

stringAn alternative path for the configuration xml relative to JPATH_SITE.

Response

LinkButton

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

stringThe name of the popup file (excluding the file extension)

text

stringThe text of button.

newWindow

boolWhether to open the preview in _blank or just a modal

Response

PopupButton|LinkButton

publish

Writes a common 'publish' button.

publish( task,  text = 'JTOOLBAR_PUBLISH') : \Joomla\CMS\Toolbar\Button\StandardButton
since

4.0.0

Arguments

task

stringThe task name of this button.

text

stringThe text of this button.

Response

StandardButton

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

stringThe task name of this button.

text

stringThe text of this button.

Response

StandardButton

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

stringThe task name of this button.

text

stringThe text of this button.

Response

StandardButton

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

stringThe task name of this button.

text

stringThe text of this button.

Response

StandardButton

trash

Writes a common 'trash' button.

trash( task,  text = 'JTOOLBAR_TRASH') : \Joomla\CMS\Toolbar\Button\StandardButton
since

4.0.0

Arguments

task

stringThe task name of this button.

text

stringThe text of this button.

Response

StandardButton

unarchive

Writes a common 'unarchive' button.

unarchive( task,  text = 'JTOOLBAR_UNARCHIVE') : \Joomla\CMS\Toolbar\Button\StandardButton
since

4.0.0

Arguments

task

stringThe task name of this button.

text

stringThe text of this button.

Response

StandardButton

unpublish

Writes a common 'unpublish' button.

unpublish( task,  text = 'JTOOLBAR_UNPUBLISH') : \Joomla\CMS\Toolbar\Button\StandardButton
since

4.0.0

Arguments

task

stringThe task name of this button.

text

stringThe text of this button.

Response

StandardButton

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

stringThe component and type, for example 'com_content.article'

itemId

intThe id of the item, for example the article id.

height

intThe height of the popup.

width

intThe width of the popup.

text

stringThe name of the button.

Response

CustomButton