Index: branches/5.2.x/core/kernel/db/db_tag_processor.php =================================================================== diff -u -N -r14892 -r14905 --- branches/5.2.x/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 14892) +++ branches/5.2.x/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 14905) @@ -1,6 +1,6 @@ Application->GetVar('NamesToSpecialMapping'); + $names_mapping = $this->Application->GetVar('NamesToSpecialMapping', Array ()); - if( !getArrayValue($names_mapping, $this->Prefix, $list_name) ) - { + if ( getArrayValue($names_mapping, $this->Prefix, $list_name) === false ) { $list =& $this->GetList($params); } } @@ -346,23 +345,23 @@ function &GetList($params) { $list_name = $this->SelectParam($params, 'list_name,name'); - if (!$list_name) { + if ( !$list_name ) { $list_name = $this->Application->Parser->GetParam('list_name'); } $requery = isset($params['requery']) && $params['requery']; $main_list = array_key_exists('main_list', $params) && $params['main_list']; - if ($list_name && !$requery) { - // list with "list_name" parameter - $names_mapping = $this->Application->GetVar('NamesToSpecialMapping', Array ()); + $names_mapping = $this->Application->GetVar('NamesToSpecialMapping', Array ()); - if (!array_key_exists($this->Prefix, $names_mapping)) { - // create prefix-based array to special mapping storage - $names_mapping[$this->Prefix] = Array (); - } + if ( !array_key_exists($this->Prefix, $names_mapping) ) { + // create prefix-based array to special mapping storage + $names_mapping[$this->Prefix] = Array (); + } - if (!array_key_exists($list_name, $names_mapping[$this->Prefix])) { + if ( $list_name && !$requery ) { + // list with "list_name" parameter + if ( !array_key_exists($list_name, $names_mapping[$this->Prefix]) ) { // special missing -> generate one $special = $main_list ? $this->Special : $this->BuildListSpecial($params); } @@ -376,31 +375,31 @@ $special = $main_list ? $this->Special : $this->BuildListSpecial($params); } - $prefix_special = rtrim($this->Prefix.'.'.$special, '.'); + $prefix_special = rtrim($this->Prefix . '.' . $special, '.'); $params['skip_counting'] = true; - $list =& $this->Application->recallObject( $prefix_special, $this->Prefix.'_List', $params); + $list =& $this->Application->recallObject($prefix_special, $this->Prefix . '_List', $params); /* @var $list kDBList */ - if (!array_key_exists('skip_quering', $params) || !$params['skip_quering']) { - if ($requery) { - $this->Application->HandleEvent($an_event, $prefix_special.':OnListBuild', $params); + if ( !array_key_exists('skip_quering', $params) || !$params['skip_quering'] ) { + if ( $requery ) { + $this->Application->HandleEvent($an_event, $prefix_special . ':OnListBuild', $params); } - if (array_key_exists('offset', $params)) { - $list->SetOffset( $list->GetOffset() + $params['offset'] ); // apply custom offset + if ( array_key_exists('offset', $params) ) { + $list->SetOffset($list->GetOffset() + $params['offset']); // apply custom offset } $list->Query($requery); - if (array_key_exists('offset', $params)) { - $list->SetOffset( $list->GetOffset() - $params['offset'] ); // remove custom offset + if ( array_key_exists('offset', $params) ) { + $list->SetOffset($list->GetOffset() - $params['offset']); // remove custom offset } } $this->Init($this->Prefix, $special); - if ($list_name) { + if ( $list_name ) { $names_mapping[$this->Prefix][$list_name] = $special; $this->Application->SetVar('NamesToSpecialMapping', $names_mapping); }