class ToolbarHelper

Utility class for the button bar.

Methods

static  void
title( string $title, string $icon = 'generic.png')

Title cell.

static  void
spacer( string $width = '')

Writes a spacer cell.

static  void
divider()

Writes a divider between menu buttons

static  void
custom( string $task = '', string $icon = '', string $iconOver = '', string $alt = '', bool $listSelect = true)

Writes a custom option and task button for the button bar.

static  void
preview( string $url = '', bool $updateEditors = false)

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

static  void
help( string $ref, bool $com = false, string $override = null, string $component = null)

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

static  void
back( string $alt = 'JTOOLBAR_BACK', string $href = 'javascript:history.back();')

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

static  void
link( string $url, string $text, string $name = 'link')

Creates a button to redirect to a link

static  void
media_manager( string $directory = '', string $alt = 'JTOOLBAR_UPLOAD')

Writes a media_manager button.

static  void
makeDefault( string $task = 'default', string $alt = 'JTOOLBAR_DEFAULT')

Writes a common 'default' button for a record.

static  void
assign( string $task = 'assign', string $alt = 'JTOOLBAR_ASSIGN')

Writes a common 'assign' button for a record.

static  void
addNew( string $task = 'add', string $alt = 'JTOOLBAR_NEW', boolean $check = false)

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

static  void
publish( string $task = 'publish', string $alt = 'JTOOLBAR_PUBLISH', boolean $check = false)

Writes a common 'publish' button.

static  void
publishList( string $task = 'publish', string $alt = 'JTOOLBAR_PUBLISH')

Writes a common 'publish' button for a list of records.

static  void
unpublish( string $task = 'unpublish', string $alt = 'JTOOLBAR_UNPUBLISH', boolean $check = false)

Writes a common 'unpublish' button.

static  void
unpublishList( string $task = 'unpublish', string $alt = 'JTOOLBAR_UNPUBLISH')

Writes a common 'unpublish' button for a list of records.

static  void
archiveList( string $task = 'archive', string $alt = 'JTOOLBAR_ARCHIVE')

Writes a common 'archive' button for a list of records.

static  void
unarchiveList( string $task = 'unarchive', string $alt = 'JTOOLBAR_UNARCHIVE')

Writes an unarchive button for a list of records.

static  void
editList( string $task = 'edit', string $alt = 'JTOOLBAR_EDIT')

Writes a common 'edit' button for a list of records.

static  void
editHtml( string $task = 'edit_source', string $alt = 'JTOOLBAR_EDIT_HTML')

Writes a common 'edit' button for a template html.

static  void
editCss( string $task = 'edit_css', string $alt = 'JTOOLBAR_EDIT_CSS')

Writes a common 'edit' button for a template css.

static  void
deleteList( string $msg = '', string $task = 'remove', string $alt = 'JTOOLBAR_DELETE')

Writes a common 'delete' button for a list of records.

static  void
trash( string $task = 'remove', string $alt = 'JTOOLBAR_TRASH', bool $check = true)

Writes a common 'trash' button for a list of records.

static  void
apply( string $task = 'apply', string $alt = 'JTOOLBAR_APPLY')

Writes a save button for a given option.

static  void
save( string $task = 'save', string $alt = 'JTOOLBAR_SAVE')

Writes a save button for a given option.

static  void
save2new( string $task = 'save2new', string $alt = 'JTOOLBAR_SAVE_AND_NEW')

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

static  void
save2copy( string $task = 'save2copy', string $alt = 'JTOOLBAR_SAVE_AS_COPY')

Writes a save as copy button for a given option.

static  void
checkin( string $task = 'checkin', string $alt = 'JTOOLBAR_CHECKIN', boolean $check = true)

Writes a checkin button for a given option.

static  void
cancel( string $task = 'cancel', string $alt = 'JTOOLBAR_CANCEL')

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

static  void
preferences( string $component, integer $height = '550', integer $width = '875', string $alt = 'JToolbar_Options', string $path = '')

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

