handlers.php 1.09 KB
<?php if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) die();

	use \Bitrix\Main\Loader;
	use \Bitrix\Iblock;

	global $USER;

	$eventManager = \Bitrix\Main\EventManager::getInstance();

	/**
	 * load common module
	 */
	AddEventHandler("main", "OnPageStart", "loadLocalModule", 1);
	function loadLocalModule()
	{
		Loader::includeModule("local.common");
	}

	/**
	 * Loading composer
	 */
	//if (file_exists($_SERVER['DOCUMENT_ROOT'].'/../vendor/autoload.php')) {
	//    require_once $_SERVER['DOCUMENT_ROOT'].'/../vendor/autoload.php';
	//}

	/**
	 * part for event handlers
	 */

	// USER
	// $eventManager->addEventHandler("main", "OnBeforeUserRegister", ["\\Local\\Common\\Handlers\\User", "beforeRegister"]);
	// $eventManager->addEventHandler("main", "OnBeforeUserAdd", ["\\Local\\Common\\Handlers\\User", "beforeAdd"]);
	// $eventManager->addEventHandler("main", "OnBeforeUserLogin", ["\\Local\\Common\\Handlers\\User", "beforeLogin"]);

	//$eventManager->addEventHandler("main", "OnEpilog", ["CDecPage", "handlerOnEpilog"]);

	//Добавляем товарам DESC_ID и Фото РЛС