Index: branches/5.2.x/core/units/configuration/configuration_tag_processor.php =================================================================== diff -u -N -r14596 -r15128 --- branches/5.2.x/core/units/configuration/configuration_tag_processor.php (.../configuration_tag_processor.php) (revision 14596) +++ branches/5.2.x/core/units/configuration/configuration_tag_processor.php (.../configuration_tag_processor.php) (revision 15128) @@ -1,6 +1,6 @@ GetList($params); - $id_field = $this->Application->getUnitOption($this->Prefix,'IDField'); + $id_field = $this->Application->getUnitOption($this->Prefix, 'IDField'); $list->Query(); $o = ''; $list->GoFirst(); - $block_params=$this->prepareTagParams($params); + $block_params = $this->prepareTagParams($params); $block_params['pass_params'] = 'true'; $block_params['IdField'] = $list->IDField; $prev_heading = ''; $next_block = $params['full_block']; $list->groupRecords('Heading'); - $field_values = $this->Application->GetVar( $this->getPrefixSpecial(true) ); + $field_values = $this->Application->GetVar($this->getPrefixSpecial(true)); while (!$list->EOL()) { - $this->Application->SetVar( $this->getPrefixSpecial() . '_id', $list->GetDBField($id_field) ); // for edit/delete links using GET + $this->Application->SetVar($this->getPrefixSpecial() . '_id', $list->GetDBField($id_field)); // for edit/delete links using GET // using 2 blocks for drawing o row in case if current & next record titles match $next_record =& $list->getCurrentRecord(1); + $this_key = $list->GetDBField('Prompt') . ':' . $list->GetDBField('DisplayOrder'); + $next_key = $next_record !== false ? $next_record['Prompt'] . ':' . $next_record['DisplayOrder'] : ''; - $next_item_prompt = $next_record !== false ? $next_record['Prompt'] : ''; - $this_item_prompt = $list->GetDBField('Prompt'); - - if ($next_item_prompt == $this_item_prompt) { + if ( $next_key == $this_key ) { $curr_block = $params['half_block1']; $next_block = $params['half_block2']; - } else { + } + else { $curr_block = $next_block; $next_block = $params['full_block']; } $variable_name = $list->GetDBField('VariableName'); // allows to override value part of block - if ($this->Application->ParserBlockFound('cf_' . $variable_name . '_value')) { + if ( $this->Application->ParserBlockFound('cf_' . $variable_name . '_value') ) { $block_params['value_render_as'] = 'cf_' . $variable_name . '_value'; } else { $block_params['value_render_as'] = $params['value_render_as']; } // allow to completely override whole block - if ($this->Application->ParserBlockFound('cf_' . $variable_name . '_element')) { + if ( $this->Application->ParserBlockFound('cf_' . $variable_name . '_element') ) { $block_params['name'] = 'cf_' . $variable_name . '_element'; $block_params['original_render_as'] = $curr_block; } @@ -85,15 +85,15 @@ $block_params['original_render_as'] = $curr_block; } - $block_params['show_heading'] = ($prev_heading != $list->GetDBField('Heading') ) ? 1 : 0; + $block_params['show_heading'] = ($prev_heading != $list->GetDBField('Heading')) ? 1 : 0; // set values from submit if any - if ($field_values) { - $list->SetDBField('VariableValue', $field_values[ $list->GetID() ]['VariableValue']); + if ( $field_values ) { + $list->SetDBField('VariableValue', $field_values[$list->GetID()]['VariableValue']); } $list->SetDBField('DirectOptions', ''); - $o.= $this->Application->ParseBlock($block_params); + $o .= $this->Application->ParseBlock($block_params); $prev_heading = $list->GetDBField('Heading'); $list->GoNext(); }