CoreButtonsTrait

Enhance Toolbar class to add more pre-defined methods.

since

4.0.0

package

Application

Methods

addNew

Writes the common 'new' icon for the button bar.

addNew(string task, string 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

\Joomla\CMS\Toolbar\Button\StandardButton

apply

Writes a save button for a given option.

apply(string task, string 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

\Joomla\CMS\Toolbar\Button\StandardButton

archive

Writes a common 'archive' button.

archive(string task, string 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

\Joomla\CMS\Toolbar\Button\StandardButton

assign

Writes a common 'assign' button for a record.

assign(string task, string 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

\Joomla\CMS\Toolbar\Button\StandardButton

back

Writes a cancel button that will go back to the previous page without doing any other operation.

back(string text = 'JTOOLBAR_BACK') : \Joomla\CMS\Toolbar\Button\LinkButton
since

4.0.0

Arguments

text

stringThe text of button.

Response

\Joomla\CMS\Toolbar\Button\LinkButton

cancel

Writes a cancel button and invokes a cancel operation (eg a checkin).

cancel(string task, string 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

\Joomla\CMS\Toolbar\Button\StandardButton

checkin

Writes a checkin button for a given option.

checkin(string task, string 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

\Joomla\CMS\Toolbar\Button\StandardButton

customHtml

Writes a custom HTML to toolbar.

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

4.0.0

Arguments

html

stringThe HTML string to write.

name

stringThe button name.

Response

\Joomla\CMS\Toolbar\Button\CustomButton

delete

Writes a common 'delete' button.

delete(string task, string 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

\Joomla\CMS\Toolbar\Button\ConfirmButton

divider

Writes a divider between dropdown menu items.

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

4.0.0

Arguments

text

stringThe text of button.

Response

\Joomla\CMS\Toolbar\Button\SeparatorButton

edit

Writes a common 'edit' button.

edit(string task, string 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

\Joomla\CMS\Toolbar\Button\StandardButton

editCss

Writes a common 'editCss' button.

editCss(string task, string 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

\Joomla\CMS\Toolbar\Button\StandardButton

editHtml

Writes a common 'editHtml' button.

editHtml(string task, string 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

\Joomla\CMS\Toolbar\Button\StandardButton

help

Writes a help button for a given option (opens a popup window).

help(string ref, bool useComponent = false, string url = null, string 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

\Joomla\CMS\Toolbar\Button\HelpButton

jooa11y

Writes a jooa11y accessibility checker button for a given option (opens a popup window).

jooa11y(string url, string text = 'JGLOBAL_JOOA11Y', bool 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

\Joomla\CMS\Toolbar\Button\PopupButton|\Joomla\CMS\Toolbar\Button\LinkButton

makeDefault

Writes a common 'default' button for a record.

makeDefault(string task, string 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

\Joomla\CMS\Toolbar\Button\StandardButton

mediaManager

Writes a media_manager button.

mediaManager(string directory, string 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

\Joomla\CMS\Toolbar\Button\PopupButton

preferences

Writes a configuration button and invokes a cancel operation (eg a checkin).

preferences(string component, string text = 'JTOOLBAR_OPTIONS', string 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

\Joomla\CMS\Toolbar\Button\LinkButton

preview

Writes a preview button for a given option (opens a popup window).

preview(string url, string text = 'JGLOBAL_PREVIEW', bool 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

\Joomla\CMS\Toolbar\Button\PopupButton|\Joomla\CMS\Toolbar\Button\LinkButton

publish

Writes a common 'publish' button.

publish(string task, string 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

\Joomla\CMS\Toolbar\Button\StandardButton

save

Writes a save button for a given option.

save(string task, string 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

\Joomla\CMS\Toolbar\Button\StandardButton

save2copy

Writes a save as copy button for a given option.

save2copy(string task, string 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

\Joomla\CMS\Toolbar\Button\StandardButton

save2new

Writes a save and create new button for a given option.

save2new(string task, string 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

\Joomla\CMS\Toolbar\Button\StandardButton

trash

Writes a common 'trash' button.

trash(string task, string 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

\Joomla\CMS\Toolbar\Button\StandardButton

unarchive

Writes a common 'unarchive' button.

unarchive(string task, string 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

\Joomla\CMS\Toolbar\Button\StandardButton

unpublish

Writes a common 'unpublish' button.

unpublish(string task, string 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

\Joomla\CMS\Toolbar\Button\StandardButton

versions

Writes a version history

versions(string typeAlias, int itemId, int height = 800, int width = 500, string 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

\Joomla\CMS\Toolbar\Button\CustomButton