Index: trunk/kernel/units/config_search/config_search_tag_processor.php =================================================================== diff -u -N -r1566 -r4043 --- trunk/kernel/units/config_search/config_search_tag_processor.php (.../config_search_tag_processor.php) (revision 1566) +++ trunk/kernel/units/config_search/config_search_tag_processor.php (.../config_search_tag_processor.php) (revision 4043) @@ -2,48 +2,42 @@ class ConfigSearchTagProcessor extends kDBTagProcessor { + /** + * Prints list content using block specified + * + * @param Array $params + * @return string + * @access public + */ function PrintList($params) { - $list =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix.'_List',$params); + $list =& $this->GetList($params); $id_field = $this->Application->getUnitOption($this->Prefix,'IDField'); - $prefix_special = $this->getPrefixSpecial(); - if ( !($list->OriginalParams == $params) ) { - $this->Application->removeObject($prefix_special); - $list =& $this->Application->recallObject($prefix_special,$this->Prefix.'_List',$params); - } - $list->Query(); $o = ''; $list->GoFirst(); + + $block_params = $this->prepareTagParams($params); + $block_params['name'] = $this->SelectParam($params, 'render_as,block'); + $block_params['pass_params'] = 'true'; - $block_params=$this->prepareTagParams($params); - $block_params['name']=$params['block']; - $block_params['pass_params']='true'; + $this->groupRecords($list->Records, 'ConfigHeader'); + $prev_heading = ''; - $prev_title=""; - - while (!$list->EOL()) + while (!$list->EOL()) { - $this_title=$list->Records[$list->CurrentIndex]['ConfigHeader']; - - if ($this_title!=$prev_title){ - $prev_title=$this_title; - $section_header_params=array(); - $section_header_params['name']='config_section_header'; - $section_header_params['title']=$this->Application->Phrase($this_title); - $o.= $this->Application->ParseBlock($section_header_params, 1); - } - $this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); // for edit/delete links using GET + $block_params['show_heading'] = ($prev_heading != $list->GetDBField('ConfigHeader') ) ? 1 : 0; + $o.= $this->Application->ParseBlock($block_params, 1); + $prev_heading = $list->GetDBField('ConfigHeader'); $list->GoNext(); } - + $this->Application->SetVar( $this->getPrefixSpecial().'_id', ''); - return $o; + return $o; } - } ?> \ No newline at end of file