-
Notifications
You must be signed in to change notification settings - Fork 1
/
options.php
116 lines (86 loc) · 2.59 KB
/
options.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
if(!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) { die(); }
/** @global CMain $APPLICATION */
/** @global CUser $USER */
use Bitrix\Main\Localization\Loc;
use Msav\Module\Counters\CMsavModCountersHelper;
$moduleId = 'msav.counters';
Loc::loadMessages(__FILE__);
if ( !$USER->IsAdmin() ) {
return;
}
//
// Подготовка списка сайтов
//
//$arSites = CMsavModCountersHelper::get_sites_list();
//$siteId = $_REQUEST['site_id'] ? $_REQUEST['site_id'] : current(array_keys($arSites));
//
// Подготовка списка параметров
//
$arOptions = array(
// Основные параметры
Loc::getMessage("MD_MSAV_COUNTERS_OPTIONS_STEP_COMMON"),
array(
"active",
Loc::getMessage("MD_MSAV_COUNTERS_OPTIONS_FIELD_ACTIVE"),
"",
array("checkbox", "")
),
// Яндекс
Loc::getMessage("MD_MSAV_COUNTERS_OPTIONS_STEP_YANDEX"),
array(
"yandex_metrika",
Loc::getMessage("MD_MSAV_COUNTERS_OPTIONS_FIELD_YANDEX_METRIKA"),
"",
array("text", 20)
),
array(
"yandex_webmaster",
Loc::getMessage("MD_MSAV_COUNTERS_OPTIONS_FIELD_YANDEX_WEBMASTER"),
"",
array("text", 20)
),
// Google
Loc::getMessage("MD_MSAV_COUNTERS_OPTIONS_STEP_GOOGLE"),
array(
"google_analytics",
Loc::getMessage("MD_MSAV_COUNTERS_OPTIONS_FIELD_GOOGLE_ANALYTICS"),
"",
array("text", 20)
),
array(
"google_webmasters",
Loc::getMessage("MD_MSAV_COUNTERS_OPTIONS_FIELD_GOOGLE_WEBMASTER"),
"",
array("text", 20)
),
);
$arTabs = array(
array(
"DIV" => "common_options",
"TAB" => Loc::getMessage("MAIN_TAB_SET"),
"ICON" => "ib_settings",
"TITLE" => Loc::getMessage("MAIN_TAB_TITLE_SET")
),
);
//
// Обработка запроса
//
if ( $_SERVER['REQUEST_METHOD'] == 'POST' && strlen($_REQUEST['save']) > 0 && check_bitrix_sessid() ) {
__AdmSettingsSaveOptions( $moduleId, $arOptions );
LocalRedirect($APPLICATION->GetCurPage() . '?lang=' . LANGUAGE_ID . '&mid=' . urlencode($moduleId));
}
//
// Отображение закладок
//
$obTabControl = new CAdminTabControl('tab_options', $arTabs);
printf('<form action="" method="post" name="%1$s">%2$s',
$moduleId,
bitrix_sessid_post()
);
$obTabControl->Begin();
$obTabControl->BeginNextTab();
__AdmSettingsDrawList($moduleId, $arOptions);
$obTabControl->Buttons(array('btnApply' => false, 'btnCancel' => false, 'btnSaveAndAdd' => false));
$obTabControl->End();
echo '</form>';