init
This commit is contained in:
commit
6ad7948670
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
/*
|
||||||
|
!php_interface
|
||||||
|
!bx-custom-include
|
||||||
|
!.htaccess
|
||||||
|
!.gitignore
|
||||||
|
!README.md
|
||||||
|
!init.php
|
3
bx-custom-include/event-log/lang_ru.php
Normal file
3
bx-custom-include/event-log/lang_ru.php
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
?>
|
14
bx-custom-include/event-log/main.php
Normal file
14
bx-custom-include/event-log/main.php
Normal 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'));
|
||||||
|
?>
|
23
bx-custom-include/event-log/script.js
Normal file
23
bx-custom-include/event-log/script.js
Normal 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
|
||||||
|
);
|
||||||
|
};
|
0
bx-custom-include/event-log/style.css
Normal file
0
bx-custom-include/event-log/style.css
Normal file
10
php_interface/init.php
Normal file
10
php_interface/init.php
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
Loading…
Reference in New Issue
Block a user