@@ -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 | } |
@@ -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 |
@@ -80,7 +80,7 @@ |
||
80 | 80 | if(empty($params['memberName'])){ |
81 | 81 | $member = $smarty->get_template_vars('vardef'); |
82 | 82 | $member = $member['name']; |
83 | - }else{ |
|
83 | + } else{ |
|
84 | 84 | $members = explode('.', $params['memberName']); |
85 | 85 | $member = $smarty->get_template_vars($members[0]); |
86 | 86 | for($i = 1; $i < count($members); $i++){ |
@@ -43,7 +43,7 @@ |
||
43 | 43 | foreach($buttons as $val => $button){ |
44 | 44 | $str .= smarty_function_sugar_button(array('module' => $module, 'id' => $button, 'view' => $view), $smarty); |
45 | 45 | } |
46 | - }else{ |
|
46 | + } else{ |
|
47 | 47 | $str = '<div id="buttonSlide" class="yui-module">'; |
48 | 48 | $str .= '<table border="0">'; |
49 | 49 | $str .='<tr><td>'; |
@@ -21,11 +21,12 @@ |
||
21 | 21 | */ |
22 | 22 | function smarty_modifier_default($string, $default = '') |
23 | 23 | { |
24 | - if (!isset($string) || $string === '') |
|
25 | - return $default; |
|
26 | - else |
|
27 | - return $string; |
|
28 | -} |
|
24 | + if (!isset($string) || $string === '') { |
|
25 | + return $default; |
|
26 | + } else { |
|
27 | + return $string; |
|
28 | + } |
|
29 | + } |
|
29 | 30 | |
30 | 31 | /* vim: set expandtab: */ |
31 | 32 |
@@ -21,8 +21,9 @@ |
||
21 | 21 | */ |
22 | 22 | function smarty_modifier_count_characters($string, $include_spaces = false) |
23 | 23 | { |
24 | - if ($include_spaces) |
|
25 | - return(strlen($string)); |
|
24 | + if ($include_spaces) { |
|
25 | + return(strlen($string)); |
|
26 | + } |
|
26 | 27 | |
27 | 28 | return preg_match_all("/[^\s]/",$string, $match); |
28 | 29 | } |
@@ -69,11 +69,12 @@ |
||
69 | 69 | |
70 | 70 | $module = (isset($params['module']))? $params['module']: ''; |
71 | 71 | if(isset($params['select'])){ |
72 | - if(empty($params['select'])) |
|
73 | - $value = ""; |
|
74 | - else |
|
75 | - $value = translate($params['label'] , $module, $params['select']); |
|
76 | - }else{ |
|
72 | + if(empty($params['select'])) { |
|
73 | + $value = ""; |
|
74 | + } else { |
|
75 | + $value = translate($params['label'] , $module, $params['select']); |
|
76 | + } |
|
77 | + } else{ |
|
77 | 78 | $value = translate($params['label'] , $module); |
78 | 79 | } |
79 | 80 | if (!empty($params['for_js']) && $params['for_js']) { |
@@ -69,10 +69,12 @@ |
||
69 | 69 | function smarty_function_sugar_evalcolumn($params, &$smarty) |
70 | 70 | { |
71 | 71 | if (!isset($params['colData']['field']) ) { |
72 | - if(empty($params['colData'])) |
|
73 | - $smarty->trigger_error("evalcolumn: missing 'colData' parameter"); |
|
74 | - if(!isset($params['colData']['field'])) |
|
75 | - $smarty->trigger_error("evalcolumn: missing 'colData.field' parameter"); |
|
72 | + if(empty($params['colData'])) { |
|
73 | + $smarty->trigger_error("evalcolumn: missing 'colData' parameter"); |
|
74 | + } |
|
75 | + if(!isset($params['colData']['field'])) { |
|
76 | + $smarty->trigger_error("evalcolumn: missing 'colData.field' parameter"); |
|
77 | + } |
|
76 | 78 | return; |
77 | 79 | } |
78 | 80 |