@@ -829,6 +829,7 @@ discard block |
||
829 | 829 | * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. |
830 | 830 | * All Rights Reserved. |
831 | 831 | * Contributor(s): ______________________________________.. |
832 | + * @param boolean $always_copy |
|
832 | 833 | */ |
833 | 834 | function safe_map_named($request_var, & $focus, $member_var, $always_copy) |
834 | 835 | { |
@@ -1248,6 +1249,7 @@ discard block |
||
1248 | 1249 | * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. |
1249 | 1250 | * All Rights Reserved. |
1250 | 1251 | * Contributor(s): ______________________________________.. |
1252 | + * @param string $varname |
|
1251 | 1253 | */ |
1252 | 1254 | function return_session_value_or_default($varname, $default) |
1253 | 1255 | { |
@@ -1358,6 +1360,9 @@ discard block |
||
1358 | 1360 | |
1359 | 1361 | } |
1360 | 1362 | |
1363 | +/** |
|
1364 | + * @param integer $characters |
|
1365 | + */ |
|
1361 | 1366 | function create_guid_section($characters) |
1362 | 1367 | { |
1363 | 1368 | $return = ""; |
@@ -1368,6 +1373,10 @@ discard block |
||
1368 | 1373 | return $return; |
1369 | 1374 | } |
1370 | 1375 | |
1376 | +/** |
|
1377 | + * @param string $string |
|
1378 | + * @param integer $length |
|
1379 | + */ |
|
1371 | 1380 | function ensure_length(&$string, $length) |
1372 | 1381 | { |
1373 | 1382 | $strlen = strlen($string); |
@@ -1475,6 +1484,9 @@ discard block |
||
1475 | 1484 | |
1476 | 1485 | |
1477 | 1486 | // Check if user is admin for a specific module. |
1487 | +/** |
|
1488 | + * @param string $module |
|
1489 | + */ |
|
1478 | 1490 | function is_admin_for_module($user,$module) { |
1479 | 1491 | if (!isset($user)) { |
1480 | 1492 | return false; |
@@ -1535,6 +1547,7 @@ discard block |
||
1535 | 1547 | * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. |
1536 | 1548 | * All Rights Reserved. |
1537 | 1549 | * Contributor(s): ______________________________________.. |
1550 | + * @param string $selected |
|
1538 | 1551 | */ |
1539 | 1552 | function get_select_options ($option_list, $selected) { |
1540 | 1553 | return get_select_options_with_id($option_list, $selected); |
@@ -1822,7 +1835,7 @@ discard block |
||
1822 | 1835 | |
1823 | 1836 | /** |
1824 | 1837 | * returns a default array of XSS tags to clean |
1825 | - * @return array |
|
1838 | + * @return string |
|
1826 | 1839 | */ |
1827 | 1840 | function getDefaultXssTags() { |
1828 | 1841 | $tmp = array( |
@@ -1849,6 +1862,7 @@ discard block |
||
1849 | 1862 | /** |
1850 | 1863 | * Remove potential xss vectors from strings |
1851 | 1864 | * @param string str String to search for XSS attack vectors |
1865 | + * @param string $str |
|
1852 | 1866 | * @deprecated |
1853 | 1867 | * @return string |
1854 | 1868 | */ |
@@ -1862,6 +1876,7 @@ discard block |
||
1862 | 1876 | * @deprecated |
1863 | 1877 | * @param string str String to search for XSS attack vectors |
1864 | 1878 | * @param bool cleanImg Flag to allow <img> tags to survive - only used by InboundEmail for inline images. |
1879 | + * @param string $str |
|
1865 | 1880 | * @return array Array of matches, empty on clean string |
1866 | 1881 | */ |
1867 | 1882 | function clean_xss($str, $cleanImg=true) { |
@@ -1938,6 +1953,7 @@ discard block |
||
1938 | 1953 | * Helper function used by clean_xss() to parse for known-bad vectors |
1939 | 1954 | * @param string pattern Regex pattern to use |
1940 | 1955 | * @param string str String to parse for badness |
1956 | + * @param string $pattern |
|
1941 | 1957 | * @return array |
1942 | 1958 | */ |
1943 | 1959 | function xss_check_pattern($pattern, $str) { |
@@ -2022,6 +2038,7 @@ discard block |
||
2022 | 2038 | |
2023 | 2039 | /** |
2024 | 2040 | * cleans the given key in superglobals $_GET, $_POST, $_REQUEST |
2041 | + * @param string $key |
|
2025 | 2042 | */ |
2026 | 2043 | function clean_superglobals($key, $filter = 'STANDARD') { |
2027 | 2044 | if(isset($_GET[$key])) clean_string($_GET[$key], $filter); |
@@ -2029,6 +2046,9 @@ discard block |
||
2029 | 2046 | if(isset($_REQUEST[$key])) clean_string($_REQUEST[$key], $filter); |
2030 | 2047 | } |
2031 | 2048 | |
2049 | +/** |
|
2050 | + * @param string $key |
|
2051 | + */ |
|
2032 | 2052 | function set_superglobals($key, $val){ |
2033 | 2053 | $_GET[$key] = $val; |
2034 | 2054 | $_POST[$key] = $val; |
@@ -2108,11 +2128,18 @@ discard block |
||
2108 | 2128 | } |
2109 | 2129 | |
2110 | 2130 | // Returns TRUE if $str begins with $begin |
2131 | +/** |
|
2132 | + * @param string $begin |
|
2133 | + */ |
|
2111 | 2134 | function str_begin($str, $begin) { |
2112 | 2135 | return (substr($str, 0, strlen($begin)) == $begin); |
2113 | 2136 | } |
2114 | 2137 | |
2115 | 2138 | // Returns TRUE if $str ends with $end |
2139 | +/** |
|
2140 | + * @param string $str |
|
2141 | + * @param string $end |
|
2142 | + */ |
|
2116 | 2143 | function str_end($str, $end) { |
2117 | 2144 | return (substr($str, strlen($str) - strlen($end)) == $end); |
2118 | 2145 | } |
@@ -2170,14 +2197,24 @@ discard block |
||
2170 | 2197 | } |
2171 | 2198 | |
2172 | 2199 | |
2200 | +/** |
|
2201 | + * @param string $category |
|
2202 | + */ |
|
2173 | 2203 | function set_register_value($category, $name, $value){ |
2174 | 2204 | return sugar_cache_put("{$category}:{$name}", $value); |
2175 | 2205 | } |
2176 | 2206 | |
2207 | +/** |
|
2208 | + * @param string $category |
|
2209 | + */ |
|
2177 | 2210 | function get_register_value($category,$name){ |
2178 | 2211 | return sugar_cache_retrieve("{$category}:{$name}"); |
2179 | 2212 | } |
2180 | 2213 | |
2214 | +/** |
|
2215 | + * @param string $category |
|
2216 | + * @param string $name |
|
2217 | + */ |
|
2181 | 2218 | function clear_register_value($category,$name){ |
2182 | 2219 | return sugar_cache_clear("{$category}:{$name}"); |
2183 | 2220 | } |
@@ -2379,6 +2416,11 @@ discard block |
||
2379 | 2416 | return $new_array; |
2380 | 2417 | } |
2381 | 2418 | |
2419 | +/** |
|
2420 | + * @param DBManager $db |
|
2421 | + * @param string $from_column |
|
2422 | + * @param string $to_id |
|
2423 | + */ |
|
2382 | 2424 | function clone_relationship(&$db, $tables = array(), $from_column, $from_id, $to_id) |
2383 | 2425 | { |
2384 | 2426 | foreach($tables as $table) |
@@ -2556,6 +2598,10 @@ discard block |
||
2556 | 2598 | return empty($value) && $value != '0'; |
2557 | 2599 | } |
2558 | 2600 | |
2601 | +/** |
|
2602 | + * @param string $bean_name |
|
2603 | + * @param string $display_columns |
|
2604 | + */ |
|
2559 | 2605 | function get_bean_select_array($add_blank=true, $bean_name, $display_columns, $where='', $order_by='', $blank_is_none=false) |
2560 | 2606 | { |
2561 | 2607 | global $beanFiles; |
@@ -2746,6 +2792,11 @@ discard block |
||
2746 | 2792 | //end function js_escape |
2747 | 2793 | } |
2748 | 2794 | |
2795 | +/** |
|
2796 | + * @param string $str |
|
2797 | + * |
|
2798 | + * @return string |
|
2799 | + */ |
|
2749 | 2800 | function br2nl($str) { |
2750 | 2801 | $regex = "#<[^>]+br.+?>#i"; |
2751 | 2802 | preg_match_all($regex, $str, $matches); |
@@ -3265,6 +3316,9 @@ discard block |
||
3265 | 3316 | |
3266 | 3317 | set_error_handler('StackTraceErrorHandler'); |
3267 | 3318 | } |
3319 | +/** |
|
3320 | + * @param string $name |
|
3321 | + */ |
|
3268 | 3322 | function get_sub_cookies($name){ |
3269 | 3323 | $cookies = array(); |
3270 | 3324 | if(isset($_COOKIE[$name])){ |
@@ -3306,6 +3360,7 @@ discard block |
||
3306 | 3360 | |
3307 | 3361 | /** |
3308 | 3362 | * For translating the php.ini memory values into bytes. e.g. input value of '8M' will return 8388608. |
3363 | + * @param string $val |
|
3309 | 3364 | */ |
3310 | 3365 | function return_bytes($val) |
3311 | 3366 | { |
@@ -3413,6 +3468,9 @@ discard block |
||
3413 | 3468 | * Given the bean_name which may be plural or singular return the singular |
3414 | 3469 | * bean_name. This is important when you need to include files. |
3415 | 3470 | */ |
3471 | +/** |
|
3472 | + * @return string |
|
3473 | + */ |
|
3416 | 3474 | function get_singular_bean_name($bean_name){ |
3417 | 3475 | global $beanFiles, $beanList; |
3418 | 3476 | if(array_key_exists($bean_name, $beanList)){ |
@@ -3457,6 +3515,9 @@ discard block |
||
3457 | 3515 | return $singular; |
3458 | 3516 | } |
3459 | 3517 | |
3518 | +/** |
|
3519 | + * @return string |
|
3520 | + */ |
|
3460 | 3521 | function get_label($label_tag, $temp_module_strings){ |
3461 | 3522 | global $app_strings; |
3462 | 3523 | if(!empty($temp_module_strings[$label_tag])){ |
@@ -3562,7 +3623,7 @@ discard block |
||
3562 | 3623 | /** |
3563 | 3624 | * In order to have one place to obtain the proper object name. aCase for example causes issues throughout the application. |
3564 | 3625 | * |
3565 | - * @param string $moduleName |
|
3626 | + * @param string $module_name |
|
3566 | 3627 | */ |
3567 | 3628 | function get_valid_bean_name($module_name){ |
3568 | 3629 | global $beanList; |
@@ -4139,6 +4200,9 @@ discard block |
||
4139 | 4200 | * @return string Relative pathname of the located icon, or '' if not found |
4140 | 4201 | */ |
4141 | 4202 | |
4203 | +/** |
|
4204 | + * @param string $iconFileName |
|
4205 | + */ |
|
4142 | 4206 | function _getIcon($iconFileName) |
4143 | 4207 | { |
4144 | 4208 | |
@@ -4163,7 +4227,7 @@ discard block |
||
4163 | 4227 | /** |
4164 | 4228 | * Function to grab the correct icon image for Studio |
4165 | 4229 | * @param string $iconFileName Name of the icon file |
4166 | - * @param string $altfilename Name of a fallback icon file (displayed if the imagefilename doesn't exist) |
|
4230 | + * @param string $altFileName Name of a fallback icon file (displayed if the imagefilename doesn't exist) |
|
4167 | 4231 | * @param string $width Width of image |
4168 | 4232 | * @param string $height Height of image |
4169 | 4233 | * @param string $align Alignment of image |
@@ -4188,7 +4252,6 @@ discard block |
||
4188 | 4252 | |
4189 | 4253 | /** |
4190 | 4254 | * Function to grab the correct icon image for Dashlets Dialog |
4191 | - * @param string $filename Location of the icon file |
|
4192 | 4255 | * @param string $module Name of the module to fall back onto if file does not exist |
4193 | 4256 | * @param string $width Width of image |
4194 | 4257 | * @param string $height Height of image |
@@ -4601,7 +4664,7 @@ discard block |
||
4601 | 4664 | * 5.5.1RC1 then return 5.5.1 |
4602 | 4665 | * |
4603 | 4666 | * @param string $version |
4604 | - * @return version |
|
4667 | + * @return string |
|
4605 | 4668 | */ |
4606 | 4669 | function getMajorMinorVersion($version){ |
4607 | 4670 | if(preg_match('/^([\d\.]+).*$/si', $version, $matches2)){ |
@@ -4751,6 +4814,9 @@ discard block |
||
4751 | 4814 | } |
4752 | 4815 | } |
4753 | 4816 | |
4817 | +/** |
|
4818 | + * @param string $field_name |
|
4819 | + */ |
|
4754 | 4820 | function order_beans($beans, $field_name) |
4755 | 4821 | { |
4756 | 4822 | //Since php 5.2 doesn't include closures, we must use a global to pass the order field to cmp_beans. |
@@ -4885,7 +4951,7 @@ discard block |
||
4885 | 4951 | * otherwise it return $file |
4886 | 4952 | * |
4887 | 4953 | * @param $file String of filename to check |
4888 | - * @return $file String of filename including custom directory if found |
|
4954 | + * @return string String of filename including custom directory if found |
|
4889 | 4955 | */ |
4890 | 4956 | function get_custom_file_if_exists($file) |
4891 | 4957 | { |
@@ -5037,7 +5103,7 @@ discard block |
||
5037 | 5103 | /** |
5038 | 5104 | * Gets the list of "*type_display*". |
5039 | 5105 | * |
5040 | - * @return array |
|
5106 | + * @return string[] |
|
5041 | 5107 | */ |
5042 | 5108 | function getTypeDisplayList() |
5043 | 5109 | { |
@@ -39,6 +39,10 @@ |
||
39 | 39 | ********************************************************************************/ |
40 | 40 | |
41 | 41 | |
42 | +/** |
|
43 | + * @param string $user_id |
|
44 | + * @param string $where |
|
45 | + */ |
|
42 | 46 | function build_related_list_by_user_id($bean, $user_id,$where) { |
43 | 47 | $bean_id_name = strtolower($bean->object_name).'_id'; |
44 | 48 |
@@ -85,6 +85,9 @@ discard block |
||
85 | 85 | * $eval - evals the generated string if true, note that the array name must be in the global space! |
86 | 86 | * @return : example - string $array_name['a']['b']['c'][.] = 'hello' |
87 | 87 | */ |
88 | +/** |
|
89 | + * @param string $array_name |
|
90 | + */ |
|
88 | 91 | function override_value_to_string_recursive($key_names, $array_name, $value, $eval=false){ |
89 | 92 | if ($eval) return eval( "\${$array_name}". override_recursive_helper($key_names, $array_name, $value)); |
90 | 93 | else return "\${$array_name}". override_recursive_helper($key_names, $array_name, $value); |
@@ -150,6 +153,7 @@ discard block |
||
150 | 153 | * @param array $array2, the array which |
151 | 154 | * @param array $allowEmpty, will return the value if it is empty in $array1 and not in $array2, |
152 | 155 | * otherwise empty values in $array1 are ignored. |
156 | + * @param string $array1 |
|
153 | 157 | * @return array containing the differences between the two arrays |
154 | 158 | */ |
155 | 159 | function deepArrayDiff($array1, $array2, $allowEmpty = false) { |
@@ -270,6 +274,9 @@ discard block |
||
270 | 274 | return $array->get($needle, $default); |
271 | 275 | } |
272 | 276 | |
277 | + /** |
|
278 | + * @param string $key |
|
279 | + */ |
|
273 | 280 | private function _getFromSource($key, $default) { |
274 | 281 | if (strpos($key, '.') === false) { |
275 | 282 | return isset($this[$key]) ? $this[$key] : $default; |
@@ -42,6 +42,7 @@ |
||
42 | 42 | |
43 | 43 | /** |
44 | 44 | * @deprecated use DBManager::convert() instead. |
45 | + * @param string $type |
|
45 | 46 | */ |
46 | 47 | function db_convert($string, $type, $additional_parameters=array(),$additional_parameters_oracle_only=array()) |
47 | 48 | { |
@@ -40,6 +40,10 @@ discard block |
||
40 | 40 | |
41 | 41 | require_once('include/Pear/Crypt_Blowfish/Blowfish.php'); |
42 | 42 | |
43 | +/** |
|
44 | + * @param string $key |
|
45 | + * @param string $data |
|
46 | + */ |
|
43 | 47 | function sugarEncode($key, $data){ |
44 | 48 | return base64_encode($data); |
45 | 49 | } |
@@ -84,6 +88,7 @@ discard block |
||
84 | 88 | * Uses blowfish to encrypt data and base 64 encodes it. It stores the iv as part of the data |
85 | 89 | * @param STRING key - key to base encoding off of |
86 | 90 | * @param STRING data - string to be encrypted and encoded |
91 | + * @param string $key |
|
87 | 92 | * @return string |
88 | 93 | */ |
89 | 94 | function blowfishEncode($key, $data){ |
@@ -96,6 +101,7 @@ discard block |
||
96 | 101 | * Uses blowfish to decode data assumes data has been base64 encoded with the iv stored as part of the data |
97 | 102 | * @param STRING key - key to base decoding off of |
98 | 103 | * @param STRING encoded base64 encoded blowfish encrypted data |
104 | + * @param string $key |
|
99 | 105 | * @return string |
100 | 106 | */ |
101 | 107 | function blowfishDecode($key, $encoded){ |
@@ -61,6 +61,9 @@ discard block |
||
61 | 61 | return( $appendpath.$path ); |
62 | 62 | } |
63 | 63 | |
64 | +/** |
|
65 | + * @param string $file |
|
66 | + */ |
|
64 | 67 | function create_cache_directory($file) |
65 | 68 | { |
66 | 69 | $paths = explode('/',$file); |
@@ -170,6 +173,9 @@ discard block |
||
170 | 173 | return( $write_to_file ); |
171 | 174 | } |
172 | 175 | |
176 | +/** |
|
177 | + * @param string $file |
|
178 | + */ |
|
173 | 179 | function create_custom_directory($file) |
174 | 180 | { |
175 | 181 | $paths = explode('/',$file); |
@@ -241,8 +247,8 @@ discard block |
||
241 | 247 | /** |
242 | 248 | * Function to compare two directory structures and return the items in path_a that didn't match in path_b |
243 | 249 | * |
244 | - * @param $path_a The path of the first root directory to scan - must end with '/' |
|
245 | - * @param $path_b The path of the second root directory to scan - must end with '/' |
|
250 | + * @param string $path_a The path of the first root directory to scan - must end with '/' |
|
251 | + * @param string $path_b The path of the second root directory to scan - must end with '/' |
|
246 | 252 | * @param $ignore_dirs array of filenames/directory names to ignore running md5 on - default 'cache' and 'upload' |
247 | 253 | * @result array containing all the md5s of everything in $path_a that didn't have a match in $path_b |
248 | 254 | */ |
@@ -374,7 +380,7 @@ discard block |
||
374 | 380 | * extension and returns a best guess mime content type. |
375 | 381 | * |
376 | 382 | * @param $filename String of filename to return mime content type |
377 | - * @return mime content type as String value (defaults to 'application/octet-stream' for filenames with extension, empty otherwise) |
|
383 | + * @return string content type as String value (defaults to 'application/octet-stream' for filenames with extension, empty otherwise) |
|
378 | 384 | * |
379 | 385 | */ |
380 | 386 | function get_mime_content_type_from_filename($filename) |
@@ -467,6 +473,9 @@ discard block |
||
467 | 473 | |
468 | 474 | } |
469 | 475 | */ |
476 | +/** |
|
477 | + * @param string $name |
|
478 | + */ |
|
470 | 479 | function cleanFileName($name) |
471 | 480 | { |
472 | 481 | return preg_replace('/[^\w-._]+/i', '', $name); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * |
51 | 51 | * @param $form_title string to display as the title in the header |
52 | 52 | * @param $other_text string to next to the title. Typically used for form buttons. |
53 | - * @param $show_help boolean which determines if the print and help links are shown. |
|
53 | + * @param false|string $show_help boolean which determines if the print and help links are shown. |
|
54 | 54 | * @return string HTML |
55 | 55 | */ |
56 | 56 | function get_form_header( |
@@ -165,9 +165,10 @@ discard block |
||
165 | 165 | * |
166 | 166 | * @deprecated use SugarView::getModuleTitle() for MVC modules, or getClassicModuleTitle() for non-MVC modules |
167 | 167 | * |
168 | - * @param $module string to next to the title. Typically used for form buttons. |
|
169 | - * @param $module_title string to display as the module title |
|
168 | + * @param string $module string to next to the title. Typically used for form buttons. |
|
169 | + * @param string $module_title string to display as the module title |
|
170 | 170 | * @param $show_help boolean which determines if the print and help links are shown. |
171 | + * @param boolean $show_create |
|
171 | 172 | * @return string HTML |
172 | 173 | */ |
173 | 174 | function get_module_title( |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | /** |
74 | 74 | * Static Function which returns and instance of LogicHook |
75 | 75 | * |
76 | - * @return unknown |
|
76 | + * @return LogicHook |
|
77 | 77 | */ |
78 | 78 | static function initialize(){ |
79 | 79 | if(empty($GLOBALS['logic_hook'])) |
@@ -153,6 +153,9 @@ discard block |
||
153 | 153 | return $hook_array; |
154 | 154 | } |
155 | 155 | |
156 | + /** |
|
157 | + * @param string $module_dir |
|
158 | + */ |
|
156 | 159 | public function getHooks($module_dir, $refresh = false) |
157 | 160 | { |
158 | 161 | if($refresh || !isset(self::$hooks[$module_dir])) { |
@@ -169,7 +172,6 @@ discard block |
||
169 | 172 | * @param string $module_dir |
170 | 173 | * @param string $event |
171 | 174 | * @param array $arguments |
172 | - * @param SugarBean $bean |
|
173 | 175 | */ |
174 | 176 | function call_custom_logic($module_dir, $event, $arguments = null){ |
175 | 177 | // declare the hook array variable, it will be defined in the included file. |
@@ -198,7 +200,6 @@ discard block |
||
198 | 200 | * @param array $hook_array |
199 | 201 | * @param string $event |
200 | 202 | * @param array $arguments |
201 | - * @param SugarBean $bean |
|
202 | 203 | */ |
203 | 204 | function process_hooks($hook_array, $event, $arguments){ |
204 | 205 | // Now iterate through the array for the appropriate hook |
@@ -38,6 +38,9 @@ |
||
38 | 38 | ********************************************************************************/ |
39 | 39 | |
40 | 40 | |
41 | +/** |
|
42 | + * @param string $type |
|
43 | + */ |
|
41 | 44 | function loadParentView($type) |
42 | 45 | { |
43 | 46 | if(file_exists('custom/include/MVC/View/views/view.'.$type.'.php')) |