Changeset View
Changeset View
Standalone View
Standalone View
core/kernel/db/db_tag_processor.php
Show First 20 Lines • Show All 478 Lines • ▼ Show 20 Line(s) | |||||
$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_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 = $this->prepareTagParams($params); | ||||
$block_empty_cell_params['name'] = $this->SelectParam($params, 'empty_cell_render_as,block_empty_cell,empty_cell_block'); | $block_empty_cell_params['name'] = $this->SelectParam($params, 'empty_cell_render_as,block_empty_cell,empty_cell_block'); | ||||
$i = 0; | $i = 0; | ||||
$is_web_request = $this->Application->isWebRequest(); | |||||
if ( $is_web_request ) { | |||||
$backup_id = $this->Application->GetVar($this->Prefix . '_id'); | $backup_id = $this->Application->GetVar($this->Prefix . '_id'); | ||||
} | |||||
$displayed = Array (); | $displayed = Array (); | ||||
$column_number = 1; | $column_number = 1; | ||||
$cache_mod_rw = $config->getCacheModRewrite() && $this->Application->RewriteURLs() && !$this->Application->isCachingType(CACHING_TYPE_MEMORY); | $cache_mod_rw = $config->getCacheModRewrite() && $this->Application->RewriteURLs() && !$this->Application->isCachingType(CACHING_TYPE_MEMORY); | ||||
$limit = isset($params['limit']) ? $params['limit'] : false; | $limit = isset($params['limit']) ? $params['limit'] : false; | ||||
while (!$list->EOL() && (!$limit || $i<$limit)) { | while ( !$list->EOL() && (!$limit || $i < $limit) ) { | ||||
$this->Application->SetVar($this->getPrefixSpecial() . '_id', $list->GetDBField($id_field)); // for edit/delete links using GET | if ( $is_web_request ) { | ||||
// For edit/delete links using GET. | |||||
$this->Application->SetVar($this->getPrefixSpecial() . '_id', $list->GetDBField($id_field)); | |||||
$this->Application->SetVar($this->Prefix . '_id', $list->GetDBField($id_field)); | $this->Application->SetVar($this->Prefix . '_id', $list->GetDBField($id_field)); | ||||
} | |||||
$block_params['is_last'] = ($i == $list->GetSelectedCount() - 1); | $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 | $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); | $serial_name = $this->Application->incrementCacheSerial($this->Prefix, $list->GetDBField($id_field), false); | ||||
if ( $this->Prefix == 'c' ) { | if ( $this->Prefix == 'c' ) { | ||||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | |||||
if ( ($i + 1) % $columns == 0 ) { | if ( ($i + 1) % $columns == 0 ) { | ||||
// record in next iteration is first in row too, then close this row | // record in next iteration is first in row too, then close this row | ||||
$o .= $block_end_row_params['name'] ? $this->Application->ParseBlock($block_end_row_params) : '</tr>'; | $o .= $block_end_row_params['name'] ? $this->Application->ParseBlock($block_end_row_params) : '</tr>'; | ||||
} | } | ||||
$i++; | $i++; | ||||
} | } | ||||
if ( $is_web_request ) { | |||||
$cur_displayed = $this->Application->GetVar($this->Prefix . '_displayed_ids'); | $cur_displayed = $this->Application->GetVar($this->Prefix . '_displayed_ids'); | ||||
if ( !$cur_displayed ) { | if ( !$cur_displayed ) { | ||||
$cur_displayed = Array (); | $cur_displayed = array(); | ||||
} | } | ||||
else { | else { | ||||
$cur_displayed = explode(',', $cur_displayed); | $cur_displayed = explode(',', $cur_displayed); | ||||
} | } | ||||
$displayed = array_unique(array_merge($displayed, $cur_displayed)); | $displayed = array_unique(array_merge($displayed, $cur_displayed)); | ||||
$this->Application->SetVar($this->Prefix . '_displayed_ids', implode(',', $displayed)); | $this->Application->SetVar($this->Prefix . '_displayed_ids', implode(',', $displayed)); | ||||
$this->Application->SetVar($this->Prefix . '_id', $backup_id); | $this->Application->SetVar($this->Prefix . '_id', $backup_id); | ||||
$this->Application->SetVar($this->getPrefixSpecial() . '_id', ''); | $this->Application->SetVar($this->getPrefixSpecial() . '_id', ''); | ||||
} | |||||
if ( isset($params['more_link_render_as']) ) { | if ( isset($params['more_link_render_as']) ) { | ||||
$block_params = $params; | $block_params = $params; | ||||
$params['render_as'] = $params['more_link_render_as']; | $params['render_as'] = $params['more_link_render_as']; | ||||
$o .= $this->MoreLink($params); | $o .= $this->MoreLink($params); | ||||
} | } | ||||
return $o; | return $o; | ||||
▲ Show 20 Lines • Show All 2532 Lines • Show Last 20 Lines |