Index: branches/unlabeled/unlabeled-1.15.2/core/units/configuration/configuration_event_handler.php =================================================================== diff -u -r5497 -r5787 --- branches/unlabeled/unlabeled-1.15.2/core/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 5497) +++ branches/unlabeled/unlabeled-1.15.2/core/units/configuration/configuration_event_handler.php (.../configuration_event_handler.php) (revision 5787) @@ -171,26 +171,22 @@ $event->redirect_params = Array('opener' => 's', 'pass'=>'all,conf'); //stay! $event->redirect = false; }*/ - + /** - * Allows to process module root category selection + * Process items from selector (selected_ids var, key - prefix, value - comma separated ids) * * @param kEvent $event */ - function OnSelectItems(&$event) + function OnProcessSelected(&$event) { - $object =& $event->getObject( Array('skip_autoload' => true) ); - - $items_info = $this->Application->GetVar('c'); - list($resource_id, $field_values) = each($items_info); - - if ($resource_id) { - $sql = 'SELECT CategoryId - FROM '.TABLE_PREFIX.'Category - WHERE ResourceId = '.$resource_id; - $category_id = $this->Conn->GetOne($sql); - $this->Application->StoreVar('ModuleRootCategory', $category_id); + $selected_ids = $this->Application->GetVar('selected_ids'); + $category_id = $selected_ids['c']; + if (strlen($category_id) == 0) { + // no category selected, the use current + $category_id = $this->Application->GetVar('m_cat_id'); } + + $this->Application->StoreVar('ModuleRootCategory', $category_id); $this->finalizePopup($event); }