Index: db_tag_processor.php =================================================================== --- db_tag_processor.php (revision 14917) +++ db_tag_processor.php (working copy) @@ -451,17 +451,19 @@ function PrintList2($params) { $per_page = $this->SelectParam($params, 'per_page,max_items'); - if ($per_page !== false) $params['per_page'] = $per_page; + if ( $per_page !== false ) { + $params['per_page'] = $per_page; + } $list =& $this->GetList($params); $o = ''; - $direction = (isset($params['direction']) && $params['direction']=="H")?"H":"V"; - $columns = (isset($params['columns'])) ? $params['columns'] : 1; + $direction = (isset($params['direction']) && $params['direction'] == "H") ? "H" : "V"; + $columns = (isset($params['columns'])) ? $params['columns'] : 1; $id_field = (isset($params['id_field'])) ? $params['id_field'] : $this->Application->getUnitOption($this->Prefix, 'IDField'); - if ($columns > 1 && $direction == 'V') { + if ( $columns > 1 && $direction == 'V' ) { $records_left = array_splice($list->Records, $list->GetSelectedCount()); // because we have 1 more record for "More..." link detection (don't need to sort it) $list->Records = $this->LinearToVertical($list->Records, $columns, $list->GetPerPage()); $list->Records = array_merge($list->Records, $records_left); @@ -469,23 +471,23 @@ $list->GoFirst(); - $block_params=$this->prepareTagParams($params); + $block_params = $this->prepareTagParams($params); $block_params['name'] = $this->SelectParam($params, 'render_as,block'); $block_params['pass_params'] = 'true'; $block_params['column_width'] = $params['column_width'] = 100 / $columns; $block_start_row_params = $this->prepareTagParams($params); $block_start_row_params['name'] = $this->SelectParam($params, 'row_start_render_as,block_row_start,row_start_block'); - $block_end_row_params=$this->prepareTagParams($params); + $block_end_row_params = $this->prepareTagParams($params); $block_end_row_params['name'] = $this->SelectParam($params, 'row_end_render_as,block_row_end,row_end_block'); $block_empty_cell_params = $this->prepareTagParams($params); $block_empty_cell_params['name'] = $this->SelectParam($params, 'empty_cell_render_as,block_empty_cell,empty_cell_block'); - $i=0; + $i = 0; - $backup_id=$this->Application->GetVar($this->Prefix."_id"); - $displayed = array(); + $backup_id = $this->Application->GetVar($this->Prefix . '_id'); + $displayed = Array (); $column_number = 1; $cache_mod_rw = $this->Application->getUnitOption($this->Prefix, 'CacheModRewrite') && @@ -494,20 +496,21 @@ $limit = isset($params['limit']) ? $params['limit'] : false; while (!$list->EOL() && (!$limit || $i<$limit)) { - $this->Application->SetVar( $this->getPrefixSpecial().'_id', $list->GetDBField($id_field) ); // for edit/delete links using GET - $this->Application->SetVar( $this->Prefix.'_id', $list->GetDBField($id_field) ); + $this->Application->SetVar($this->getPrefixSpecial() . '_id', $list->GetDBField($id_field)); // for edit/delete links using GET + $this->Application->SetVar($this->Prefix . '_id', $list->GetDBField($id_field)); $block_params['is_last'] = ($i == $list->GetSelectedCount() - 1); - $block_params['last_row'] = ($i + (($i+1) % $columns) >= $list->GetSelectedCount() - 1); + $block_params['last_row'] = ($i + (($i + 1) % $columns) >= $list->GetSelectedCount() - 1); $block_params['not_last'] = !$block_params['is_last']; // for front-end - if ($cache_mod_rw) { + if ( $cache_mod_rw ) { $serial_name = $this->Application->incrementCacheSerial($this->Prefix, $list->GetDBField($id_field), false); - if ($this->Prefix == 'c') { + if ( $this->Prefix == 'c' ) { // for listing subcategories in category - $this->Application->setCache('filenames[%' . $serial_name . '%]' , $list->GetDBField('NamedParentPath')); + $this->Application->setCache('filenames[%' . $serial_name . '%]', $list->GetDBField('NamedParentPath')); $this->Application->setCache('category_tree[%CIDSerial:' . $list->GetDBField($id_field) . '%]', $list->GetDBField('TreeLeft') . ';' . $list->GetDBField('TreeRight')); - } else { + } + else { // for listing items in category $this->Application->setCache('filenames[%' . $serial_name . '%]', $list->GetDBField('Filename')); @@ -516,12 +519,10 @@ } } - if ($i % $columns == 0) { + if ( $i % $columns == 0 ) { // record in this iteration is first in row, then open row $column_number = 1; - $o.= $block_start_row_params['name'] ? - $this->Application->ParseBlock($block_start_row_params) : - (!isset($params['no_table']) ? '