5 Modification information for LGPL compliance
7 r56990 - 2010-06-16 13:05:36 -0700 (Wed, 16 Jun 2010) - kjing - snapshot "Mango" svn branch to a new one for GitHub sync
9 r56989 - 2010-06-16 13:01:33 -0700 (Wed, 16 Jun 2010) - kjing - defunt "Mango" svn dev branch before github cutover
11 r55980 - 2010-04-19 13:31:28 -0700 (Mon, 19 Apr 2010) - kjing - create Mango (6.1) based on windex
13 r53409 - 2010-01-03 19:31:15 -0800 (Sun, 03 Jan 2010) - roger - merge -r50376:HEAD from fuji_newtag_tmp
27 * Smarty {sugar_fetch} function plugin
30 * Name: sugar_fetch<br>
31 * Purpose: grabs the requested index from either an object or an array
33 * @author Rob Aagaard {rob at sugarcrm.com}
38 function smarty_function_sugar_fetch($params, &$smarty)
40 if(empty($params['key'])) {
41 $smarty->trigger_error("sugar_fetch: missing 'key' parameter");
44 if(empty($params['object'])) {
45 $smarty->trigger_error("sugar_fetch: missing 'object' parameter");
49 $theKey = $params['key'];
50 if(is_object($params['object'])) {
51 $theData = $params['object']->$theKey;
53 $theData = $params['object'][$theKey];
56 if(!empty($params['assign'])) {
57 $smarty->assign($params['assign'],$theData);