Table of Contents Previous Next

Sugar Developer Guide

Version 5.1


Chapter 4 Customizing Sugar : User Interface Customizations : Custom Buttons

Custom Buttons
By default, the metadata framework provides default implementations for CANCEL, DELETE, DUPLICATE, EDIT, FIND DUPLICATES and SAVE buttons. However, you may wish to use some of the default buttons, but add additional buttons. Here's an example:
'templateMeta' => array('form' =>
array('buttons'=>array('EDIT', 'DUPLICATE', 'DELETE',
array('customCode'=>
'<form action="index.php" method="POST" name="Quote2Opp" id="form">
<input title="{$APP.LBL_QUOTE_TO_OPPORTUNITY_TITLE}"
accessKey="{$APP.LBL_QUOTE_TO_OPPORTUNITY_KEY}"
class="button"type="submit"
name="opp_to_quote_button"
value="{$APP.LBL_QUOTE_TO_OPPORTUNITY_LABEL}">
</form>'
),

Here we are adding a custom button with the label defined in the Smarty variable
{$APP.LBL_QUOTE_TO_OPPORTUNITY_LABEL}. The EDIT, DUPLICATE and DELETE buttons are rendered and then the snippet of code in this 'customCode' block is added.
The code to render the buttons specified in the metadata files may be found in include/Smarty/function.sugar_button.php.

Table of Contents Previous Next

Copyright 2004-2008 SugarCRM Inc.
Product License