Created
April 7, 2014 11:04
-
-
Save sartas/10018360 to your computer and use it in GitHub Desktop.
событие активации элемнета
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AddEventHandler("iblock", "OnBeforeIBlockElementUpdate", Array("Handler", "OnBeforeIBlockElementUpdate")); | |
| class Handler | |
| { | |
| // создаем обработчик события "OnBeforeIBlockElementUpdate" | |
| function OnBeforeIBlockElementUpdate(&$arFields) | |
| { | |
| $iblock_id = 3; | |
| $element_id = $arFields['ID']; | |
| //элемент активирован | |
| if ($arFields["IBLOCK_ID"] == $iblock_id && $arFields['ACTIVE'] == 'Y') | |
| { | |
| $list = \Bitrixlib\GetList::Element(array('IBLOCK_ID' => $iblock_id, 'ID' => $element_id)); | |
| if ($list) | |
| { | |
| $old_element = array_shift($list); | |
| //сейчас изменился статус на активен | |
| if ($old_element['ACTIVE'] == 'N') | |
| { | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment