Back to Joomla project (class list)

Class CoreButtonsTrait - list of methods

Enhance Toolbar class to add more pre-defined methods.
Package: Joomla\CMS\Toolbar
Copyright: (C) 2018 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/Toolbar/CoreButtonsTrait.php
Project: Joomla

Method Summary

public \Joomla\CMS\Toolbar\Button\SeparatorButton
(string $text = '')

Writes a divider between dropdown menu items.
Parameters
  • string $text The text of button.
Returns
  • \Joomla\CMS\Toolbar\Button\SeparatorButton
Since
  • 4.0.0
Show source code of this method: divider Source Code

public \Joomla\CMS\Toolbar\Button\PopupButton|\Joomla\CMS\Toolbar\Button\LinkButton
(string $url, string $text = 'JGLOBAL_PREVIEW', mixed $newWindow = false)

Writes a preview button for a given option (opens a popup window).
Parameters
  • string $url The name of the popup file (excluding the file extension)
  • string $text The text of button.
  • bool $newWindow Whether to open the preview in _blank or just a modal
Returns
  • \Joomla\CMS\Toolbar\Button\PopupButton|\Joomla\CMS\Toolbar\Button\LinkButton
Since
  • 4.0.0
Show source code of this method: preview Source Code

public \Joomla\CMS\Toolbar\Button\PopupButton|\Joomla\CMS\Toolbar\Button\LinkButton
(string $url, string $text = 'JGLOBAL_JOOA11Y', mixed $newWindow = false)

Writes a jooa11y accessibility checker button for a given option (opens a popup window).
Parameters
  • string $url The url to open
  • string $text The text of button.
  • bool $newWindow Whether to open the preview in _blank or just a modal
Returns
  • \Joomla\CMS\Toolbar\Button\PopupButton|\Joomla\CMS\Toolbar\Button\LinkButton
Since
  • 4.1.0
Show source code of this method: jooa11y Source Code

public \Joomla\CMS\Toolbar\Button\HelpButton
(mixed $ref, mixed $useComponent = false, mixed $url = null, mixed $component = null)

Writes a help button for a given option (opens a popup window).
Parameters
  • string $ref The name of the popup file (excluding the file extension for an xml file).
  • bool $useComponent Use the help file in the component directory.
  • string $url Use this URL instead of any other.
  • string $component Name of component to get Help (null for current component)
Returns
  • \Joomla\CMS\Toolbar\Button\HelpButton
Since
  • 4.0.0
Show source code of this method: help Source Code

public \Joomla\CMS\Toolbar\Button\LinkButton
(string $text = 'JTOOLBAR_BACK')

Writes a cancel button that will go back to the previous page without doing any other operation.
Parameters
  • string $text The text of button.
Returns
  • \Joomla\CMS\Toolbar\Button\LinkButton
Since
  • 4.0.0
Show source code of this method: back Source Code

public \Joomla\CMS\Toolbar\Button\LinkButton
(string $text, string $url)

Creates a button to redirect to a link.
Parameters
  • string $text Button text.
  • string $url The link url.
Returns
  • \Joomla\CMS\Toolbar\Button\LinkButton
Since
  • 4.0.0
Show source code of this method: link Source Code

public \Joomla\CMS\Toolbar\Button\PopupButton
(string $directory, string $text = 'JTOOLBAR_UPLOAD')

Writes a media_manager button.
Parameters
  • string $directory The subdirectory to upload the media to.
  • string $text An override for the alt text.
Returns
  • \Joomla\CMS\Toolbar\Button\PopupButton
Since
  • 4.0.0
Show source code of this method: mediaManager Source Code

public \Joomla\CMS\Toolbar\Button\StandardButton
(string $task, string $text = 'JTOOLBAR_DEFAULT')

Writes a common 'default' button for a record.
Parameters
  • string $task An override for the task.
  • string $text An override for the alt text.
Returns
  • \Joomla\CMS\Toolbar\Button\StandardButton
Since
  • 4.0.0
Show source code of this method: makeDefault Source Code

public \Joomla\CMS\Toolbar\Button\StandardButton
(string $task, string $text = 'JTOOLBAR_ASSIGN')

