@@ -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. |
@@ -38,7 +40,9 @@ discard block |
||
| 38 | 40 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
| 39 | 41 | ********************************************************************************/ |
| 40 | 42 | |
| 41 | -if (empty($_REQUEST)) die(); |
|
| 43 | +if (empty($_REQUEST)) { |
|
| 44 | + die(); |
|
| 45 | +} |
|
| 42 | 46 | |
| 43 | 47 | $yui_path = array( |
| 44 | 48 | "2.9.0" => "include/javascript/yui", |
@@ -58,20 +62,24 @@ discard block |
||
| 58 | 62 | foreach ($_REQUEST as $param => $val) |
| 59 | 63 | { |
| 60 | 64 | //No backtracking in the path |
| 61 | - if (strpos($param, "..") !== false) |
|
| 62 | - continue; |
|
| 65 | + if (strpos($param, "..") !== false) { |
|
| 66 | + continue; |
|
| 67 | + } |
|
| 63 | 68 | |
| 64 | 69 | $version = explode("/", $param); |
| 65 | 70 | $version = $version[0]; |
| 66 | - if (empty($yui_path[$version])) continue; |
|
| 71 | + if (empty($yui_path[$version])) { |
|
| 72 | + continue; |
|
| 73 | + } |
|
| 67 | 74 | |
| 68 | 75 | $path = $yui_path[$version] . substr($param, strlen($version)); |
| 69 | 76 | |
| 70 | 77 | $extension = substr($path, strrpos($path, "_") + 1); |
| 71 | 78 | |
| 72 | 79 | //Only allowed file extensions |
| 73 | - if (empty($types[$extension])) |
|
| 74 | - continue; |
|
| 80 | + if (empty($types[$extension])) { |
|
| 81 | + continue; |
|
| 82 | + } |
|
| 75 | 83 | |
| 76 | 84 | if (empty($contentType)) |
| 77 | 85 | { |
@@ -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. |
@@ -121,10 +123,12 @@ discard block |
||
| 121 | 123 | // load language files |
| 122 | 124 | $this->loadLanguage($classname, 'modules/Charts/Dashlets/'); |
| 123 | 125 | |
| 124 | - if ( empty($options['title']) ) |
|
| 125 | - $this->title = $this->dashletStrings['LBL_TITLE']; |
|
| 126 | - if ( isset($options['autoRefresh']) ) |
|
| 127 | - $this->autoRefresh = $options['autoRefresh']; |
|
| 126 | + if ( empty($options['title']) ) { |
|
| 127 | + $this->title = $this->dashletStrings['LBL_TITLE']; |
|
| 128 | + } |
|
| 129 | + if ( isset($options['autoRefresh']) ) { |
|
| 130 | + $this->autoRefresh = $options['autoRefresh']; |
|
| 131 | + } |
|
| 128 | 132 | |
| 129 | 133 | $this->layoutManager = new LayoutManager(); |
| 130 | 134 | $this->layoutManager->setAttribute('context', 'Report'); |
@@ -140,8 +144,8 @@ discard block |
||
| 140 | 144 | public function setRefreshIcon() |
| 141 | 145 | { |
| 142 | 146 | $additionalTitle = ''; |
| 143 | - if($this->isRefreshable) |
|
| 144 | - |
|
| 147 | + if($this->isRefreshable) { |
|
| 148 | + |
|
| 145 | 149 | $additionalTitle .= '<a href="#" onclick="SUGAR.mySugar.retrieveDashlet(\'' |
| 146 | 150 | . $this->id |
| 147 | 151 | . '\',\'predefined_chart\'); return false;"><!--not_in_theme!-->' |
@@ -154,6 +158,7 @@ discard block |
||
| 154 | 158 | translate('LBL_DASHLET_REFRESH', 'Home') |
| 155 | 159 | ) |
| 156 | 160 | . '</a>'; |
| 161 | + } |
|
| 157 | 162 | return $additionalTitle; |
| 158 | 163 | } |
| 159 | 164 | |
@@ -200,25 +205,32 @@ discard block |
||
| 200 | 205 | |
| 201 | 206 | $options = array(); |
| 202 | 207 | |
| 203 | - foreach($req as $name => $value) |
|
| 204 | - if(!is_array($value)) $req[$name] = trim($value); |
|
| 208 | + foreach($req as $name => $value) { |
|
| 209 | + if(!is_array($value)) $req[$name] = trim($value); |
|
| 210 | + } |
|
| 205 | 211 | |
| 206 | 212 | foreach($this->_searchFields as $name => $params) { |
| 207 | 213 | $widgetDef = $params; |
| 208 | - if ( isset($this->getSeedBean()->field_defs[$name]) ) |
|
| 209 | - $widgetDef = $this->getSeedBean()->field_defs[$name]; |
|
| 210 | - if ( $widgetDef['type'] == 'date') // special case date types |
|
| 214 | + if ( isset($this->getSeedBean()->field_defs[$name]) ) { |
|
| 215 | + $widgetDef = $this->getSeedBean()->field_defs[$name]; |
|
| 216 | + } |
|
| 217 | + if ( $widgetDef['type'] == 'date') { |
|
| 218 | + // special case date types |
|
| 211 | 219 | $options[$widgetDef['name']] = $timedate->swap_formats($req['type_'.$widgetDef['name']], $timedate->get_date_format(), $timedate->dbDayFormat); |
| 212 | - elseif ( $widgetDef['type'] == 'time') // special case time types |
|
| 220 | + } elseif ( $widgetDef['type'] == 'time') { |
|
| 221 | + // special case time types |
|
| 213 | 222 | $options[$widgetDef['name']] = $timedate->swap_formats($req['type_'.$widgetDef['name']], $timedate->get_time_format(), $timedate->dbTimeFormat); |
| 214 | - elseif ( $widgetDef['type'] == 'datepicker') // special case datepicker types |
|
| 223 | + } elseif ( $widgetDef['type'] == 'datepicker') { |
|
| 224 | + // special case datepicker types |
|
| 215 | 225 | $options[$widgetDef['name']] = $timedate->swap_formats($req[$widgetDef['name']], $timedate->get_date_format(), $timedate->dbDayFormat); |
| 216 | - elseif (!empty($req[$widgetDef['name']])) |
|
| 217 | - $options[$widgetDef['name']] = $req[$widgetDef['name']]; |
|
| 226 | + } elseif (!empty($req[$widgetDef['name']])) { |
|
| 227 | + $options[$widgetDef['name']] = $req[$widgetDef['name']]; |
|
| 228 | + } |
|
| 218 | 229 | } |
| 219 | 230 | |
| 220 | - if (!empty($req['dashletTitle'])) |
|
| 221 | - $options['title'] = $req['dashletTitle']; |
|
| 231 | + if (!empty($req['dashletTitle'])) { |
|
| 232 | + $options['title'] = $req['dashletTitle']; |
|
| 233 | + } |
|
| 222 | 234 | |
| 223 | 235 | $options['autoRefresh'] = empty($req['autoRefresh']) ? '0' : $req['autoRefresh']; |
| 224 | 236 | |
@@ -241,19 +253,24 @@ discard block |
||
| 241 | 253 | $currentSearchFields[$name] = array(); |
| 242 | 254 | |
| 243 | 255 | $widgetDef = $params; |
| 244 | - if ( isset($this->getSeedBean()->field_defs[$name]) ) |
|
| 245 | - $widgetDef = $this->getSeedBean()->field_defs[$name]; |
|
| 256 | + if ( isset($this->getSeedBean()->field_defs[$name]) ) { |
|
| 257 | + $widgetDef = $this->getSeedBean()->field_defs[$name]; |
|
| 258 | + } |
|
| 246 | 259 | |
| 247 | - if($widgetDef['type'] == 'enum' || $widgetDef['type'] == 'singleenum') $widgetDef['remove_blank'] = true; // remove the blank option for the dropdown |
|
| 260 | + if($widgetDef['type'] == 'enum' || $widgetDef['type'] == 'singleenum') { |
|
| 261 | + $widgetDef['remove_blank'] = true; |
|
| 262 | + } |
|
| 263 | + // remove the blank option for the dropdown |
|
| 248 | 264 | |
| 249 | - if ( empty($widgetDef['input_name0']) ) |
|
| 250 | - $widgetDef['input_name0'] = empty($this->$name) ? '' : $this->$name; |
|
| 265 | + if ( empty($widgetDef['input_name0']) ) { |
|
| 266 | + $widgetDef['input_name0'] = empty($this->$name) ? '' : $this->$name; |
|
| 267 | + } |
|
| 251 | 268 | $currentSearchFields[$name]['label'] = translate($widgetDef['vname'], $this->getSeedBean()->module_dir); |
| 252 | - if ( $currentSearchFields[$name]['label'] == $widgetDef['vname'] ) |
|
| 253 | - $currentSearchFields[$name]['label'] = translate($widgetDef['vname'], 'Charts'); |
|
| 269 | + if ( $currentSearchFields[$name]['label'] == $widgetDef['vname'] ) { |
|
| 270 | + $currentSearchFields[$name]['label'] = translate($widgetDef['vname'], 'Charts'); |
|
| 271 | + } |
|
| 254 | 272 | $currentSearchFields[$name]['input'] = $this->layoutManager->widgetDisplayInput($widgetDef, true, (empty($this->$name) ? '' : $this->$name)); |
| 255 | - } |
|
| 256 | - else { // ability to create spacers in input fields |
|
| 273 | + } else { // ability to create spacers in input fields |
|
| 257 | 274 | $currentSearchFields['blank' + $count]['label'] = ''; |
| 258 | 275 | $currentSearchFields['blank' + $count]['input'] = ''; |
| 259 | 276 | $count++; |
@@ -289,8 +306,9 @@ discard block |
||
| 289 | 306 | */ |
| 290 | 307 | protected function getSeedBean() |
| 291 | 308 | { |
| 292 | - if ( !($this->_seedBean instanceof SugarBean) ) |
|
| 293 | - $this->_seedBean = SugarModule::get($this->_seedName)->loadBean(); |
|
| 309 | + if ( !($this->_seedBean instanceof SugarBean) ) { |
|
| 310 | + $this->_seedBean = SugarModule::get($this->_seedName)->loadBean(); |
|
| 311 | + } |
|
| 294 | 312 | |
| 295 | 313 | return $this->_seedBean; |
| 296 | 314 | } |
@@ -412,9 +430,14 @@ discard block |
||
| 412 | 430 | } |
| 413 | 431 | |
| 414 | 432 | //if(isset($sortby1[0]) && $sortby1[0]=='') unset($sortby1[0]);//the beginning of lead_source_dom is blank. |
| 415 | - if(isset($sortby1[0]) && $sortby1[0]==array()) unset($sortby1[0]);//the beginning of month after search is blank. |
|
| 433 | + if(isset($sortby1[0]) && $sortby1[0]==array()) { |
|
| 434 | + unset($sortby1[0]); |
|
| 435 | + } |
|
| 436 | + //the beginning of month after search is blank. |
|
| 416 | 437 | |
| 417 | - if($ifsort2==false) $sortby2=array(0); |
|
| 438 | + if($ifsort2==false) { |
|
| 439 | + $sortby2=array(0); |
|
| 440 | + } |
|
| 418 | 441 | |
| 419 | 442 | if($keycolname2!=null) { |
| 420 | 443 | $sortby2 = array(); |
@@ -438,7 +461,9 @@ discard block |
||
| 438 | 461 | |
| 439 | 462 | foreach($sortby1 as $sort1) { |
| 440 | 463 | foreach($sortby2 as $sort2) { |
| 441 | - if($ifsort2) $a=0; |
|
| 464 | + if($ifsort2) { |
|
| 465 | + $a=0; |
|
| 466 | + } |
|
| 442 | 467 | foreach($data_set as $key => $value){ |
| 443 | 468 | if($value[$keycolname1] == $sort1 && (!$ifsort2 || $value[$keycolname2]== $sort2)) { |
| 444 | 469 | if($translate1) { |
@@ -461,15 +486,13 @@ discard block |
||
| 461 | 486 | if($translate1) { |
| 462 | 487 | $val[$keycolname1] = $app_list_strings[$keycolname1.'_dom'][$sort1]; |
| 463 | 488 | $val[$keycolname1.'_dom_option'] = $sort1; |
| 464 | - } |
|
| 465 | - else { |
|
| 489 | + } else { |
|
| 466 | 490 | $val[$keycolname1] = $sort1; |
| 467 | 491 | } |
| 468 | 492 | if($translate2) { |
| 469 | 493 | $val[$keycolname2] = $app_list_strings[$keycolname2.'_dom'][$sort2]; |
| 470 | 494 | $val[$keycolname2.'_dom_option'] = $sort2; |
| 471 | - } |
|
| 472 | - elseif($keycolname2!=null) { |
|
| 495 | + } elseif($keycolname2!=null) { |
|
| 473 | 496 | $val[$keycolname2] = $sort2; |
| 474 | 497 | } |
| 475 | 498 | array_push($data, $val); |
@@ -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. |
@@ -73,8 +75,9 @@ discard block |
||
| 73 | 75 | if(is_file(preg_replace('/(.*\/.*)(\.php)/Uis', '$1.meta$2', $file))) { // is there an associated meta data file? |
| 74 | 76 | $dashletFiles[$class]['meta'] = preg_replace('/(.*\/.*)(\.php)/Uis', '$1.meta$2', $file); |
| 75 | 77 | require($dashletFiles[$class]['meta']); |
| 76 | - if ( isset($dashletMeta[$class]['module']) ) |
|
| 77 | - $dashletFiles[$class]['module'] = $dashletMeta[$class]['module']; |
|
| 78 | + if ( isset($dashletMeta[$class]['module']) ) { |
|
| 79 | + $dashletFiles[$class]['module'] = $dashletMeta[$class]['module']; |
|
| 80 | + } |
|
| 78 | 81 | } |
| 79 | 82 | |
| 80 | 83 | $filesInDirectory = array(); |
@@ -68,15 +68,18 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - if (!isset($options) && !isset($values)) |
|
| 72 | - return ''; /* raise error here? */ |
|
| 71 | + if (!isset($options) && !isset($values)) { |
|
| 72 | + return ''; |
|
| 73 | + } |
|
| 74 | + /* raise error here? */ |
|
| 73 | 75 | |
| 74 | 76 | $_html_result = ''; |
| 75 | 77 | |
| 76 | 78 | if (isset($options)) { |
| 77 | 79 | |
| 78 | - foreach ($options as $_key=>$_val) |
|
| 79 | - $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected); |
|
| 80 | + foreach ($options as $_key=>$_val) { |
|
| 81 | + $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected); |
|
| 82 | + } |
|
| 80 | 83 | |
| 81 | 84 | } else { |
| 82 | 85 | |
@@ -99,8 +102,9 @@ discard block |
||
| 99 | 102 | if(!is_array($value)) { |
| 100 | 103 | $_html_result = '<option label="' . smarty_function_escape_special_chars($value) . '" value="' . |
| 101 | 104 | smarty_function_escape_special_chars($key) . '"'; |
| 102 | - if (in_array((string)$key, $selected)) |
|
| 103 | - $_html_result .= ' selected="selected"'; |
|
| 105 | + if (in_array((string)$key, $selected)) { |
|
| 106 | + $_html_result .= ' selected="selected"'; |
|
| 107 | + } |
|
| 104 | 108 | $_html_result .= '>' . smarty_function_escape_special_chars($value) . '</option>' . "\n"; |
| 105 | 109 | } else { |
| 106 | 110 | $_html_result = smarty_function_html_options_optgroup($key, $value, $selected); |
@@ -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 | } |