Index: branches/5.2.x/core/kernel/db/cat_event_handler.php =================================================================== diff -u -N -r15049 -r15065 --- branches/5.2.x/core/kernel/db/cat_event_handler.php (.../cat_event_handler.php) (revision 15049) +++ branches/5.2.x/core/kernel/db/cat_event_handler.php (.../cat_event_handler.php) (revision 15065) @@ -1,6 +1,6 @@ Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) ) { $event->status = kEvent::erFAIL; @@ -854,7 +854,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(&$event) + protected function OnBeforeItemUpdate(kEvent &$event) { parent::OnBeforeItemUpdate($event); @@ -891,7 +891,7 @@ * @return void * @access protected */ - protected function OnAfterItemLoad(&$event) + protected function OnAfterItemLoad(kEvent &$event) { parent::OnAfterItemLoad($event); @@ -959,10 +959,13 @@ * Occurs after updating item * * @param kEvent $event - * @access public + * @return void + * @access protected */ - function OnAfterItemUpdate(&$event) + protected function OnAfterItemUpdate(kEvent &$event) { + parent::OnAfterItemUpdate($event); + $this->CalculateHotLimit($event); if ( substr($event->Special, -6) == 'import' ) { @@ -1019,7 +1022,7 @@ * @return void * @access protected */ - protected function OnAfterItemCreate(&$event) + protected function OnAfterItemCreate(kEvent &$event) { parent::OnAfterItemCreate($event); @@ -1882,26 +1885,28 @@ * Shows export dialog * * @param kEvent $event + * @return void + * @access protected */ - function OnExport(&$event) + protected function OnExport(kEvent &$event) { $selected_ids = $this->StoreSelectedIDs($event); - if (implode(',', $selected_ids) == '') { + if ( implode(',', $selected_ids) == '' ) { // K4 fix when no ids found bad selected ids array is formed $selected_ids = false; } $selected_cats_ids = $this->Application->GetVar('export_categories'); - $this->Application->StoreVar($event->Prefix.'_export_ids', $selected_ids ? implode(',', $selected_ids) : '' ); - $this->Application->StoreVar($event->Prefix.'_export_cats_ids', $selected_cats_ids); + $this->Application->StoreVar($event->Prefix . '_export_ids', $selected_ids ? implode(',', $selected_ids) : ''); + $this->Application->StoreVar($event->Prefix . '_export_cats_ids', $selected_cats_ids); $export_helper =& $this->Application->recallObject('CatItemExportHelper'); /* @var $export_helper kCatDBItemExportHelper */ $redirect_params = Array ( - $this->Prefix.'.export_event' => 'OnNew', - 'pass' => 'all,'.$this->Prefix.'.export' + $this->Prefix . '.export_event' => 'OnNew', + 'pass' => 'all,' . $this->Prefix . '.export' ); $event->setRedirectParams($redirect_params); @@ -1951,12 +1956,15 @@ * * @param kEvent $event * @return Array + * @access protected */ - function getCustomExportColumns(&$event) + public function getCustomExportColumns(kEvent &$event) { - return Array( '__VIRTUAL__ThumbnailImage' => 'ThumbnailImage', - '__VIRTUAL__FullImage' => 'FullImage', - '__VIRTUAL__ImageAlt' => 'ImageAlt'); + return Array ( + '__VIRTUAL__ThumbnailImage' => 'ThumbnailImage', + '__VIRTUAL__FullImage' => 'FullImage', + '__VIRTUAL__ImageAlt' => 'ImageAlt' + ); } /** @@ -2043,8 +2051,10 @@ * Prepares item for import/export operations * * @param kEvent $event + * @return void + * @access protected */ - function OnNew(&$event) + protected function OnNew(kEvent &$event) { parent::OnNew($event); @@ -2132,8 +2142,8 @@ */ function OnCancelAction(&$event) { - $event->setRedirectParams(Array ('pass' => 'all,' . $event->getPrefixSpecial()), true); $event->redirect = $this->Application->GetVar('cancel_template'); + $event->SetRedirectParam('pass', 'all,' . $event->getPrefixSpecial()); } /* === RELATED TO IMPORT/EXPORT: END === */ @@ -2175,7 +2185,7 @@ * @return void * @access protected */ - protected function OnPreSave(&$event) + protected function OnPreSave(kEvent &$event) { parent::OnPreSave($event); @@ -2249,7 +2259,7 @@ * @return void * @access protected */ - protected function OnPreCreate(&$event) + protected function OnPreCreate(kEvent &$event) { parent::OnPreCreate($event); @@ -2296,7 +2306,7 @@ * @return void * @access protected */ - protected function OnBeforeClone(&$event) + protected function OnBeforeClone(kEvent &$event) { parent::OnBeforeClone($event); @@ -2317,7 +2327,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(&$event) + protected function OnBeforeItemCreate(kEvent &$event) { parent::OnBeforeItemCreate($event); @@ -2371,10 +2381,13 @@ * Creates category item & redirects to confirmation template (front-end only) * * @param kEvent $event + * @return void + * @access protected */ - function OnCreate(&$event) + protected function OnCreate(kEvent &$event) { parent::OnCreate($event); + $this->SetFrontRedirectTemplate($event, 'suggest'); } @@ -2538,7 +2551,7 @@ */ function SetFrontRedirectTemplate(&$event, $template_key) { - if ( $this->Application->isAdminUser || $event->status != kEvent::erSUCCESS ) { + if ( $this->Application->isAdmin || $event->status != kEvent::erSUCCESS ) { return; } @@ -2580,7 +2593,7 @@ * @return void * @access protected */ - protected function iterateItems(&$event) + protected function iterateItems(kEvent &$event) { if ( $event->Name != 'OnMassApprove' && $event->Name != 'OnMassDecline' ) { parent::iterateItems($event); @@ -2626,12 +2639,14 @@ * Deletes items & preserves clean env * * @param kEvent $event + * @return void + * @access protected */ - function OnDelete(&$event) + protected function OnDelete(kEvent &$event) { parent::OnDelete($event); - if ($event->status == kEvent::erSUCCESS && !$this->Application->isAdmin) { + if ( $event->status == kEvent::erSUCCESS && !$this->Application->isAdmin ) { $event->SetRedirectParam('pass', 'm'); $event->SetRedirectParam('m_cat_id', 0); } @@ -2899,12 +2914,14 @@ * [HOOK] Allows to add cloned subitem to given prefix * * @param kEvent $event + * @return void + * @access protected */ - function OnCloneSubItem(&$event) + protected function OnCloneSubItem(kEvent &$event) { parent::OnCloneSubItem($event); - if ($event->MasterEvent->Prefix == 'fav') { + if ( $event->MasterEvent->Prefix == 'fav' ) { $clones = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'Clones'); $subitem_prefix = $event->Prefix . '-' . $event->MasterEvent->Prefix;