Writes a common 'assign' button for a record.
Parameters
  • string $task The task name of this button.
  • string $text The text of this button.
Returns
  • \Joomla\CMS\Toolbar\Button\StandardButton
Since
  • 4.0.0
Show source code of this method: assign Source Code

public \Joomla\CMS\Toolbar\Button\StandardButton
(string $task, string $text = 'JTOOLBAR_NEW')

Writes the common 'new' icon for the button bar.
Parameters
  • string $task The task name of this button.
  • string $text The text of this button.
Returns
  • \Joomla\CMS\Toolbar\Button\StandardButton
Since
  • 4.0.0
Show source code of this method: addNew Source Code

public \Joomla\CMS\Toolbar\Button\StandardButton
(string $task, string $text = 'JTOOLBAR_PUBLISH')

Writes a common 'publish' button.
Parameters
  • string $task The task name of this button.
  • string $text The text of this button.
Returns
  • \Joomla\CMS\Toolbar\Button\StandardButton
Since
  • 4.0.0
Show source code of this method: publish Source Code

public \Joomla\CMS\Toolbar\Button\StandardButton
(string $task, string $text = 'JTOOLBAR_UNPUBLISH')

Writes a common 'unpublish' button.
Parameters
  • string $task The task name of this button.
  • string $text The text of this button.
Returns
  • \Joomla\CMS\Toolbar\Button\StandardButton
Since
  • 4.0.0
Show source code of this method: unpublish Source Code

public \Joomla\CMS\Toolbar\Button\StandardButton
(string $task, string $text = 'JTOOLBAR_ARCHIVE')

Writes a common 'archive' button.
Parameters
  • string $task The task name of this button.
  • string $text The text of this button.
Returns
  • \Joomla\CMS\Toolbar\Button\StandardButton
Since
  • 4.0.0
Show source code of this method: archive Source Code

public \Joomla\CMS\Toolbar\Button\StandardButton
(string $task, string $text = 'JTOOLBAR_UNARCHIVE')

Writes a common 'unarchive' button.
Parameters
  • string $task The task name of this button.
  • string $text The text of this button.
Returns
  • \Joomla\CMS\Toolbar\Button\StandardButton
Since
  • 4.0.0
Show source code of this method: unarchive Source Code

public \Joomla\CMS\Toolbar\Button\StandardButton
(string $task, string $text = 'JTOOLBAR_EDIT')

Writes a common 'edit' button.
Parameters
  • string $task The task name of this button.
  • string $text The text of this button.
Returns
  • \Joomla\CMS\Toolbar\Button\StandardButton
Since
  • 4.0.0
Show source code of this method: edit Source Code

public \Joomla\CMS\Toolbar\Button\StandardButton
(string $task, string $text = 'JTOOLBAR_EDIT_HTML')

Writes a common 'editHtml' button.
Parameters
  • string $task The task name of this button.
  • string $text The text of this button.
Returns
  • \Joomla\CMS\Toolbar\Button\StandardButton
Since
  • 4.0.0
Show source code of this method: editHtml Source Code

public \Joomla\CMS\Toolbar\Button\StandardButton
(string $task, string $text = 'JTOOLBAR_EDIT_CSS')

Writes a common 'editCss' button.
Parameters
  • string $task The task name of this button.
  • string $text The text of this button.
Returns
  • \Joomla\CMS\Toolbar\Button\StandardButton
Since
  • 4.0.0
Show source code of this method: editCss Source Code

public \Joomla\CMS\Toolbar\Button\ConfirmButton
(string $task, string $text = 'JTOOLBAR_DELETE')

Writes a common 'delete' button.
Parameters
  • string $task The task name of this button.
  • string $text The text of this button.
Returns
  • \Joomla\CMS\Toolbar\Button\ConfirmButton
Since
  • 4.0.0
Show source code of this method: delete Source Code

public \Joomla\CMS\Toolbar\Button\StandardButton
(string $task, string $text = 'JTOOLBAR_TRASH')

Writes a common 'trash' button.
Parameters
  • string $task The task name of this button.
  • string $text The text of this button.
