Index: branches/5.2.x/core/units/categories/categories_event_handler.php =================================================================== diff -u -r14092 -r14095 --- branches/5.2.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 14092) +++ branches/5.2.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 14095) @@ -1,6 +1,6 @@ _prepareAutoPage($object, $template, null, SMS_MODE_AUTO, false); // create virtual (not system!) page if ($created) { if ($this->Application->ConfigValue('QuickCategoryPermissionRebuild') || !$this->Application->isAdmin) { - $updater =& $this->Application->recallObject('kPermCacheUpdater'); + $updater =& $this->Application->makeClass('kPermCacheUpdater'); /* @var $updater kPermCacheUpdater */ $updater->OneStepRun(); @@ -685,9 +685,10 @@ } if ($parent_path) { - $cache_updater =& $this->Application->recallObject('kPermCacheUpdater', null, array('strict_path' => $parent_path)); + $cache_updater =& $this->Application->makeClass('kPermCacheUpdater', Array (null, $parent_path)); + /* @var $cache_updater kPermCacheUpdater */ + $cache_updater->OneStepRun(); - $cache_updater->StrictPath = false; } } @@ -797,7 +798,7 @@ parent::OnSave($event); - if ($event->status != erSUCCESS) { + if ($event->status != kEvent::erSUCCESS) { return ; } @@ -989,7 +990,7 @@ function OnMassDelete(&$event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { - $event->status = erFAIL; + $event->status = kEvent::erFAIL; return; } @@ -1076,9 +1077,7 @@ $paste_event = new kEvent($prefix.':OnPaste', Array('clipboard_data' => $clipboard_data)); $this->Application->HandleEvent($paste_event); - $event->redirect = $paste_event->redirect; - $event->redirect_params = $paste_event->redirect_params; - $event->status = $paste_event->status; + $event->copyFrom($paste_event); } } @@ -1110,7 +1109,7 @@ function OnPaste(&$event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) || !$this->_checkPastePermission($event)) { - $event->status = erFAIL; + $event->status = kEvent::erFAIL; return ; } @@ -1169,7 +1168,7 @@ if ($clipboard_data['cut'] || $clipboard_data['copy']) { // rebuild with progress bar if ($this->Application->ConfigValue('QuickCategoryPermissionRebuild')) { - $updater =& $this->Application->recallObject('kPermCacheUpdater'); + $updater =& $this->Application->makeClass('kPermCacheUpdater'); /* @var $updater kPermCacheUpdater */ $updater->OneStepRun(); @@ -1272,7 +1271,7 @@ }*/ } else { - $event->status = erPERM_FAIL; + $event->status = kEvent::erPERM_FAIL; return ; } } @@ -1320,16 +1319,17 @@ { parent::OnCreate($event); - if ($this->Application->isAdminUser || $event->status != erSUCCESS) { + if ($this->Application->isAdminUser || $event->status != kEvent::erSUCCESS) { // don't sent email or rebuild cache directly after category is created by admin return ; } $object =& $event->getObject(); - $cache_updater =& $this->Application->recallObject('kPermCacheUpdater', null, array('strict_path' => $object->GetDBField('ParentPath'))); + $cache_updater =& $this->Application->makeClass('kPermCacheUpdater', Array (null, $object->GetDBField('ParentPath'))); + /* @var $cache_updater kPermCacheUpdater */ + $cache_updater->OneStepRun(); - $cache_updater->StrictPath = false; $is_active = ($object->GetDBField('Status') == STATUS_ACTIVE); @@ -1397,7 +1397,7 @@ } if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { - $event->status = erFAIL; + $event->status = kEvent::erFAIL; return; } @@ -1420,13 +1420,13 @@ $this->Conn->Query($sql); } - $event->status = erSUCCESS; + $event->status = kEvent::erSUCCESS; $email_event = $event->Name == 'OnMassApprove' ? 'CATEGORY.APPROVE' : 'CATEGORY.DENY'; $this->Application->EmailEventUser($email_event, $object->GetDBField('CreatedById')); } else { - $event->status = erFAIL; + $event->status = kEvent::erFAIL; $event->redirect = false; break; } @@ -1642,7 +1642,7 @@ $object =& $event->getObject(); if ( $object->GetDBField('Protected') && !$this->Application->isDebugMode() ) { - $event->status = erFAIL; + $event->status = kEvent::erFAIL; } } @@ -1829,7 +1829,7 @@ function OnResetCMSMenuCache(&$event) { if ($this->Application->GetVar('ajax') == 'yes') { - $event->status = erSTOP; + $event->status = kEvent::erSTOP; } $this->_resetMenuCache(); @@ -2033,7 +2033,7 @@ } if ($this->Application->ConfigValue('QuickCategoryPermissionRebuild')) { - $updater =& $this->Application->recallObject('kPermCacheUpdater'); + $updater =& $this->Application->makeClass('kPermCacheUpdater'); /* @var $updater kPermCacheUpdater */ $updater->OneStepRun(); @@ -2055,7 +2055,7 @@ function OnChangePriority(&$event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { - $event->status = erFAIL; + $event->status = kEvent::erFAIL; return; } @@ -2104,7 +2104,7 @@ function OnRecalculatePriorities(&$event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { - $event->status = erFAIL; + $event->status = kEvent::erFAIL; return; } @@ -2123,8 +2123,8 @@ */ function OnUpdatePreviewBlock(&$event) { - $event->status = erSTOP; - $string = unhtmlentities($this->Application->GetVar('preview_content')); + $event->status = kEvent::erSTOP; + $string = kUtil::unhtmlentities($this->Application->GetVar('preview_content')); $category_helper =& $this->Application->recallObject('CategoryHelper'); /* @var $category_helper CategoryHelper */ @@ -2145,7 +2145,7 @@ $event->redirect = false; $search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search'; - $keywords = unhtmlentities( trim($this->Application->GetVar('keywords')) ); + $keywords = kUtil::unhtmlentities( trim($this->Application->GetVar('keywords')) ); $query_object =& $this->Application->recallObject('HTTPQuery'); $sql = 'SHOW TABLES LIKE "'.$search_table.'"'; @@ -2346,10 +2346,10 @@ $rel_pop = $this->Application->ConfigValue('SearchRel_Pop_'.$conf_postfix) / 100; $rel_rating = $this->Application->ConfigValue('SearchRel_Rating_'.$conf_postfix) / 100; $relevance_clause = '('.implode(' + ', $revelance_parts).') / '.$weight_sum.' * '.$rel_keywords; - if ($rel_pop && isset($object->Fields['Hits'])) { + if ($rel_pop && $object->isField('Hits')) { $relevance_clause .= ' + (Hits + 1) / (MAX(Hits) + 1) * '.$rel_pop; } - if ($rel_rating && isset($object->Fields['CachedRating'])) { + if ($rel_rating && $object->isField('CachedRating')) { $relevance_clause .= ' + (CachedRating + 1) / (MAX(CachedRating) + 1) * '.$rel_rating; } @@ -2432,7 +2432,7 @@ if ($object->Load($id, null, true)) { $actions =& $this->Application->recallObject('kActions'); - $actions->Set($event->Prefix_Special.'_id', $object->GetID() ); + $actions->Set($event->getPrefixSpecial().'_id', $object->GetID() ); } else { $object->setID($id);