Sat, 04 July 2009
Home
Articles
Books
Search
Tools
Whois
Links
Sitemap
Contact us
Privacy policy
Home arrow Articles arrow Mambo arrow Mambo Component Tutorial

Mambo Component Tutorial PDF Print E-mail
Articles - Mambo
Article Index
Mambo Component Tutorial
Frontend files
Administration files
Class files
Installation files
Appendix A. mosMenuBar
Appendix B. getPath
Appendix A. mosMenuBar
Here is a list of functions available to display toolbar buttons. These functions belong to mosMenubar class. Common parameters for these functions are:
$task: The task to perform
$alt: The alt text for the icon

Usage example: <?php
// Open a table that contains the buttons
mosMenuBar::startTable();

// Add a button with task 'add_category'
mosMenubar::addNew('add_category');

mosMenuBar::endTable();
?>

Functions that end with 'List' (e.g. publishList) are meant for a list of records on the current page. Usually this is a list of checkboxes where you need to select at least 1 record. These functions will do some checking to make sure that at least 1 record is selected.

Image Function
  startTable()
Writes the start of the button bar table
(custom) custom($task = '', $icon = '', $iconOver = '', $alt = '', $listSelect = true)
Writes a custom options & task button for the button bar Parameters: $icon: The image to display (path relative to 'image' folder in the current directory) $iconOver: The image to display when moused over $listSelect: True if required to check that a standard list item is checked
New addNew($task = 'new', $alt = 'New')
Text: New
Publish publish($task = 'publish', $alt = 'Publish')
Text: Publish
Publish publishList($task = 'publish', $alt = 'Publish')
Text: Publish
Default makeDefault($task = 'default', $alt = 'Default')
Text: Default
Assign assign($task = 'assign', $alt = 'Assign')
Text: Assign
Unpublish unpublish($task = 'unpublish', $alt = 'Unpublish')
Text: Unpublish
Unpublish unpublishList($task = 'unpublish', $alt = 'Unpublish')
Text: Unpublish
Archive archiveList($task = 'archive', $alt = 'Archive')
Text: Archive
Unarchive unarchiveList($task = 'unarchive', $alt = 'Unarchive')
Text: Unarchive
Edit editList($task = 'edit', $alt = 'Edit')
Text: Edit
Edit HTML editHtml($task = 'edit_source', $alt = 'Edit HTML')
Text: Edit HTML
Edit CSS editCss($task = 'edit_css', $alt = 'Edit CSS')
Text: Edit CSS
Delete deleteList($msg = '', $task = 'remove', $alt = 'Delete')
Parameter:
$msg: Postscript for the 'are you sure' message
Text: Delete
Trash trash($task = 'remove', $alt = 'Trash')
Write a trash button that will move items to Trash Manager
Text: Trash
Preview preview($popup = '', $updateEditors = false)
Writes a preview button for a given option (opens a popup window)
Parameters:
$popup: The name of the popup file (excluding the file extension). This variable will be used in JavaScript's window.open() as follows:
window.open('popups/t=', 'win1', 'status= no,toolbar=no, scrollbars=yes, titlebar=no, menubar=no, resizable=yes, width=640, height=480, directories=no, location=no'); Text: Preview
Help help($ref)
Writes a button to open help page from $mosConfig_live_site/help/$ref.xml Parameters:
$ref: help page file name (without extension)
Text: Help
Save save($task = 'save', $alt = 'Save')
Text: (use $alt value)
Cancel cancel($task = 'cancel', $alt = 'Cancel')
Writes a cancel button and invokes a cancel operation
Text: (use $alt value)
Back back() Writes a cancel button that will go back to the previous page without doing any other operation
Text: Back
Upload media_manager($directory = '')
Parameters:
$directory: The sub-directory to upload the media to
Text: Upload
divider()
Write a divider between menu buttons
  spacer($width = '')
Writes a spacer cell
  endTable()
Writes the end of the menu bar table


 

Powered by
Syndicate