Changeset View
Changeset View
Standalone View
Standalone View
modules/in-link/units/link_validation/link_validation_eh.php
Show First 20 Lines • Show All 496 Lines • ▼ Show 20 Line(s) | |||||
/** | /** | ||||
* [HOOK] Allows to edit links, used in selected link validation records | * [HOOK] Allows to edit links, used in selected link validation records | ||||
* | * | ||||
* @param kEvent $event | * @param kEvent $event | ||||
*/ | */ | ||||
function OnPrepareLinkEditing($event) | function OnPrepareLinkEditing($event) | ||||
{ | { | ||||
// hook to OnAfterConfigRead instead of OnEdit, because fake ids should be available in CheckPermission | // hook to OnAfterConfigRead instead of OnEdit, because fake ids should be available in CheckPermission | ||||
if ( $this->Application->GetVar('l_event') != 'OnEdit' ) { | if ( !$this->Application->isWebRequest() || $this->Application->GetVar('l_event') != 'OnEdit' ) { | ||||
return; | return; | ||||
} | } | ||||
$items_info = Array (); | $items_info = Array (); | ||||
$ids = $this->_getSelectedIds($event); | $ids = $this->_getSelectedIds($event); | ||||
$id_field = $this->Application->getUnitConfig('l')->getIDField(); | $id_field = $this->Application->getUnitConfig('l')->getIDField(); | ||||
foreach ($ids as $id) { | foreach ($ids as $id) { | ||||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | |||||
{ | { | ||||
parent::OnAfterConfigRead($event); | parent::OnAfterConfigRead($event); | ||||
$event->getUnitConfig()->addCalculatedFieldsBySpecial('', Array ( | $event->getUnitConfig()->addCalculatedFieldsBySpecial('', Array ( | ||||
'LinkName' => 'l.l' . $this->Application->GetVar('m_lang') . '_Name', | 'LinkName' => 'l.l' . $this->Application->GetVar('m_lang') . '_Name', | ||||
)); | )); | ||||
} | } | ||||
} | } | ||||
No newline at end of file |