Completed
Push — master ( 24ce66...da2f36 )
by Adam
25:35
created
include/Smarty/plugins/function.debug.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
     if (isset($params['output'])) {
27 27
         $smarty->assign('_smarty_debug_output', $params['output']);
28 28
     }
29
-    require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
29
+    require_once(SMARTY_CORE_DIR.'core.display_debug_console.php');
30 30
     return smarty_core_display_debug_console(null, $smarty);
31 31
 }
32 32
 
Please login to merge, or discard this patch.
include/Smarty/plugins/function.eval.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,14 +26,14 @@
 block discarded – undo
26 26
         return;
27 27
     }
28 28
 
29
-    if($params['var'] == '') {
29
+    if ($params['var'] == '') {
30 30
         return;
31 31
     }
32 32
 
33 33
     $smarty->_compile_source('evaluated template', $params['var'], $_var_compiled);
34 34
 
35 35
     ob_start();
36
-    $smarty->_eval('?>' . $_var_compiled);
36
+    $smarty->_eval('?>'.$_var_compiled);
37 37
     $_contents = ob_get_contents();
38 38
     ob_end_clean();
39 39
 
Please login to merge, or discard this patch.
include/Smarty/plugins/modifier.debug_print_var.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -30,20 +30,20 @@  discard block
 block discarded – undo
30 30
 
31 31
     switch (gettype($var)) {
32 32
         case 'array' :
33
-            $results = '<b>Array (' . count($var) . ')</b>';
33
+            $results = '<b>Array ('.count($var).')</b>';
34 34
             foreach ($var as $curr_key => $curr_val) {
35
-                $results .= '<br>' . str_repeat('&nbsp;', $depth * 2)
36
-                    . '<b>' . strtr($curr_key, $_replace) . '</b> =&gt; '
35
+                $results .= '<br>'.str_repeat('&nbsp;', $depth * 2)
36
+                    . '<b>'.strtr($curr_key, $_replace).'</b> =&gt; '
37 37
                     . smarty_modifier_debug_print_var($curr_val, ++$depth, $length);
38 38
                     $depth--;
39 39
             }
40 40
             break;
41 41
         case 'object' :
42 42
             $object_vars = get_object_vars($var);
43
-            $results = '<b>' . get_class($var) . ' Object (' . count($object_vars) . ')</b>';
43
+            $results = '<b>'.get_class($var).' Object ('.count($object_vars).')</b>';
44 44
             foreach ($object_vars as $curr_key => $curr_val) {
45
-                $results .= '<br>' . str_repeat('&nbsp;', $depth * 2)
46
-                    . '<b> -&gt;' . strtr($curr_key, $_replace) . '</b> = '
45
+                $results .= '<br>'.str_repeat('&nbsp;', $depth * 2)
46
+                    . '<b> -&gt;'.strtr($curr_key, $_replace).'</b> = '
47 47
                     . smarty_modifier_debug_print_var($curr_val, ++$depth, $length);
48 48
                     $depth--;
49 49
             }
@@ -58,26 +58,26 @@  discard block
 block discarded – undo
58 58
             } elseif (null === $var) {
59 59
                 $results = 'null';
60 60
             } else {
61
-                $results = htmlspecialchars((string) $var);
61
+                $results = htmlspecialchars((string)$var);
62 62
             }
63
-            $results = '<i>' . $results . '</i>';
63
+            $results = '<i>'.$results.'</i>';
64 64
             break;
65 65
         case 'integer' :
66 66
         case 'float' :
67
-            $results = htmlspecialchars((string) $var);
67
+            $results = htmlspecialchars((string)$var);
68 68
             break;
69 69
         case 'string' :
70 70
             $results = strtr($var, $_replace);
71
-            if (strlen($var) > $length ) {
72
-                $results = substr($var, 0, $length - 3) . '...';
71
+            if (strlen($var) > $length) {
72
+                $results = substr($var, 0, $length - 3).'...';
73 73
             }
74
-            $results = htmlspecialchars('"' . $results . '"');
74
+            $results = htmlspecialchars('"'.$results.'"');
75 75
             break;
76 76
         case 'unknown type' :
77 77
         default :
78
-            $results = strtr((string) $var, $_replace);
79
-            if (strlen($results) > $length ) {
80
-                $results = substr($results, 0, $length - 3) . '...';
78
+            $results = strtr((string)$var, $_replace);
79
+            if (strlen($results) > $length) {
80
+                $results = substr($results, 0, $length - 3).'...';
81 81
             }
82 82
             $results = htmlspecialchars($results);
83 83
     }
Please login to merge, or discard this patch.
include/Smarty/plugins/function.sugar_evalcolumn.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -68,48 +68,48 @@  discard block
 block discarded – undo
68 68
  */
69 69
 function smarty_function_sugar_evalcolumn($params, &$smarty)
70 70
 {
71
-    if (!isset($params['colData']['field']) ) {
72
-        if(empty($params['colData']))  
71
+    if (!isset($params['colData']['field'])) {
72
+        if (empty($params['colData']))  
73 73
             $smarty->trigger_error("evalcolumn: missing 'colData' parameter");
74
-        if(!isset($params['colData']['field']))  
74
+        if (!isset($params['colData']['field']))  
75 75
             $smarty->trigger_error("evalcolumn: missing 'colData.field' parameter");
76 76
         return;
77 77
     }
78 78
 
79
-    if(empty($params['colData']['field'])) {
79
+    if (empty($params['colData']['field'])) {
80 80
         return;
81 81
     }
82 82
     $params['var'] = $params['colData']['field'];
83
-    if(isset($params['toJSON'])) {
83
+    if (isset($params['toJSON'])) {
84 84
         $json = getJSONobj();
85 85
         $params['var'] = $json->encode($params['var']);
86 86
     }
87 87
 
88 88
     if (!empty($params['var']['assign'])) {
89
-        return '{$' . $params['colData']['field']['name'] . '}';
89
+        return '{$'.$params['colData']['field']['name'].'}';
90 90
     } else {
91 91
     	$code = $params['var']['customCode'];
92
-    	if(isset($params['tabindex']) && preg_match_all("'(<[ ]*?)(textarea|input|select)([^>]*?)(>)'si", $code, $matches, PREG_PATTERN_ORDER)) {
92
+    	if (isset($params['tabindex']) && preg_match_all("'(<[ ]*?)(textarea|input|select)([^>]*?)(>)'si", $code, $matches, PREG_PATTERN_ORDER)) {
93 93
     	   $str_replace = array();
94
-    	   $tabindex = ' tabindex="' . $params['tabindex'] . '" ';
95
-    	   foreach($matches[3] as $match) {
96
-    	   	       $str_replace[$match] = $tabindex . $match;
94
+    	   $tabindex = ' tabindex="'.$params['tabindex'].'" ';
95
+    	   foreach ($matches[3] as $match) {
96
+    	   	       $str_replace[$match] = $tabindex.$match;
97 97
     	   }
98 98
     	   $code = str_replace(array_keys($str_replace), array_values($str_replace), $code);
99 99
     	}
100 100
 
101
-        if(isset($params['accesskey']) && preg_match_all("'(<[ ]*?)(textarea|input|select)([^>]*?)(>)'si", $code, $matches, PREG_PATTERN_ORDER)) {
101
+        if (isset($params['accesskey']) && preg_match_all("'(<[ ]*?)(textarea|input|select)([^>]*?)(>)'si", $code, $matches, PREG_PATTERN_ORDER)) {
102 102
     	   $str_replace = array();
103
-    	   $accesskey = ' accesskey="' . $params['accesskey'] . '" ';
104
-    	   foreach($matches[3] as $match) {
105
-    	   	       $str_replace[$match] = $accesskey . $match;
103
+    	   $accesskey = ' accesskey="'.$params['accesskey'].'" ';
104
+    	   foreach ($matches[3] as $match) {
105
+    	   	       $str_replace[$match] = $accesskey.$match;
106 106
     	   }
107 107
     	   $code = str_replace(array_keys($str_replace), array_values($str_replace), $code);
108 108
     	}
109 109
     	
110 110
         // Add a string replace to swap out @@FIELD@@ for the actual field,
111 111
         // we can't do this through customCode directly because the sugar_field smarty function returns smarty code to run on the second pass
112
-        if (!empty($code) && strpos($code,'@@FIELD@@') !== FALSE ) {
112
+        if (!empty($code) && strpos($code, '@@FIELD@@') !== FALSE) {
113 113
             // First we need to fetch extra data about the field
114 114
             // sfp == SugarFieldParams
115 115
             $sfp = $params;
@@ -123,13 +123,13 @@  discard block
 block discarded – undo
123 123
             
124 124
             $fieldText = smarty_function_sugar_field($sfp, $smarty);
125 125
 
126
-            $code = str_replace('@@FIELD@@',$fieldText,$code);
126
+            $code = str_replace('@@FIELD@@', $fieldText, $code);
127 127
         }
128 128
 
129 129
     	//eggsurplus bug 28321: add support for rendering customCode AND normal field rendering
130
-    	if(!empty($params['var']['displayParams']['enableConnectors']) && empty($params['var']['customCodeRenderField'])) {
130
+    	if (!empty($params['var']['displayParams']['enableConnectors']) && empty($params['var']['customCodeRenderField'])) {
131 131
     	  require_once('include/connectors/utils/ConnectorUtils.php');
132
-    	  $code .= '&nbsp;' . ConnectorUtils::getConnectorButtonScript($params['var']['displayParams'], $smarty);
132
+    	  $code .= '&nbsp;'.ConnectorUtils::getConnectorButtonScript($params['var']['displayParams'], $smarty);
133 133
     	}
134 134
     	return $code;
135 135
     }
Please login to merge, or discard this patch.
include/Smarty/plugins/function.math.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -28,30 +28,30 @@  discard block
 block discarded – undo
28 28
     }
29 29
 
30 30
     // strip out backticks, not necessary for math
31
-    $equation = str_replace('`','',$params['equation']);
31
+    $equation = str_replace('`', '', $params['equation']);
32 32
 
33 33
     // make sure parenthesis are balanced
34
-    if (substr_count($equation,"(") != substr_count($equation,")")) {
34
+    if (substr_count($equation, "(") != substr_count($equation, ")")) {
35 35
         $smarty->trigger_error("math: unbalanced parenthesis");
36 36
         return;
37 37
     }
38 38
 
39 39
     // match all vars in equation, make sure all are passed
40
-    preg_match_all("!(?:0x[a-fA-F0-9]+)|([a-zA-Z][a-zA-Z0-9_]*)!",$equation, $match);
41
-    $allowed_funcs = array('int','abs','ceil','cos','exp','floor','log','log10',
42
-                           'max','min','pi','pow','rand','round','sin','sqrt','srand','tan');
40
+    preg_match_all("!(?:0x[a-fA-F0-9]+)|([a-zA-Z][a-zA-Z0-9_]*)!", $equation, $match);
41
+    $allowed_funcs = array('int', 'abs', 'ceil', 'cos', 'exp', 'floor', 'log', 'log10',
42
+                           'max', 'min', 'pi', 'pow', 'rand', 'round', 'sin', 'sqrt', 'srand', 'tan');
43 43
     
44
-    foreach($match[1] as $curr_var) {
44
+    foreach ($match[1] as $curr_var) {
45 45
         if ($curr_var && !in_array($curr_var, array_keys($params)) && !in_array($curr_var, $allowed_funcs)) {
46 46
             $smarty->trigger_error("math: function call $curr_var not allowed");
47 47
             return;
48 48
         }
49 49
     }
50 50
 
51
-    foreach($params as $key => $val) {
51
+    foreach ($params as $key => $val) {
52 52
         if ($key != "equation" && $key != "format" && $key != "assign") {
53 53
             // make sure value is not empty
54
-            if (strlen($val)==0) {
54
+            if (strlen($val) == 0) {
55 55
                 $smarty->trigger_error("math: parameter $key is empty");
56 56
                 return;
57 57
             }
@@ -69,13 +69,13 @@  discard block
 block discarded – undo
69 69
         if (empty($params['assign'])) {
70 70
             return $smarty_math_result;
71 71
         } else {
72
-            $smarty->assign($params['assign'],$smarty_math_result);
72
+            $smarty->assign($params['assign'], $smarty_math_result);
73 73
         }
74 74
     } else {
75
-        if (empty($params['assign'])){
76
-            printf($params['format'],$smarty_math_result);
75
+        if (empty($params['assign'])) {
76
+            printf($params['format'], $smarty_math_result);
77 77
         } else {
78
-            $smarty->assign($params['assign'],sprintf($params['format'],$smarty_math_result));
78
+            $smarty->assign($params['assign'], sprintf($params['format'], $smarty_math_result));
79 79
         }
80 80
     }
81 81
 }
Please login to merge, or discard this patch.
include/Smarty/plugins/function.ext_includes.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,15 +43,15 @@
 block discarded – undo
43 43
 
44 44
 function smarty_function_ext_includes($params, &$smarty)
45 45
 {
46
-	$ret = '<link rel="stylesheet" type="text/css" href="' . getJSPath("themes/default/ext/resources/css/ext-all.css") . '" />'
47
-		 . '<link rel="stylesheet" type="text/css" href="' . getJSPath("themes/default/ext/resources/css/xtheme-gray.css") . '" />';
46
+	$ret = '<link rel="stylesheet" type="text/css" href="'.getJSPath("themes/default/ext/resources/css/ext-all.css").'" />'
47
+		 . '<link rel="stylesheet" type="text/css" href="'.getJSPath("themes/default/ext/resources/css/xtheme-gray.css").'" />';
48 48
 		 
49 49
 	global $theme;
50 50
 	if (is_dir("themes/$theme/ext/resources/css")) {
51 51
 			$cssDir = opendir("themes/$theme/ext/resources/css");
52 52
 			while (($file = readdir($cssDir)) !== false) {
53 53
 				if (strcasecmp(substr($file, -4), '.css' == 0)) {
54
-            		$ret .= "<link rel='stylesheet' type='text/css' href='" . getJSPath("themes/$theme/ext/resources/css/$file") . "' />";
54
+            		$ret .= "<link rel='stylesheet' type='text/css' href='".getJSPath("themes/$theme/ext/resources/css/$file")."' />";
55 55
 				}
56 56
         	}
57 57
 	}
Please login to merge, or discard this patch.
include/Smarty/plugins/function.sugar_field.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -55,33 +55,33 @@  discard block
 block discarded – undo
55 55
 function smarty_function_sugar_field($params, &$smarty)
56 56
 {
57 57
     if (!isset($params['vardef']) || !isset($params['displayType']) || !isset($params['parentFieldArray'])) {
58
-        if(!isset($params['vardef']))
58
+        if (!isset($params['vardef']))
59 59
             $smarty->trigger_error("sugar_field: missing 'vardef' parameter");
60
-        if(!isset($params['displayType']))  
60
+        if (!isset($params['displayType']))  
61 61
             $smarty->trigger_error("sugar_field: missing 'displayType' parameter");
62
-        if(!isset($params['parentFieldArray']))  
62
+        if (!isset($params['parentFieldArray']))  
63 63
             $smarty->trigger_error("sugar_field: missing 'parentFieldArray' parameter");
64 64
                              
65 65
         return;
66 66
     }
67 67
 
68 68
     static $sfh;
69
-    if(!isset($sfh)) $sfh = new SugarFieldHandler();
69
+    if (!isset($sfh)) $sfh = new SugarFieldHandler();
70 70
     
71
-    if(!isset($params['displayParams'])) $displayParams = array();
71
+    if (!isset($params['displayParams'])) $displayParams = array();
72 72
     else $displayParams = $params['displayParams'];
73 73
     
74
-    if(isset($params['labelSpan'])) $displayParams['labelSpan'] = $params['labelSpan'];
74
+    if (isset($params['labelSpan'])) $displayParams['labelSpan'] = $params['labelSpan'];
75 75
     else $displayParams['labelSpan'] = null;
76
-    if(isset($params['fieldSpan'])) $displayParams['fieldSpan'] = $params['fieldSpan'];
76
+    if (isset($params['fieldSpan'])) $displayParams['fieldSpan'] = $params['fieldSpan'];
77 77
     else $displayParams['fieldSpan'] = null;
78 78
 
79
-    if(isset($params['typeOverride'])) { // override the type in the vardef?
79
+    if (isset($params['typeOverride'])) { // override the type in the vardef?
80 80
         $params['vardef']['type'] = $params['typeOverride']; 
81 81
     }
82
-    if(isset($params['formName'])) $displayParams['formName'] = $params['formName'];
82
+    if (isset($params['formName'])) $displayParams['formName'] = $params['formName'];
83 83
     
84
-    if(isset($params['field'])) {
84
+    if (isset($params['field'])) {
85 85
         $params['vardef']['name'] = $params['field'];
86 86
     }
87 87
    
@@ -89,15 +89,15 @@  discard block
 block discarded – undo
89 89
         $displayParams['call_back_function'] = $params['call_back_function'];
90 90
     }
91 91
     
92
-    if(isset($params['skipClearButton'])) {
92
+    if (isset($params['skipClearButton'])) {
93 93
         $displayParams['skipClearButton'] = $params['skipClearButton'];
94 94
     }
95 95
     
96
-    if(isset($params['idName'])) {
96
+    if (isset($params['idName'])) {
97 97
         $displayParams['idName'] = $params['idName'];
98 98
     }
99 99
     
100
-    if(isset($params['accesskey'])) {
100
+    if (isset($params['accesskey'])) {
101 101
         $displayParams['accesskey'] = $params['accesskey'];
102 102
     }
103 103
 
Please login to merge, or discard this patch.
include/Smarty/plugins/shared.escape_special_chars.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,10 +18,10 @@
 block discarded – undo
18 18
  */
19 19
 function smarty_function_escape_special_chars($string)
20 20
 {
21
-    if(!is_array($string)) {
21
+    if (!is_array($string)) {
22 22
         $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string);
23 23
         $string = htmlspecialchars($string);
24
-        $string = str_replace(array('%%%SMARTY_START%%%','%%%SMARTY_END%%%'), array('&',';'), $string);
24
+        $string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string);
25 25
     }
26 26
     return $string;
27 27
 }
Please login to merge, or discard this patch.
include/Smarty/plugins/modifier.date_format.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
         return;
39 39
     }
40 40
     if (DIRECTORY_SEPARATOR == '\\') {
41
-        $_win_from = array('%D',       '%h', '%n', '%r',          '%R',    '%t', '%T');
41
+        $_win_from = array('%D', '%h', '%n', '%r', '%R', '%t', '%T');
42 42
         $_win_to   = array('%m/%d/%y', '%b', "\n", '%I:%M:%S %p', '%H:%M', "\t", '%H:%M:%S');
43 43
         if (strpos($format, '%e') !== false) {
44 44
             $_win_from[] = '%e';
Please login to merge, or discard this patch.