]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - include/Smarty/plugins/function.sugar_run_helper.php
Release 6.5.0
[Github/sugarcrm.git] / include / Smarty / plugins / function.sugar_run_helper.php
1 <?php
2
3 /*
4
5 Modification information for LGPL compliance
6
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
8
9 r56989 - 2010-06-16 13:01:33 -0700 (Wed, 16 Jun 2010) - kjing - defunt "Mango" svn dev branch before github cutover
10
11 r56153 - 2010-04-28 15:37:27 -0700 (Wed, 28 Apr 2010) - asandberg - Bug #35808 - Tab ordering for fields is inconsistent specifically for the "Email Address" and "Teams" fields
12 Modified SugarFieldBase file, displayFromFunc function to propagate the tabindex down the call stack and the email address widget to utilize the value
13
14 r55980 - 2010-04-19 13:31:28 -0700 (Mon, 19 Apr 2010) - kjing - create Mango (6.1) based on windex
15
16 r54415 - 2010-02-10 07:58:39 -0800 (Wed, 10 Feb 2010) - jmertic - Bug 35628 - Fixed SQL error showing when importing into a currency field. Also fixes unit test failure of properly rendering the currency field widget.
17
18 r54369 - 2010-02-08 16:33:57 -0800 (Mon, 08 Feb 2010) - rob - Bug 35453: Add support for vardef functions to return various html, bypassing the sugar fields
19
20
21 */
22
23
24 /**
25  * Smarty plugin
26  * @package Smarty
27  * @subpackage plugins
28  */
29
30
31 /**
32  * Smarty {sugar_field} function plugin
33  *
34  * Type:     function
35  * Name:     sugar_run_helper
36  * Purpose:  Runs helper functions as defined in the vardef for specific fields
37  * 
38  * @author Rob Aagaard {rob at sugarcrm.com}
39  * @param array
40  * @param Smarty
41  */
42
43 function smarty_function_sugar_run_helper($params, &$smarty)
44 {
45     $error = false;
46     
47     if(!isset($params['func'])) {
48         $error = true;
49         $smarty->trigger_error("sugar_field: missing 'func' parameter");
50     }
51     if(!isset($params['displayType'])) {
52         $error = true;
53         $smarty->trigger_error("sugar_field: missing 'displayType' parameter");
54     }
55     if(!isset($params['bean'])) {
56         $params['bean'] = $GLOBALS['focus'];
57     }
58
59     if ( $error ) {
60         return;
61     }
62
63     $funcName = $params['func'];
64
65     if ( !empty($params['include']) ) {
66         require_once($params['include']);
67     }
68
69     $_contents = $funcName($params['bean'],$params['field'],$params['value'],$params['displayType'],$params['tabindex']);
70     return $_contents;
71 }
72 ?>