@@ -100,15 +100,18 @@ discard block |
||
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
103 | - if (!isset($options) && !isset($values)) |
|
104 | - return ''; /* raise error here? */ |
|
103 | + if (!isset($options) && !isset($values)) { |
|
104 | + return ''; |
|
105 | + } |
|
106 | + /* raise error here? */ |
|
105 | 107 | |
106 | 108 | $_html_result = array(); |
107 | 109 | |
108 | 110 | if (isset($options)) { |
109 | 111 | |
110 | - foreach ($options as $_key=>$_val) |
|
111 | - $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids); |
|
112 | + foreach ($options as $_key=>$_val) { |
|
113 | + $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids); |
|
114 | + } |
|
112 | 115 | |
113 | 116 | } else { |
114 | 117 | |
@@ -141,13 +144,17 @@ discard block |
||
141 | 144 | . smarty_function_escape_special_chars($name) . '" value="' |
142 | 145 | . smarty_function_escape_special_chars($value) . '"'; |
143 | 146 | |
144 | - if ($labels && $label_ids) $_output .= ' id="' . $_id . '"'; |
|
147 | + if ($labels && $label_ids) { |
|
148 | + $_output .= ' id="' . $_id . '"'; |
|
149 | + } |
|
145 | 150 | |
146 | 151 | if ((string)$value==$selected) { |
147 | 152 | $_output .= ' checked="checked"'; |
148 | 153 | } |
149 | 154 | $_output .= $extra . ' />' . $output; |
150 | - if ($labels) $_output .= '</label>'; |
|
155 | + if ($labels) { |
|
156 | + $_output .= '</label>'; |
|
157 | + } |
|
151 | 158 | $_output .= $separator; |
152 | 159 | |
153 | 160 | return $_output; |
@@ -54,26 +54,33 @@ |
||
54 | 54 | function smarty_function_sugar_getimage($params, &$smarty) { |
55 | 55 | |
56 | 56 | // error checking for required parameters |
57 | - if(!isset($params['name'])) |
|
58 | - $smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'name'); |
|
57 | + if(!isset($params['name'])) { |
|
58 | + $smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'name'); |
|
59 | + } |
|
59 | 60 | |
60 | 61 | // temp hack to deprecate the use of other_attributes |
61 | - if(isset($params['other_attributes'])) |
|
62 | - $params['attr'] = $params['other_attributes']; |
|
62 | + if(isset($params['other_attributes'])) { |
|
63 | + $params['attr'] = $params['other_attributes']; |
|
64 | + } |
|
63 | 65 | |
64 | 66 | // set defaults |
65 | - if(!isset($params['attr'])) |
|
66 | - $params['attr'] = ''; |
|
67 | - if(!isset($params['width'])) |
|
68 | - $params['width'] = null; |
|
69 | - if(!isset($params['height'])) |
|
70 | - $params['height'] = null; |
|
71 | - if(!isset($params['alt'])) |
|
72 | - $params['alt'] = ''; |
|
67 | + if(!isset($params['attr'])) { |
|
68 | + $params['attr'] = ''; |
|
69 | + } |
|
70 | + if(!isset($params['width'])) { |
|
71 | + $params['width'] = null; |
|
72 | + } |
|
73 | + if(!isset($params['height'])) { |
|
74 | + $params['height'] = null; |
|
75 | + } |
|
76 | + if(!isset($params['alt'])) { |
|
77 | + $params['alt'] = ''; |
|
78 | + } |
|
73 | 79 | |
74 | 80 | // deprecated ? |
75 | - if(!isset($params['ext'])) |
|
76 | - $params['ext'] = null; |
|
81 | + if(!isset($params['ext'])) { |
|
82 | + $params['ext'] = null; |
|
83 | + } |
|
77 | 84 | |
78 | 85 | return SugarThemeRegistry::current()->getImage($params['name'], $params['attr'], $params['width'], $params['height'], $params['ext'], $params['alt']); |
79 | 86 | } |
@@ -60,10 +60,11 @@ |
||
60 | 60 | 'get_source' => false); |
61 | 61 | $smarty->_parse_resource_name($_params); |
62 | 62 | $_file_path = $_params['resource_type'] . ':' . $_params['resource_name']; |
63 | - if (isset($_section)) |
|
64 | - $_compile_file = $smarty->_get_compile_path($_file_path.'|'.$_section); |
|
65 | - else |
|
66 | - $_compile_file = $smarty->_get_compile_path($_file_path); |
|
63 | + if (isset($_section)) { |
|
64 | + $_compile_file = $smarty->_get_compile_path($_file_path.'|'.$_section); |
|
65 | + } else { |
|
66 | + $_compile_file = $smarty->_get_compile_path($_file_path); |
|
67 | + } |
|
67 | 68 | |
68 | 69 | if($smarty->force_compile || !file_exists($_compile_file)) { |
69 | 70 | $_compile = true; |
@@ -47,10 +47,12 @@ discard block |
||
47 | 47 | function smarty_function_sugar_evalcolumn_old($params, &$smarty) |
48 | 48 | { |
49 | 49 | if (!isset($params['var']) || !isset($params['rowData'])) { |
50 | - if(!isset($params['var'])) |
|
51 | - $smarty->trigger_error("evalcolumn: missing 'var' parameter"); |
|
52 | - if(!isset($params['rowData'])) |
|
53 | - $smarty->trigger_error("evalcolumn: missing 'rowData' parameter"); |
|
50 | + if(!isset($params['var'])) { |
|
51 | + $smarty->trigger_error("evalcolumn: missing 'var' parameter"); |
|
52 | + } |
|
53 | + if(!isset($params['rowData'])) { |
|
54 | + $smarty->trigger_error("evalcolumn: missing 'rowData' parameter"); |
|
55 | + } |
|
54 | 56 | return; |
55 | 57 | } |
56 | 58 | |
@@ -62,8 +64,7 @@ discard block |
||
62 | 64 | foreach($params['var'] as $key => $value) { |
63 | 65 | $params['var'][$key] = searchReplace($value, $params['rowData']); |
64 | 66 | } |
65 | - } |
|
66 | - else { |
|
67 | + } else { |
|
67 | 68 | $params['var'] = searchReplace($params['var'], $params['rowData']); |
68 | 69 | } |
69 | 70 | |
@@ -83,10 +84,11 @@ discard block |
||
83 | 84 | preg_match_all('/\{\$(.*)\}/U', $value, $matches); |
84 | 85 | |
85 | 86 | for($wp = 0; $wp < count($matches[0]); $wp++) { |
86 | - if(isset($rowData[$matches[1][$wp]])) |
|
87 | - $value = str_replace($matches[0][$wp], $rowData[$matches[1][$wp]], $value); |
|
88 | - else |
|
89 | - $value = str_replace($matches[0][$wp], '', $value); |
|
87 | + if(isset($rowData[$matches[1][$wp]])) { |
|
88 | + $value = str_replace($matches[0][$wp], $rowData[$matches[1][$wp]], $value); |
|
89 | + } else { |
|
90 | + $value = str_replace($matches[0][$wp], '', $value); |
|
91 | + } |
|
90 | 92 | } |
91 | 93 | return $value; |
92 | 94 | } |
@@ -58,8 +58,9 @@ discard block |
||
58 | 58 | for($i = 0; $i < $count; $i++) { |
59 | 59 | $match = $matches[1][$i]; |
60 | 60 | //List views will have fields be an array where all the keys are upper case and the values are jsut strings |
61 | - if (!isset($fields[$match]) && isset($fields[strtoupper($match)])) |
|
62 | - $match = strtoupper($match); |
|
61 | + if (!isset($fields[$match]) && isset($fields[strtoupper($match)])) { |
|
62 | + $match = strtoupper($match); |
|
63 | + } |
|
63 | 64 | |
64 | 65 | $value = isset($fields[$match]) ? $fields[$match] : null; |
65 | 66 | if (!is_null($value)) { |
@@ -67,8 +68,7 @@ discard block |
||
67 | 68 | { |
68 | 69 | $bean = $smarty->get_template_vars('bean'); |
69 | 70 | $value = $bean->$match; |
70 | - } |
|
71 | - else if (is_array($value) && isset($value['value'])) |
|
71 | + } else if (is_array($value) && isset($value['value'])) |
|
72 | 72 | { |
73 | 73 | $value = $value['value']; |
74 | 74 | } |
@@ -95,16 +95,19 @@ discard block |
||
95 | 95 | } |
96 | 96 | } |
97 | 97 | |
98 | - if (!isset($options) && !isset($values)) |
|
99 | - return ''; /* raise error here? */ |
|
98 | + if (!isset($options) && !isset($values)) { |
|
99 | + return ''; |
|
100 | + } |
|
101 | + /* raise error here? */ |
|
100 | 102 | |
101 | 103 | settype($selected, 'array'); |
102 | 104 | $_html_result = array(); |
103 | 105 | |
104 | 106 | if (isset($options)) { |
105 | 107 | |
106 | - foreach ($options as $_key=>$_val) |
|
107 | - $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels); |
|
108 | + foreach ($options as $_key=>$_val) { |
|
109 | + $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels); |
|
110 | + } |
|
108 | 111 | |
109 | 112 | |
110 | 113 | } else { |
@@ -125,7 +128,9 @@ discard block |
||
125 | 128 | |
126 | 129 | function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels) { |
127 | 130 | $_output = ''; |
128 | - if ($labels) $_output .= '<label>'; |
|
131 | + if ($labels) { |
|
132 | + $_output .= '<label>'; |
|
133 | + } |
|
129 | 134 | $_output .= '<input type="checkbox" name="' |
130 | 135 | . smarty_function_escape_special_chars($name) . '[]" value="' |
131 | 136 | . smarty_function_escape_special_chars($value) . '"'; |
@@ -134,7 +139,9 @@ discard block |
||
134 | 139 | $_output .= ' checked="checked"'; |
135 | 140 | } |
136 | 141 | $_output .= $extra . ' />' . $output; |
137 | - if ($labels) $_output .= '</label>'; |
|
142 | + if ($labels) { |
|
143 | + $_output .= '</label>'; |
|
144 | + } |
|
138 | 145 | $_output .= $separator; |
139 | 146 | |
140 | 147 | return $_output; |
@@ -29,8 +29,9 @@ discard block |
||
29 | 29 | case 'function': |
30 | 30 | case 'inarray': |
31 | 31 | $$_key = (string)$_value; |
32 | - if ($_key == 'function' || $_key == 'inarray') |
|
33 | - $append .= ',' . strtoupper($_key) . ",'$_value'"; |
|
32 | + if ($_key == 'function' || $_key == 'inarray') { |
|
33 | + $append .= ',' . strtoupper($_key) . ",'$_value'"; |
|
34 | + } |
|
34 | 35 | break; |
35 | 36 | |
36 | 37 | case 'caption': |
@@ -90,7 +91,9 @@ discard block |
||
90 | 91 | case 'mouseoff': |
91 | 92 | case 'followmouse': |
92 | 93 | case 'closeclick': |
93 | - if ($_value) $append .= ',' . strtoupper($_key); |
|
94 | + if ($_value) { |
|
95 | + $append .= ',' . strtoupper($_key); |
|
96 | + } |
|
94 | 97 | break; |
95 | 98 | |
96 | 99 | default: |
@@ -107,8 +110,9 @@ discard block |
||
107 | 110 | |
108 | 111 | $retval = $trigger . '="return overlib(\''.preg_replace(array("!'!","![\r\n]!"),array("\'",'\r'),$text).'\''; |
109 | 112 | $retval .= $append . ');"'; |
110 | - if ($trigger == 'onmouseover') |
|
111 | - $retval .= ' onmouseout="nd();"'; |
|
113 | + if ($trigger == 'onmouseover') { |
|
114 | + $retval .= ' onmouseout="nd();"'; |
|
115 | + } |
|
112 | 116 | |
113 | 117 | |
114 | 118 | return $retval; |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -109,7 +111,9 @@ discard block |
||
109 | 111 | break; |
110 | 112 | |
111 | 113 | case "SUBPANELSAVE": |
112 | - if($view == 'QuickCreate' || (isset($_REQUEST['target_action']) && strtolower($_REQUEST['target_action'])) == 'quickcreate') $view = "form_SubpanelQuickCreate_{$module}"; |
|
114 | + if($view == 'QuickCreate' || (isset($_REQUEST['target_action']) && strtolower($_REQUEST['target_action'])) == 'quickcreate') { |
|
115 | + $view = "form_SubpanelQuickCreate_{$module}"; |
|
116 | + } |
|
113 | 117 | return '{if $bean->aclAccess("save")}<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button" onclick="disableOnUnloadEditView();this.form.action.value=\'Save\';if(check_form(\''.$view.'\'))return SUGAR.subpanelUtils.inlineSave(this.form.id, \'' . $params['module'] . '_subpanel_save_button\');return false;" type="submit" name="' . $params['module'] . '_subpanel_save_button" id="' . $params['module'] . '_subpanel_save_button" value="{$APP.LBL_SAVE_BUTTON_LABEL}">{/if} '; |
114 | 118 | case "SUBPANELCANCEL": |
115 | 119 | return '<input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="return SUGAR.subpanelUtils.cancelCreate($(this).attr(\'id\'));return false;" type="submit" name="' . $params['module'] . '_subpanel_cancel_button" id="' . $params['module'] . '_subpanel_cancel_button" value="{$APP.LBL_CANCEL_BUTTON_LABEL}"> '; |
@@ -33,11 +33,12 @@ |
||
33 | 33 | return; |
34 | 34 | } |
35 | 35 | |
36 | - if(substr($string[0],0,1) != "'" && !preg_match("!\d!",$string[0]) || $_uc_digits) |
|
37 | - return ucfirst($string[0]); |
|
38 | - else |
|
39 | - return $string[0]; |
|
40 | -} |
|
36 | + if(substr($string[0],0,1) != "'" && !preg_match("!\d!",$string[0]) || $_uc_digits) { |
|
37 | + return ucfirst($string[0]); |
|
38 | + } else { |
|
39 | + return $string[0]; |
|
40 | + } |
|
41 | + } |
|
41 | 42 | |
42 | 43 | |
43 | 44 | ?> |