This commit is contained in:
Олег Цветков 2024-09-19 02:16:43 +03:00
commit 6ad7948670
8 changed files with 58 additions and 0 deletions

7
.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
/*
!php_interface
!bx-custom-include
!.htaccess
!.gitignore
!README.md
!init.php

1
.htaccess Normal file
View File

@ -0,0 +1 @@
Deny From All

0
README.md Normal file
View File

View File

@ -0,0 +1,3 @@
<?php
?>

View File

@ -0,0 +1,14 @@
<?php
CJSCore::RegisterExt(
'event-log',
array(
'js' => '/local/bx-custom-include/event-log/script.js',
'css' => '/local/bx-custom-include/event-log/style.css',
'lang' => '/local/bx-custom-include/event-log/lang_' . LANGUAGE_ID . '.php',
'rel' => Array('popup', 'ajax', 'fx', 'ls', 'date', 'json', 'window','jquery'),
'skip_core' => false,
)
);
CJSCore::Init(array('event-log'));
?>

View File

@ -0,0 +1,23 @@
let originalBxOnCustomEvent = BX.onCustomEvent;
BX.onCustomEvent = function (eventObject, eventName, eventParams, secureParams) {
let realEventName = BX.type.isString(eventName) ?
eventName : BX.type.isString(eventObject) ? eventObject : null;
if (realEventName) {
console.log(
'%c' + realEventName,
'background: #222; color: #bada55; font-weight: bold; padding: 3px 4px;'
);
}
console.dir({
eventObject: eventObject,
eventParams: eventParams,
secureParams: secureParams
});
originalBxOnCustomEvent.apply(
null, arguments
);
};

View File

10
php_interface/init.php Normal file
View File

@ -0,0 +1,10 @@
<?php
$files = glob(__DIR__ . '/../bx-custom-include/{,*/,*/*/,*/*/*/}main.php', GLOB_BRACE);
foreach($files as $file) {
/* main.php переименованный в !main.php не будет загружен */
if(mb_substr($file, 0, 1) !== '!') {
require_once $file;
}
}
?>