Index: branches/5.0.x/in-link/units/listing_types/listing_types_event_handler.php =================================================================== diff -u -N --- branches/5.0.x/in-link/units/listing_types/listing_types_event_handler.php (revision 12746) +++ branches/5.0.x/in-link/units/listing_types/listing_types_event_handler.php (revision 0) @@ -1,84 +0,0 @@ - Array('self' => true), - ); - - $this->permMapping = array_merge($this->permMapping, $permissions); - } - - /** - * Set's selected category to listing type - * - * @param kEvent $event - */ - function OnProcessSelected(&$event) - { - $object =& $event->getObject(); - $selected_ids = $this->Application->GetVar('selected_ids'); - - $object->SetDBField($this->Application->RecallVar('dst_field'), $selected_ids['c']); - $this->RemoveRequiredFields($object); - $object->Update(); - - $this->finalizePopup($event); - } - - - function OnPreSaveListingType(&$event) - { - $event->redirect = false; - $object =& $event->getObject( Array('skip_autoload' => true) ); - $this->RemoveRequiredFields($object); - $event->CallSubEvent('OnPreSave'); - $this->Application->SetVar($event->getPrefixSpecial(true).'_id', $object->GetID()); - } - - function OnPreSave(&$event) - { - $object =& $event->getObject(); - $item_info = $this->Application->GetVar($event->Prefix); - if(is_array($item_info)) - { - $item_info = array_shift($item_info); - if( getArrayValue($item_info, 'EnableBuying') ) - { - $options = $object->GetFieldOptions('ShopCartName'); - $options['required'] = 1; - $object->SetFieldOptions('ShopCartName', $options); - } - } - parent::OnPreSave($event); - } - - function OnEdit(&$event) - { - if ($this->Application->prefixRegistred('p')) { - $this->Application->recallObject('p', null, Array('skip_autoload' => true)); - } - parent::OnEdit($event); - } - } \ No newline at end of file