references:joomla.framework:html:jbuttonstandard-fetchbuttonTable of Contents
fetchButton
Returns the HTML code for the button. The button will include a <div> cell whose class is determined by the fetchIconClass method called with $name as its parameter. There are classes defined for certain values of $name in the standard administrator template. See the list of icon classes for more details. If this class is used in the frontend, the appropriate class should be defined and any images used should be included. The resulting button will call the Javascript submitbutton function with the $task parameter as its parameter. If the $list parameter is true, the code will ensure that there is an item selected in the list by checking to ensure that the document.adminForm.boxchecked variable is not equal to zero. If the $hide parameter is true, the main menu will be hidden before the submitbutton function is called. Syntaxvoid fetchButton ( $type, $name, $text, $task, $list, $hideMenu )
ExamplesExample $bar =& new JToolBar( 'My ToolBar' ); $button =& $bar->loadButtonType( 'Standard' ); echo $button->fetchButton( 'Standard', 'save', 'Save', 'save', true, true ); might produce: Result <a onclick="javascript:if(document.adminForm.boxchecked.value==0){alert('Please make a selection from the list to Save');}else{hideMainMenu();submitbutton('save')}" class="toolbar"> <div class="icon-32-save" title="Save" type="Standard"> </div> Save </a>
When this button is displayed, it looks like: Discussion |



