1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
options.php
См. документацию.
1<?
2##############################################
3# Bitrix: SiteManager #
4# Copyright (c) 2002-2012 Bitrix #
5# https://www.bitrixsoft.com #
6# mailto:admin@bitrixsoft.com #
7##############################################
8
9use \Bitrix\Main\Localization\Loc;
10Loc::loadMessages(__FILE__);
11Loc::loadMessages($_SERVER['DOCUMENT_ROOT'].BX_ROOT.'/modules/main/options.php');
12
13$module_id = 'wiki';
14CModule::IncludeModule($module_id);
15
16CModule::IncludeModule('iblock');
18if($MOD_RIGHT>='R'):
19
20 // set up form
21 $arAllOptions = Array(
22 Array('allow_html', Loc::getMessage('WIKI_OPTIONS_ALLOW_HTML'), 'Y', Array('checkbox')),
23 Array('image_max_width', Loc::getMessage('WIKI_OPTIONS_IMAGE_MAX_WIDTH'), '600', Array('text')),
24 Array('image_max_height', Loc::getMessage('WIKI_OPTIONS_IMAGE_MAX_HEIGHT'), '600', Array('text')),
25 Array('note' => Loc::getMessage('WIKI_OPTIONS_IMAGE_DESCR'))
26 );
27
28 if(IsModuleInstalled('forum'))
29 {
30 if(!CModule::IncludeModule('forum'))
31 return false;
32
33 $rsForum = CForumNew::GetList();
34 $arForumList = Array();
35 $arForumList[] = '';
36
37 while($arForum=$rsForum->Fetch())
38 $arForumList[$arForum['ID']]=$arForum['NAME'];
39
40 $socnet_message_per_page = isset($_POST['socnet_message_per_page']) ? $_POST['socnet_message_per_page'] : COption::GetOptionString('wiki', 'socnet_message_per_page','20');
41
42 $arForumOptions = Array(
43 array('socnet_use_review', Loc::getMessage('WIKI_OPTIONS_SOCNET_USE_REVIEW'), 'Y', Array('checkbox')),
44 array('socnet_forum_id', Loc::getMessage('WIKI_OPTIONS_SOCNET_FORUM_ID'), '', Array('selectbox', $arForumList)),
45 array('socnet_message_per_page', Loc::getMessage('WIKI_OPTIONS_SOCNET_MESSAGE_PER_PAGE'), $socnet_message_per_page, Array('text')),
46 array('socnet_use_captcha', Loc::getMessage('WIKI_OPTIONS_SOCNET_USE_CAPTCHA'), 'Y', Array('checkbox'))
47 );
48 }
49
50if($MOD_RIGHT>='Y' || $USER->IsAdmin()):
51
52 if ($_SERVER['REQUEST_METHOD']=='GET' && $RestoreDefaults <> '' && check_bitrix_sessid())
53 {
55 $z = CGroup::GetList('id', 'asc', array('ACTIVE' => 'Y', 'ADMIN' => 'N'));
56 while($zr = $z->Fetch())
57 $APPLICATION->DelGroupRight($module_id, array($zr['ID']));
58 }
59
60 if($_SERVER['REQUEST_METHOD']=='POST' && $Update <> '' && check_bitrix_sessid())
61 {
63 if(IsModuleInstalled('forum'))
64 $arOptions = array_merge($arAllOptions, $arForumOptions);
65
66 //fix: http://jabber.bx/view.php?id=20941 (for compatibility)
67 COption::RemoveOption($module_id,'socnet_message_per_page');
68
69 foreach($arOptions as $option)
70 {
71 if(!is_array($option) || isset($option['note']))
72 continue;
73
74 $name = $option[0];
75 $val = ${$name};
76 if($option[3][0] == 'checkbox' && $val != 'Y')
77 $val = 'N';
78 if($option[3][0] == 'multiselectbox')
79 $val = @implode(',', $val);
80 if ($name == 'image_max_width' || $name == 'image_max_height')
81 $val = (int) $val;
82
84 }
85
86 if(IsModuleInstalled('socialnetwork'))
87 {
88 COption::SetOptionString($module_id, 'socnet_iblock_id', $_POST['socnet_iblock_id']);
89 COption::SetOptionString($module_id, 'socnet_iblock_type_id', $_POST['socnet_iblock_type_id']);
90 COption::SetOptionString($module_id, 'socnet_enable', $_POST['socnet_enable']);
91 CWikiSocnet::EnableSocnet($_POST['socnet_enable'] === 'Y');
92 }
93 }
94
95endif; //if($MOD_RIGHT>="W"):
96
98$aTabs[] = array('DIV' => 'set', 'TAB' => Loc::getMessage('MAIN_TAB_SET'), 'ICON' => 'wiki_settings', 'TITLE' => Loc::getMessage('MAIN_TAB_TITLE_SET'));
99
100if(IsModuleInstalled('socialnetwork'))
101{
102 $aTabs[] = array(
103 'DIV' => 'socnet',
104 'TAB' => Loc::getMessage('WIKI_TAB_SOCNET'),
105 'TITLE' => Loc::getMessage('WIKI_TAB_TITLE_SOCNET'),
106 'ICON' => 'wiki_settings'
107 );
108}
109$aTabs[] = array('DIV' => 'rights', 'TAB' => Loc::getMessage('MAIN_TAB_RIGHTS'), 'ICON' => 'wiki_settings', 'TITLE' => Loc::getMessage('MAIN_TAB_TITLE_RIGHTS'));
110
112?>
113<?
114$tabControl->Begin();
115?>
116<style>
117table.edit-table td.field-name {
118 width: 40% !important;
119}
120</style>
121<form method="POST" action="<?echo $APPLICATION->GetCurPage()?>?mid=<?=htmlspecialcharsbx($mid)?>&lang=<?=LANGUAGE_ID?>" name="wiki_settings">
122<?$tabControl->BeginNextTab();?>
123<?__AdmSettingsDrawList('wiki', $arAllOptions);?>
124<?
125if(IsModuleInstalled('socialnetwork'))
126{
127 $socnet_iblock_id = COption::GetOptionString($module_id, 'socnet_iblock_id');
128 $socnet_enable = COption::GetOptionString($module_id, 'socnet_enable') == 'Y' && CWikiSocnet::IsEnabledSocnet() ? 'Y' : 'N';
129 $tabControl->BeginNextTab();
130
131 __AdmSettingsDrawRow('wiki', array('socnet_enable', Loc::getMessage('WIKI_OPTIONS_SOCNET_ENABLE'), $socnet_enable, Array('checkbox')))
132 ?>
133 <tr>
134 <td><?echo Loc::getMessage('WIKI_OPTIONS_SOCNET_IBLOCK_ID')?></td>
135 <td><?echo GetIBlockDropDownList($socnet_iblock_id, 'socnet_iblock_type_id', 'socnet_iblock_id', false, 'class="adm-detail-iblock-types"', 'class="adm-detail-iblock-list"');?></td>
136 </tr>
137 <?
138 if(IsModuleInstalled('forum'))
139 {
140 __AdmSettingsDrawList('wiki', $arForumOptions);
141 }
142}?>
143<?$tabControl->BeginNextTab();?>
144<?require_once($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/admin/group_rights.php');?>
145<?$tabControl->Buttons();?>
146<script>
147function RestoreDefaults()
148{
149 if(confirm('<?echo AddSlashes(Loc::getMessage('MAIN_HINT_RESTORE_DEFAULTS_WARNING'))?>'))
150 window.location = "<?echo $APPLICATION->GetCurPage()?>?RestoreDefaults=Y&lang=<?echo LANG?>&mid=<?echo rawurlencode($mid)."&".bitrix_sessid_get();?>";
151}
152</script>
153<input type="submit" name="Update" <?if ($MOD_RIGHT<'W') echo "disabled" ?> value="<?echo Loc::getMessage('MAIN_SAVE')?>">
154<input type="reset" name="reset" value="<?echo Loc::getMessage('MAIN_RESET')?>">
155<input type="hidden" name="Update" value="Y">
156<?=bitrix_sessid_post();?>
157<input type="button" <?if ($MOD_RIGHT<'W') echo "disabled" ?> title="<?echo Loc::getMessage('MAIN_HINT_RESTORE_DEFAULTS')?>" OnClick="RestoreDefaults();" value="<?echo Loc::getMessage('MAIN_RESTORE_DEFAULTS')?>">
158<?$tabControl->End();?>
159</form>
160<?endif;
161?>
const BX_ROOT
Определения bx_root.php:3
global $APPLICATION
Определения include.php:80
$module_id
Определения options.php:6
if($_SERVER $arAllOptions['REQUEST_METHOD']=='GET' &&!empty($_REQUEST['RestoreDefaults']) &&! $bReadOnly &&check_bitrix_sessid())
Определения options.php:63
static GetList($arOrder=Array("SORT"=>"ASC"), $arFilter=Array(), $arAddParams=array())
Определения forum_new.php:796
static GetList($by='c_sort', $order='asc', $arFilter=[], $SHOW_USERS_AMOUNT="N")
Определения group.php:136
static GetOptionString($module_id, $name, $def="", $site=false, $bExactSite=false)
Определения option.php:8
static RemoveOption($module_id, $name="", $site=false)
Определения option.php:35
static SetOptionString($module_id, $name, $value="", $desc=false, $site="")
Определения option.php:29
static EnableSocnet($bActive=false)
Определения wiki_socnet.php:102
static IsEnabledSocnet()
Определения wiki_socnet.php:78
$MOD_RIGHT
Определения options.php:11
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
Определения file_new.php:677
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$zr
Определения options.php:5
GetIBlockDropDownList($IBLOCK_ID, $strTypeName, $strIBlockName, $arFilter=false, $strAddType='', $strAddIBlock='')
Определения iblock.php:737
$Update
Определения options.php:212
$RestoreDefaults
Определения options.php:55
$_SERVER["DOCUMENT_ROOT"]
Определения cron_frame.php:9
global $USER
Определения csv_new_run.php:40
$tabControl
Определения csv_new_setup.php:244
$aTabs
Определения csv_new_setup.php:238
endif
Определения csv_new_setup.php:990
$z
Определения options.php:31
$arOptions
Определения structure.php:223
bitrix_sessid_post($varname='sessid', $returnInvocations=false)
Определения tools.php:4700
check_bitrix_sessid($varname='sessid')
Определения tools.php:4686
IsModuleInstalled($module_id)
Определения tools.php:5301
$name
Определения menu_edit.php:35
<? endif;?> window document title
Определения prolog_main_admin.php:76
font style
Определения invoice.php:442
$option
Определения options.php:1711
$val
Определения options.php:1793