@@ -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 | ?> |
@@ -66,10 +66,11 @@ |
||
66 | 66 | $counter['direction'] = $params['direction']; |
67 | 67 | } |
68 | 68 | |
69 | - if ($counter['direction'] == "down") |
|
70 | - $counter['count'] -= $counter['skip']; |
|
71 | - else |
|
72 | - $counter['count'] += $counter['skip']; |
|
69 | + if ($counter['direction'] == "down") { |
|
70 | + $counter['count'] -= $counter['skip']; |
|
71 | + } else { |
|
72 | + $counter['count'] += $counter['skip']; |
|
73 | + } |
|
73 | 74 | |
74 | 75 | return $retval; |
75 | 76 |
@@ -27,8 +27,9 @@ |
||
27 | 27 | function smarty_modifier_truncate($string, $length = 80, $etc = '...', |
28 | 28 | $break_words = false, $middle = false) |
29 | 29 | { |
30 | - if ($length == 0) |
|
31 | - return ''; |
|
30 | + if ($length == 0) { |
|
31 | + return ''; |
|
32 | + } |
|
32 | 33 | |
33 | 34 | if (strlen($string) > $length) { |
34 | 35 | $length -= min($length, strlen($etc)); |
@@ -79,8 +79,7 @@ |
||
79 | 79 | // non-standard char, escape it |
80 | 80 | if($_ord >= 126){ |
81 | 81 | $_res .= '&#' . $_ord . ';'; |
82 | - } |
|
83 | - else { |
|
82 | + } else { |
|
84 | 83 | $_res .= substr($string, $_i, 1); |
85 | 84 | } |
86 | 85 | } |
@@ -43,7 +43,9 @@ |
||
43 | 43 | */ |
44 | 44 | |
45 | 45 | |
46 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
46 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
47 | + die('Not A Valid Entry Point'); |
|
48 | +} |
|
47 | 49 | /********************************************************************************* |
48 | 50 | * SugarCRM Community Edition is a customer relationship management program developed by |
49 | 51 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -64,11 +64,13 @@ |
||
64 | 64 | function smarty_outputfilter_trimwhitespace_replace($search_str, $replace, &$subject) { |
65 | 65 | $_len = strlen($search_str); |
66 | 66 | $_pos = 0; |
67 | - for ($_i=0, $_count=count($replace); $_i<$_count; $_i++) |
|
68 | - if (($_pos=strpos($subject, $search_str, $_pos))!==false) |
|
67 | + for ($_i=0, $_count=count($replace); $_i<$_count; $_i++) { |
|
68 | + if (($_pos=strpos($subject, $search_str, $_pos))!==false) |
|
69 | 69 | $subject = substr_replace($subject, $replace[$_i], $_pos, $_len); |
70 | - else |
|
71 | - break; |
|
70 | + } |
|
71 | + else { |
|
72 | + break; |
|
73 | + } |
|
72 | 74 | |
73 | 75 | } |
74 | 76 |