Changeset View
Changeset View
Standalone View
Standalone View
modules/in-link/units/link_validation/link_validation_eh.php
Show First 20 Lines • Show All 433 Lines • ▼ Show 20 Line(s) | |||||
if ( !$ids ) { | if ( !$ids ) { | ||||
return; | return; | ||||
} | } | ||||
$object = $this->Application->recallObject('l.-item', null, Array ('skip_autoload' => true)); | $object = $this->Application->recallObject('l.-item', null, Array ('skip_autoload' => true)); | ||||
/* @var $object kCatDBItem */ | /* @var $object kCatDBItem */ | ||||
foreach ($ids as $id) { | foreach ($ids as $id) { | ||||
$ret = true; | $object->Clear(); | ||||
$object->Load($id); | $object->Load($id); | ||||
switch ( $event->Name ) { | switch ( $event->Name ) { | ||||
case 'OnApproveLinks': | case 'OnApproveLinks': | ||||
$ret = $object->ApproveChanges(); | $object->ApproveChanges(); | ||||
break; | break; | ||||
case 'OnDeclineLinks': | case 'OnDeclineLinks': | ||||
$ret = $object->DeclineChanges(); | $object->DeclineChanges(); | ||||
break; | |||||
} | |||||
if ( !$ret ) { | |||||
$event->status = kEvent::erFAIL; | |||||
$event->redirect = false; | |||||
break; | break; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
/** | /** | ||||
* Deletes selected links | * Deletes selected links | ||||
* | * | ||||
* @param kEvent $event | * @param kEvent $event | ||||
▲ Show 20 Lines • Show All 96 Lines • ▼ Show 20 Line(s) | |||||
{ | { | ||||
parent::OnAfterConfigRead($event); | parent::OnAfterConfigRead($event); | ||||
$calculated_fields = $this->Application->getUnitOption($event->Prefix, 'CalculatedFields'); | $calculated_fields = $this->Application->getUnitOption($event->Prefix, 'CalculatedFields'); | ||||
$calculated_fields['']['LinkName'] = 'l.l' . $this->Application->GetVar('m_lang') . '_Name'; | $calculated_fields['']['LinkName'] = 'l.l' . $this->Application->GetVar('m_lang') . '_Name'; | ||||
$this->Application->setUnitOption($event->Prefix, 'CalculatedFields', $calculated_fields); | $this->Application->setUnitOption($event->Prefix, 'CalculatedFields', $calculated_fields); | ||||
} | } | ||||
} | } | ||||
No newline at end of file |