Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/selectors/selectors_event_handler.php
Show First 20 Lines • Show All 204 Lines • ▼ Show 20 Line(s) | |||||
*/ | */ | ||||
function SaveChanges($event) | function SaveChanges($event) | ||||
{ | { | ||||
/** @var kDBItem $object */ | /** @var kDBItem $object */ | ||||
$object = $event->getObject( Array('skip_autoload' => true) ); | $object = $event->getObject( Array('skip_autoload' => true) ); | ||||
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true)); | $items_info = $this->Application->GetVar($event->getPrefixSpecial(true)); | ||||
if ( $items_info ) { | if ( $items_info ) { | ||||
list($id, $field_values) = each($items_info); | $id = key($items_info); | ||||
$field_values = $items_info[$id]; | |||||
if ( $id == 0 ) { | if ( $id == 0 ) { | ||||
$parent_id = getArrayValue($field_values, 'ParentId'); | $parent_id = getArrayValue($field_values, 'ParentId'); | ||||
if ( $parent_id ) { | if ( $parent_id ) { | ||||
$object->Load($parent_id); | $object->Load($parent_id); | ||||
} | } | ||||
$object->setID(0); | $object->setID(0); | ||||
▲ Show 20 Lines • Show All 237 Lines • Show Last 20 Lines |