Returns
  • \Joomla\CMS\Toolbar\Button\StandardButton
Since
  • 4.0.0
Show source code of this method: trash Source Code

public \Joomla\CMS\Toolbar\Button\StandardButton
(string $task, string $text = 'JTOOLBAR_APPLY')

Writes a save button for a given option.
Parameters
  • string $task The task name of this button.
  • string $text The text of this button.
Returns
  • \Joomla\CMS\Toolbar\Button\StandardButton
Since
  • 4.0.0
Show source code of this method: apply Source Code

public \Joomla\CMS\Toolbar\Button\StandardButton
(string $task, string $text = 'JTOOLBAR_SAVE')

Writes a save button for a given option.
Parameters
  • string $task The task name of this button.
  • string $text The text of this button.
Returns
  • \Joomla\CMS\Toolbar\Button\StandardButton
Since
  • 4.0.0
Show source code of this method: save Source Code

public \Joomla\CMS\Toolbar\Button\StandardButton
(string $task, string $text = 'JTOOLBAR_SAVE_AND_NEW')

Writes a save and create new button for a given option.
Parameters
  • string $task The task name of this button.
  • string $text The text of this button.
Returns
  • \Joomla\CMS\Toolbar\Button\StandardButton
Since
  • 4.0.0
Show source code of this method: save2new Source Code

public \Joomla\CMS\Toolbar\Button\StandardButton
(string $task, string $text = 'JTOOLBAR_SAVE_AS_COPY')

Writes a save as copy button for a given option.
Parameters
  • string $task The task name of this button.
  • string $text The text of this button.
Returns
  • \Joomla\CMS\Toolbar\Button\StandardButton
Since
  • 4.0.0
Show source code of this method: save2copy Source Code

public \Joomla\CMS\Toolbar\Button\StandardButton
(string $task, string $text = 'JTOOLBAR_CHECKIN')

Writes a checkin button for a given option.
Parameters
  • string $task The task name of this button.
  • string $text The text of this button.
Returns
  • \Joomla\CMS\Toolbar\Button\StandardButton
Since
  • 4.0.0
Show source code of this method: checkin Source Code

public \Joomla\CMS\Toolbar\Button\StandardButton
(string $task, string $text = 'JTOOLBAR_CLOSE')

Writes a cancel button and invokes a cancel operation (eg a checkin).
Parameters
  • string $task The task name of this button.
  • string $text The text of this button.
Returns
  • \Joomla\CMS\Toolbar\Button\StandardButton
Since
  • 4.0.0
Show source code of this method: cancel Source Code

public \Joomla\CMS\Toolbar\Button\LinkButton
(string $component, string $text = 'JTOOLBAR_OPTIONS', string $path = '')

Writes a configuration button and invokes a cancel operation (eg a checkin).
Parameters
  • string $component The name of the component, eg, com_content.
  • string $text The text of this button.
  • string $path An alternative path for the configuration xml relative to JPATH_SITE.
Returns
  • \Joomla\CMS\Toolbar\Button\LinkButton
Since
  • 4.0.0
Show source code of this method: preferences Source Code

public \Joomla\CMS\Toolbar\Button\CustomButton
(string $typeAlias, int $itemId, int $height = 800, int $width = 500, string $text = 'JTOOLBAR_VERSIONS')

Writes a version history
Parameters
  • string $typeAlias The component and type, for example 'com_content.article'
  • int $itemId The id of the item, for example the article id.
  • int $height The height of the popup.
  • int $width The width of the popup.
  • string $text The name of the button.
Returns
  • \Joomla\CMS\Toolbar\Button\CustomButton
Since
  • 4.0.0
Show source code of this method: versions Source Code

public \Joomla\CMS\Toolbar\Button\CustomButton
(string $html, string $name = 'custom')

Writes a custom HTML to toolbar.
Parameters
  • string $html The HTML string to write.
  • string $name The button name.
Returns
  • \Joomla\CMS\Toolbar\Button\CustomButton
Since
  • 4.0.0
Show source code of this method: customHtml Source Code

Tags Summary

Since
4.0.0