Index: kernel/db/db_event_handler.php =================================================================== --- kernel/db/db_event_handler.php (revision 14893) +++ kernel/db/db_event_handler.php (working copy) @@ -683,6 +683,11 @@ $object =& $event->getObject(); /* @var $object kDBList */ + /*if ( $this->Application->isDebugMode() ) { + $event_params = http_build_query($event->getEventParams()); + $this->Application->Debugger->appendHTML('InitList "' . $event->getPrefixSpecial() . '" (' . $event_params . ')'); + }*/ + $this->dbBuild($object, $event); if ( !$object->isMainList() && $event->getEventParam('main_list') ) { Index: kernel/db/db_tag_processor.php =================================================================== --- kernel/db/db_tag_processor.php (revision 14892) +++ kernel/db/db_tag_processor.php (working copy) @@ -305,10 +305,9 @@ { $list_name = isset($params['list_name']) ? $params['list_name'] : ''; - $names_mapping = $this->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); } Index: kernel/globals.php =================================================================== --- kernel/globals.php (revision 14888) +++ kernel/globals.php (working copy) @@ -691,12 +691,12 @@ { $ret = isset($array[$key]) ? $array[$key] : false; - if ($ret && func_num_args() > 2) { + if ( $ret && func_num_args() > 2 ) { for ($i = 2; $i < func_num_args(); $i++) { $cur_key = func_get_arg($i); - $ret = getArrayValue( $ret, $cur_key ); + $ret = getArrayValue($ret, $cur_key); - if ($ret === false) { + if ( $ret === false ) { break; } } Index: kernel/utility/event.php =================================================================== --- kernel/utility/event.php (revision 14888) +++ kernel/utility/event.php (working copy) @@ -225,6 +225,17 @@ } /** + * Returns all event parameters + * + * @return Array + * @access public + */ + public function getEventParams() + { + return $this->specificParams; + } + + /** * Set's pseudo class that differs from * the one specified in $Prefix * Index: units/visits/visits_tag_processor.php =================================================================== --- units/visits/visits_tag_processor.php (revision 14888) +++ units/visits/visits_tag_processor.php (working copy) @@ -28,9 +28,9 @@ /** * Returns link for user editing - * + * * @param Array $params - * + * * @return string * @access protected */ @@ -164,20 +164,19 @@ 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'); } + $types = $this->SelectParam($params, 'types'); - $special=''; - if ($types=='myvisitororders' || $types=='myvisitors'){ + + if ( $types == 'myvisitororders' || $types == 'myvisitors' ) { $special = 'incommerce'; - $names_mapping = $this->Application->GetVar('NamesToSpecialMapping'); + $names_mapping = $this->Application->GetVar('NamesToSpecialMapping', Array ()); $names_mapping[$this->Prefix][$list_name] = $special; $this->Application->SetVar('NamesToSpecialMapping', $names_mapping); - } return parent::GetList($params); } - } \ No newline at end of file