Index: branches/5.2.x/core/kernel/db/cat_event_handler.php =================================================================== diff -u -N -r15016 -r15045 --- branches/5.2.x/core/kernel/db/cat_event_handler.php (.../cat_event_handler.php) (revision 15016) +++ branches/5.2.x/core/kernel/db/cat_event_handler.php (.../cat_event_handler.php) (revision 15045) @@ -1,6 +1,6 @@ getObject(); /* @var $object kDBList */ // get PerPage (forced -> session -> config -> 10) - $object->SetPerPage( $this->getPerPage($event) ); + $object->SetPerPage($this->getPerPage($event)); // main lists on Front-End have special get parameter for page $page = $object->isMainList() ? $this->Application->GetVar('page') : false; - if (!$page) { + if ( !$page ) { // page is given in "env" variable for given prefix $page = $this->Application->GetVar($event->getPrefixSpecial() . '_Page'); } - if (!$page && $event->Special) { + if ( !$page && $event->Special ) { // when not part of env, then variables like "prefix.special_Page" are // replaced (by PHP) with "prefix_special_Page", so check for that too $page = $this->Application->GetVar($event->getPrefixSpecial(true) . '_Page'); } - if (!$object->isMainList()) { + if ( !$object->isMainList() ) { // main lists doesn't use session for page storing $this->Application->StoreVarDefault($event->getPrefixSpecial() . '_Page', 1, true); // true for optional - if (!$page) { - if ($this->Application->RewriteURLs()) { + if ( !$page ) { + if ( $this->Application->RewriteURLs() ) { // when page not found by prefix+special, then try to search it without special at all $page = $this->Application->GetVar($event->Prefix . '_Page'); - if (!$page) { + if ( !$page ) { // page not found in request -> get from session $page = $this->Application->RecallVar($event->Prefix . '_Page'); } - if ($page) { + if ( $page ) { // page found in request -> store in session $this->Application->StoreVar($event->getPrefixSpecial() . '_Page', $page, true); //true for optional } @@ -1866,9 +1866,9 @@ // (such case is also processed in kDBList::Query method) $pages = $object->GetTotalPages(); - if ($page > $pages) { + if ( $page > $pages ) { $page = 1; - $this->Application->StoreVar($event->getPrefixSpecial().'_Page', 1, true); + $this->Application->StoreVar($event->getPrefixSpecial() . '_Page', 1, true); } } } @@ -2669,16 +2669,16 @@ } /** - * Set's correct sorting for list - * based on data provided with event + * Set's correct sorting for list based on data provided with event * * @param kEvent $event - * @access private - * @see OnListBuild + * @return void + * @access protected + * @see kDBEventHandler::OnListBuild() */ - function SetSorting(&$event) + protected function SetSorting(kEvent &$event) { - if (!$this->Application->isAdmin) { + if ( !$this->Application->isAdmin ) { $event->setEventParam('same_special', true); } @@ -2690,10 +2690,11 @@ * * @param kEvent $event * @return int + * @access protected */ - function getPerPage(&$event) + protected function getPerPage(kEvent &$event) { - if (!$this->Application->isAdmin) { + if ( !$this->Application->isAdmin ) { $event->setEventParam('same_special', true); }