static  void
versions( string $typeAlias, integer $itemId, integer $height = 800, integer $width = 500, string $alt = 'JTOOLBAR_VERSIONS')

Writes a version history

static  void
modal( string $targetModalId, string $icon, string $alt)

Displays a modal button

Details

static void title( string $title, string $icon = 'generic.png')

Title cell.

For the title and toolbar to be rendered correctly, this title function must be called before the starttable function and the toolbars icons this is due to the nature of how the css has been used to position the title in respect to the toolbar.

Parameters

string $title The title.
string $icon The space-separated names of the image.

Return Value

void

static void spacer( string $width = '')

Writes a spacer cell.

Parameters

string $width The width for the cell

Return Value

void

static void divider()

Writes a divider between menu buttons

Return Value

void

static void custom( string $task = '', string $icon = '', string $iconOver = '', string $alt = '', bool $listSelect = true)

Writes a custom option and task button for the button bar.

Parameters

string $task The task to perform (picked up by the switch($task) blocks).
string $icon The image to display.
string $iconOver The image to display when moused over.
string $alt The alt text for the icon image.
bool $listSelect True if required to check that a standard list item is checked.

Return Value

void

static void preview( string $url = '', bool $updateEditors = 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)
bool $updateEditors Unused

Return Value

void

static void help( string $ref, bool $com = false, string $override = null, string $component = null)

Writes a preview 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 $com Use the help file in the component directory.
string $override Use this URL instead of any other
string $component Name of component to get Help (null for current component)

Return Value

void

static void back( string $alt = 'JTOOLBAR_BACK', string $href = 'javascript:history.back();')

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

Parameters

string $alt Alternative text.
string $href URL of the href attribute.

Return Value

void

Creates a button to redirect to a link

Parameters

string $url The link url
string $text Button text
string $name Name to be used as apart of the id

Return Value

void

static void media_manager( string $directory = '', string $alt = 'JTOOLBAR_UPLOAD')

Writes a media_manager button.

Parameters

string $directory The subdirectory to upload the media to.
string $alt An override for the alt text.

Return Value

void

static void makeDefault( string $task = 'default', string $alt = 'JTOOLBAR_DEFAULT')

Writes a common 'default' button for a record.

Parameters

string $task An override for the task.
string $alt An override for the alt text.

Return Value

void

static void assign( string $task = 'assign', string $alt = 'JTOOLBAR_ASSIGN')

Writes a common 'assign' button for a record.

Parameters

string $task An override for the task.
string $alt An override for the alt text.

Return Value

void

static void addNew( string $task = 'add', string $alt = 'JTOOLBAR_NEW', boolean $check = false)

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

Parameters

string $task An override for the task.
string $alt An override for the alt text.
boolean $check True if required to check that a standard list item is checked.

Return Value

void

static void publish( string $task = 'publish', string $alt = 'JTOOLBAR_PUBLISH', boolean $check = false)

Writes a common 'publish' button.

Parameters

string $task An override for the task.
string $alt An override for the alt text.
boolean $check True if required to check that a standard list item is checked.

Return Value

void

static void publishList( string $task = 'publish', string $alt = 'JTOOLBAR_PUBLISH')

Writes a common 'publish' button for a list of records.

Parameters

string $task An override for the task.
string $alt An override for the alt text.

Return Value

void

static void unpublish( string $task = 'unpublish', string $alt = 'JTOOLBAR_UNPUBLISH', boolean $check = false)

Writes a common 'unpublish' button.

Parameters

string $task An override for the task.
string $alt An override for the alt text.
boolean $check True if required to check that a standard list item is checked.

Return Value

void

static void unpublishList( string $task = 'unpublish', string $alt = 'JTOOLBAR_UNPUBLISH')

Writes a common 'unpublish' button for a list of records.

Parameters

string $task An override for the task.
string $alt An override for the alt text.

Return Value

void

static void archiveList( string $task = 'archive', string $alt = 'JTOOLBAR_ARCHIVE')

Writes a common 'archive' button for a list of records.

Parameters

string $task An override for the task.
string $alt An override for the alt text.

