|
1 | 1 | <?php |
2 | 2 |
|
3 | 3 | // Need include this file in init.php |
| 4 | +// include 'BitrixDebugger/initializer.php'; |
4 | 5 |
|
5 | 6 | use Bitrix\Main\Loader; |
6 | 7 | use Bitrix\Main\Page\Asset; |
|
36 | 37 | */ |
37 | 38 | $GD->setShowModes(['code', 'debug_bar']); |
38 | 39 |
|
39 | | -global $USER; |
40 | | - |
41 | | -if ($USER && $USER->IsAdmin()) { |
42 | | - Asset::getInstance()->addJs($ggrachDebuggerRootPath . "/assets/DebugBar/js/initializer.js"); |
43 | | - Asset::getInstance()->addCss($ggrachDebuggerRootPath . "/assets/DebugBar/themes/${$ggrachDebugBarConfigurator->getColorTheme()}/fix.css"); |
| 40 | +function GD() { |
| 41 | + global $GD; |
| 42 | + return $GD; |
44 | 43 | } |
45 | 44 |
|
| 45 | + |
| 46 | +Asset::getInstance()->addJs($ggrachDebuggerRootPath . "/assets/DebugBar/js/initializer.js"); |
| 47 | +Asset::getInstance()->addCss($ggrachDebuggerRootPath . '/assets/DebugBar/themes/general.css'); |
| 48 | +Asset::getInstance()->addCss($ggrachDebuggerRootPath . '/assets/DebugBar/themes/'.$ggrachDebugBarConfigurator->getColorTheme().'/theme.css'); |
| 49 | + |
46 | 50 | /** |
47 | 51 | * Пример дебага: |
48 | 52 | * |
49 | | - * $GD->notice("Моя переменная', 'Моя переменная 2'); |
50 | | - * $GD->error('Моя переменная', 'Моя переменная 2'); |
51 | | - * $GD->warning('Моя переменная', 'Моя переменная 2'); |
52 | | - * $GD->success('Моя переменная', 'Моя переменная 2'); |
| 53 | + * GD()->notice('Моя переменная', 'Моя переменная 2'); |
| 54 | + * GD()->error('Моя переменная', 'Моя переменная 2'); |
| 55 | + * GD()->warning('Моя переменная', 'Моя переменная 2'); |
| 56 | + * GD()->success('Моя переменная', 'Моя переменная 2'); |
53 | 57 | * |
54 | 58 | * Залогировать в файлы |
55 | | - * $GD->noticeLog("Моя переменная', 'Моя переменная 2'); |
56 | | - * $GD->errorLog('Моя переменная', 'Моя переменная 2'); |
57 | | - * $GD->warningLog('Моя переменная', 'Моя переменная 2'); |
58 | | - * $GD->successLog('Моя переменная', 'Моя переменная 2'); |
| 59 | + * GD()->noticeLog('Моя переменная', 'Моя переменная 2'); |
| 60 | + * GD()->errorLog('Моя переменная', 'Моя переменная 2'); |
| 61 | + * GD()->warningLog('Моя переменная', 'Моя переменная 2'); |
| 62 | + * GD()->successLog('Моя переменная', 'Моя переменная 2'); |
59 | 63 | * |
60 | 64 | */ |
61 | 65 | include 'inizializer_alias.php'; |
| 66 | + |
| 67 | +if (\GGrach\BitrixDebugger\Validator\ShowModeDebuggerValidator::needShowInDebugBar($GD)) { |
| 68 | + include 'events.php'; |
| 69 | +} |
0 commit comments