-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoptions.php
53 lines (40 loc) · 1.18 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
<?php
/**
* @var \CUser $USER
* @var \CMain $APPLICATION
*/
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die();
}
use Bitrix\Main\Loader;
use Bitrix\Main\LoaderException;
use Bitrix\Main\Localization\Loc;
use Polus\Elastic\Constants;
use Polus\Options\ModuleSettings;
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die();
}
Loc::loadMessages(__FILE__);
$moduleId = 'polus.elastic';
if (!defined('ADMIN_MODULE_NAME') || ADMIN_MODULE_NAME !== $moduleId) {
define("ADMIN_MODULE_NAME", $moduleId);
}
if (!$USER->IsAdmin()) {
$APPLICATION->AuthForm(Loc::getMessage("ACCESS_DENIED"));
return false;
}
try {
if (!Loader::includeModule($moduleId)) {
ShowError(Loc::getMessage("POLUS_ELASTIC_OPTION_E_MODULE_NOT_INSTALL"));
}
$moduleSettings = ModuleSettings::getInstance();
$moduleSettings->setModuleId($moduleId);
$options = Polus\Elastic\Options::getInstance();
$tabs = $options->getTabs();
foreach ($tabs as $tab) {
$moduleSettings->addTab($tab);
}
$moduleSettings->viewSettingsPage();
} catch (LoaderException $ex) {
ShowError($ex->getMessage());
}