Return Value

void

static void unarchiveList( string $task = 'unarchive', string $alt = 'JTOOLBAR_UNARCHIVE')

Writes an unarchive button for a list of records.

Parameters

string $task An override for the task.
string $alt An override for the alt text.

Return Value

void

static void editList( string $task = 'edit', string $alt = 'JTOOLBAR_EDIT')

Writes a common 'edit' button for a list of records.

Parameters

string $task An override for the task.
string $alt An override for the alt text.

Return Value

void

static void editHtml( string $task = 'edit_source', string $alt = 'JTOOLBAR_EDIT_HTML')

Writes a common 'edit' button for a template html.

Parameters

string $task An override for the task.
string $alt An override for the alt text.

Return Value

void

static void editCss( string $task = 'edit_css', string $alt = 'JTOOLBAR_EDIT_CSS')

Writes a common 'edit' button for a template css.

Parameters

string $task An override for the task.
string $alt An override for the alt text.

Return Value

void

static void deleteList( string $msg = '', string $task = 'remove', string $alt = 'JTOOLBAR_DELETE')

Writes a common 'delete' button for a list of records.

Parameters

string $msg Postscript for the 'are you sure' message.
string $task An override for the task.
string $alt An override for the alt text.

Return Value

void

static void trash( string $task = 'remove', string $alt = 'JTOOLBAR_TRASH', bool $check = true)

Writes a common 'trash' button for a list of records.

Parameters

string $task An override for the task.
string $alt An override for the alt text.
bool $check True to allow lists.

Return Value

void

static void apply( string $task = 'apply', string $alt = 'JTOOLBAR_APPLY')

Writes a save button for a given option.

Apply operation leads to a save action only (does not leave edit mode).

Parameters

string $task An override for the task.
string $alt An override for the alt text.

Return Value

void

static void save( string $task = 'save', string $alt = 'JTOOLBAR_SAVE')

Writes a save button for a given option.

Save operation leads to a save and then close action.

Parameters

string $task An override for the task.
string $alt An override for the alt text.

Return Value

void

static void save2new( string $task = 'save2new', string $alt = 'JTOOLBAR_SAVE_AND_NEW')

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

Save and create operation leads to a save and then add action.

Parameters

string $task An override for the task.
string $alt An override for the alt text.

Return Value

void

static void save2copy( string $task = 'save2copy', string $alt = 'JTOOLBAR_SAVE_AS_COPY')

Writes a save as copy button for a given option.

Save as copy operation leads to a save after clearing the key, then returns user to edit mode with new key.

Parameters

string $task An override for the task.
string $alt An override for the alt text.

Return Value

void

static void checkin( string $task = 'checkin', string $alt = 'JTOOLBAR_CHECKIN', boolean $check = true)

Writes a checkin button for a given option.

Parameters

string $task An override for the task.
string $alt An override for the alt text.
boolean $check True if required to check that a standard list item is checked.

Return Value

void

static void cancel( string $task = 'cancel', string $alt = 'JTOOLBAR_CANCEL')

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

Parameters

string $task An override for the task.
string $alt An override for the alt text.

Return Value

void

static void preferences( string $component, integer $height = '550', integer $width = '875', string $alt = '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.
integer $height The height of the popup. [UNUSED]
integer $width The width of the popup. [UNUSED]
string $alt The name of the button.
string $path An alternative path for the configuation xml relative to JPATH_SITE.

Return Value

void

static void versions( string $typeAlias, integer $itemId, integer $height = 800, integer $width = 500, string $alt = 'JTOOLBAR_VERSIONS')

Writes a version history

Parameters

string $typeAlias The component and type, for example 'com_content.article'
integer $itemId The id of the item, for example the article id.
integer $height The height of the popup.
integer $width The width of the popup.
string $alt The name of the button.

Return Value

void

static void modal( string $targetModalId, string $icon, string $alt)

Displays a modal button

Parameters

string $targetModalId ID of the target modal box
string $icon Icon class to show on modal button
string $alt Title for the modal button

Return Value

void