/
options.php
64 lines (54 loc) · 1.93 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
<?
require_once($_SERVER["DOCUMENT_ROOT"] . '/bitrix/modules/main/include/prolog_admin_before.php');
require_once($_SERVER["DOCUMENT_ROOT"] . '/bitrix/modules/imageimport/prolog.php');
require_once($_SERVER["DOCUMENT_ROOT"] . '/bitrix/modules/main/include/prolog_admin_after.php');
if (!$USER->IsAdmin()) return;
IncludeModuleLangFile(__FILE__);
if ($REQUEST_METHOD == 'POST') {
COption::SetOptionString('imageimport', 'file_types', $_POST['file_types']);
COption::SetOptionInt('imageimport', 'worker_interval', $_POST['worker_interval']);
CAdminMessage::ShowMessage(array(
'MESSAGE' => GetMessage('II_OPT_SAVED_OK_TITLE'),
'DETAILS' => GetMessage('II_OPT_SAVED_OK_MSG'),
'TYPE' => 'OK',
'HTML' => false,
));
}
if (!CModule::IncludeModule('iblock')) return;
$aTabs = array(
array(
'DIV' => 'edit-options-common',
'TAB' => GetMessage('II_OPT_COMMON_NAME'),
'ICON' => '',
'TITLE' => GetMessage('II_OPT_COMMON_TITLE'),
),
);
$tabControl = new CAdminTabControl("tabControl", $aTabs);
$tabControl->Begin(); ?>
<form method="post" action="<?echo $APPLICATION->GetCurPage()?>?mid=<?=urlencode($mid)?>&lang=<?echo LANGUAGE_ID?>">
<? $tabControl->BeginNextTab(); ?>
<tr class="heading">
<td colspan="2" align="center">
<?=GetMessage('II_OPT_HEADING_COMMON_IMPORT')?>
</td>
</tr>
<tr>
<td valign='top'>
<label for="file_types"><?=GetMessage('II_OPT_LABEL_FILE_TYPES')?>: </label>
</td>
<td>
<input type="text" name="file_types" value="<?=COption::GetOptionString('imageimport', 'file_types', 'jpg,gif,png')?>" /><br />
</td>
</tr>
<tr>
<td valign='top'>
<label for="worker_interval"><?=GetMessage('II_OPT_LABEL_WORKER_INTERVAL')?>: </label>
</td>
<td>
<input type="text" name="worker_interval" value="<?=COption::GetOptionInt('imageimport', 'worker_interval', 1000)?>" /><br />
</td>
</tr>
<? $tabControl->Buttons(); ?>
<input type="submit" name="submit" value="<?=GetMessage('II_OPT_SAVE')?>" />
</form>
<? $tabControl->End(); ?>