-
Notifications
You must be signed in to change notification settings - Fork 1
/
component.php
38 lines (35 loc) · 1.28 KB
/
component.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();
$path = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'bitrix' . DIRECTORY_SEPARATOR . 'components'
. DIRECTORY_SEPARATOR . 'md' . DIRECTORY_SEPARATOR . 'analytic' . DIRECTORY_SEPARATOR . 'analyticBase.php';
if (file_exists($path)) {
include_once $path;
} else {
echo $path . ' NOT FOUND';
}
$arResult = array();
if (isset($arParams['import'])) {
include_once __DIR__ . '/Import.php';
if (!empty($_GET['action']) && !empty($_GET['token']) && Import::checkToken($_GET['token'])) {
$import = new Import();
$action = $_GET['action'];
if (method_exists($import, $action)) {
echo $import->$action($import->stripParam($_GET));
}
}
} else {
include_once __DIR__ . '/Analytic.php';
if (Analytic::auth()) {
$arResult['auth'] = true;
$analytic = new Analytic();
$arResult = array_merge($arResult, $analytic->getData($_GET));
} else {
$arResult['auth'] = false;
}
if ($_GET['toCsv'] == "1" && !empty($arResult['blocks']) && isset($analytic)) {
$APPLICATION->RestartBuffer();
$analytic->getCsv($arResult);
} else {
$this->IncludeComponentTemplate($componentPage);
}
}
?>