1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
options.php
См. документацию.
1<?php
2
5
6if($USER->IsAdmin() && CModule::IncludeModule('iblock') && CModule::IncludeModule('lists')):
7
8IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/modules/main/options.php");
10
12 array(
13 "DIV" => "permissions",
14 "TAB" => GetMessage("LISTS_OPTIONS_TAB_PERMISSIONS"),
15 "TITLE" => GetMessage("LISTS_OPTIONS_TAB_TITLE_PERMISSIONS"),
16 "OPTIONS" => array(),
17 ),
18);
19if(IsModuleInstalled('socialnetwork'))
20{
21 $aTabs[] = array(
22 "DIV" => "socnet",
23 "TAB" => GetMessage("LISTS_OPTIONS_TAB_SOCNET"),
24 "TITLE" => GetMessage("LISTS_OPTIONS_TAB_TITLE_SOCNET"),
25 "OPTIONS" => array(),
26 );
27}
29 "DIV" => "livefeed",
30 "TAB" => GetMessage("LISTS_OPTIONS_TAB_LIVE_FEED"),
31 "TITLE" => GetMessage("LISTS_OPTIONS_TAB_TITLE_LIVE_FEED"),
32 "OPTIONS" => array(),
33);
34
35$arGroups = array("REFERENCE"=>array(), "REFERENCE_ID"=>array());
37while($ar = $rsGroups->Fetch())
38{
39 $arGroups["REFERENCE"][] = $ar["REFERENCE"];
40 $arGroups["REFERENCE_ID"][] = $ar["REFERENCE_ID"];
41}
42
43$arIBTypes = array("REFERENCE"=>array(), "REFERENCE_ID"=>array());
45while($arIBType = $rsIBTypes->GetNext())
46{
47 $arIBTypes["REFERENCE"][] = $arIBType["~ID"];
48 $arIBTypes["REFERENCE_ID"][] = $arIBType["~ID"];
49}
50
51$tabControl = new CAdminTabControl("tabControl", $aTabs);
52
53$Update ??= '';
54$Apply ??= '';
56
57if($_SERVER['REQUEST_METHOD'] === "POST" && $Update.$Apply.$RestoreDefaults <> '' && check_bitrix_sessid())
58{
60 {
61 COption::RemoveOption("lists");
62 }
63 else
64 {
65 $arRights = array();
66 if(
67 isset($_POST["type_right"]) && is_array($_POST["type_right"])
68 && isset($_POST["group_right"]) && is_array($_POST["group_right"])
69 )
70 {
71 $keys = array_keys($_POST["type_right"]);
72 foreach($keys as $i)
73 {
74 if(
75 array_key_exists($i, $_POST["type_right"])
76 && array_key_exists($i, $_POST["group_right"])
77 )
78 {
79 $arRights[$_POST["type_right"][$i]][] = $_POST["group_right"][$i];
80 }
81 }
82 }
83
84 foreach($arRights as $type_id => $groups)
85 CLists::SetPermission($type_id, $groups);
86
87 if(IsModuleInstalled('socialnetwork'))
88 {
89 COption::SetOptionString("lists", "socnet_iblock_type_id", $_POST["socnet_iblock_type_id"]);
90 CLists::EnableSocnet($_POST["socnet_enable"] === "Y");
91 }
92
93 if(isset($_POST["livefeed_iblock_type_id"]) && isset($_POST["livefeed_url"]))
94 {
95 COption::SetOptionString("lists", "livefeed_iblock_type_id", $_POST["livefeed_iblock_type_id"]);
96 COption::SetOptionString("lists", "livefeed_url", $_POST["livefeed_url"]);
97 }
98 }
99
100 if($Update <> '' && $_REQUEST["back_url_settings"] <> '')
101 {
102 LocalRedirect($_REQUEST["back_url_settings"]);
103 }
104 else
105 {
106 LocalRedirect($APPLICATION->GetCurPage()."?mid=".urlencode($mid ?? 'lists')."&lang=".urlencode(LANGUAGE_ID)."&back_url_settings=".urlencode($_REQUEST["back_url_settings"])."&".$tabControl->ActiveTabParam());
107 }
108}
109
110$tabControl->Begin();
111?>
112<script>
113function addNewTableRow(tableID, regexp, rindex)
114{
115 var tbl = document.getElementById(tableID);
116 var cnt = tbl.rows.length-1;
117 var oRow = tbl.insertRow(cnt);
118 var col_count = tbl.rows[cnt-1].cells.length;
119
120 for(var i=0;i<col_count;i++)
121 {
122 var oCell = oRow.insertCell(i);
123 var html = tbl.rows[cnt-1].cells[i].innerHTML;
124 oCell.innerHTML = html.replace(regexp,
125 function(html)
126 {
127 return html.replace('[n'+arguments[rindex]+']', '[n'+(1+parseInt(arguments[rindex]))+']');
128 }
129 );
130 }
131}
132</script>
133<form method="post" action="<?= $APPLICATION->GetCurPage() ?>?mid=<?=urlencode($mid ?? 'lists')?>&amp;lang=<?=LANGUAGE_ID?>">
134<?php
135
136$tabControl->BeginNextTab();
137 ?>
138 <tr>
139 <td valign="top" colspan="2">
140 <table border="0" cellspacing="0" cellpadding="0" class="internal" align="center" id="tblRIGHTS">
141 <tr class="heading">
142 <td><?echo GetMessage("LISTS_OPTIONS_USER_GROUPS")?></td>
143 <td><?echo GetMessage("LISTS_OPTIONS_IBLOCK_TYPES")?></td>
144 </tr>
145 <?
146 $i = 0;
147 foreach(CLists::GetPermission() as $type_id => $groups):
148 if (in_array($type_id, $arIBTypes["REFERENCE_ID"])):
149 foreach($groups as $group):?>
150 <tr>
151 <td><?echo SelectBoxFromArray("group_right[n".$i."]", $arGroups, $group, GetMessage("LISTS_OPTIONS_CHOOSE_GROUP"))?></td>
152 <td><?echo SelectBoxFromArray("type_right[n".$i."]", $arIBTypes, $type_id, GetMessage("LISTS_OPTIONS_CHOOSE_TYPE"))?></td>
153 </tr>
157 if($i == 0)
158 {
159 ?>
160 <tr>
161 <td><?echo SelectBoxFromArray("group_right[n".$i."]", $arGroups, $group, GetMessage("LISTS_OPTIONS_CHOOSE_GROUP"))?></td>
162 <td><?echo SelectBoxFromArray("type_right[n".$i."]", $arIBTypes, $type_id, GetMessage("LISTS_OPTIONS_CHOOSE_TYPE"))?></td>
163 </tr>
164 <?
165 }
166 ?>
167 <tr>
168 <td colspan="2" style="border:none">
169 <input type="button" value="<?echo GetMessage("LISTS_OPTIONS_ADD_RIGHT")?>" onClick="addNewTableRow('tblRIGHTS', /right\[(n)([0-9]*)\]/g, 2)">
170 </td>
171 </tr>
172 </table>
173 </td>
174 </tr>
175 <?
176if(IsModuleInstalled('socialnetwork'))
177{
178 $socnet_iblock_type_id = COption::GetOptionString("lists", "socnet_iblock_type_id");
179 $socnet_enable = CLists::IsEnabledSocnet();
180 $tabControl->BeginNextTab();
181 ?>
182 <tr>
183 <td width="30%"><?echo GetMessage("LISTS_OPTIONS_SOCNET_ENABLE")?>:</td>
184 <td width="70%"><input type="checkbox" name="socnet_enable" <?if($socnet_enable) echo "checked"?> value="Y"></td>
185 </tr>
186 <tr>
187 <td width="30%"><?echo GetMessage("LISTS_OPTIONS_SOCNET_IBLOCK_TYPE")?>:</td>
188 <td width="70%"><?echo SelectBoxFromArray("socnet_iblock_type_id", $arIBTypes, $socnet_iblock_type_id, GetMessage("MAIN_NO"))?></td>
189 </tr>
190 <?
191}
192
193 $livefeed_iblock_type_id = COption::GetOptionString("lists", "livefeed_iblock_type_id");
194 $livefeed_url = COption::GetOptionString('lists', 'livefeed_url');
195 $tabControl->BeginNextTab();
196 ?>
197 <tr>
198 <td width="30%"><?echo GetMessage("LISTS_OPTIONS_LIVE_FEED_IBLOCK_TYPE")?>:</td>
199 <td width="70%"><?echo SelectBoxFromArray("livefeed_iblock_type_id", $arIBTypes, $livefeed_iblock_type_id, GetMessage("MAIN_NO"))?></td>
200 </tr>
201 <tr>
202 <td width="30%"><?echo GetMessage("LISTS_OPTIONS_LIVE_FEED_SEF_FOLDER")?>:</td>
203 <td width="70%">
204 <input type="text" name="livefeed_url" id="livefeed_url" value="<?=htmlspecialcharsbx($livefeed_url); ?>">
205 </td>
206 </tr>
207 <?
208
209$tabControl->Buttons();?>
210 <input type="submit" name="Update" value="<?=GetMessage("MAIN_SAVE")?>" title="<?=GetMessage("MAIN_OPT_SAVE_TITLE")?>" class="adm-btn-save">
211 <input type="submit" name="Apply" value="<?=GetMessage("MAIN_OPT_APPLY")?>" title="<?=GetMessage("MAIN_OPT_APPLY_TITLE")?>">
212 <?if($_REQUEST["back_url_settings"] <> ''):?>
213 <input type="button" name="Cancel" value="<?=GetMessage("MAIN_OPT_CANCEL")?>" title="<?=GetMessage("MAIN_OPT_CANCEL_TITLE")?>" onclick="window.location='<?echo htmlspecialcharsbx(CUtil::addslashes($_REQUEST["back_url_settings"]))?>'">
214 <input type="hidden" name="back_url_settings" value="<?=htmlspecialcharsbx($_REQUEST["back_url_settings"])?>">
215 <?endif?>
216 <input type="submit" name="RestoreDefaults" title="<?echo GetMessage("MAIN_HINT_RESTORE_DEFAULTS")?>" OnClick="return confirm('<?echo AddSlashes(GetMessage("MAIN_HINT_RESTORE_DEFAULTS_WARNING"))?>')" value="<?echo GetMessage("MAIN_RESTORE_DEFAULTS")?>">
217 <?=bitrix_sessid_post();?>
218<?$tabControl->End();?>
219</form>
220<?endif;?>
const BX_ROOT
Определения bx_root.php:3
$arIBTypes
Определения options.php:167
global $APPLICATION
Определения include.php:80
static GetDropDownList($strSqlSearch="and ACTIVE='Y'", $strSqlOrder="ORDER BY C_SORT, NAME, ID")
Определения group.php:114
static GetOptionString($module_id, $name, $def="", $site=false, $bExactSite=false)
Определения option.php:8
static GetList($arOrder=array("SORT"=> "ASC"), $arFilter=array())
Определения iblocktype.php:53
static IsEnabledSocnet()
Определения lists.php:297
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
$arGroups
Определения options.php:1766
$_REQUEST["admin_mnu_menu_id"]
Определения get_menu.php:8
$Update
Определения options.php:212
$Apply
Определения options.php:213
foreach(CLists::GetPermission() as $type_id=> $groups)(in_array($type_id, $arIBTypes["REFERENCE_ID"]))($groups as $group)("group_right[n". $i."]", $arGroups, $group, GetMessage("LISTS_OPTIONS_CHOOSE_GROUP"))?></td >< td ><?echo SelectBoxFromArray("type_right[n". $i."]" $type_id
Определения options.php:152
$rsIBTypes
Определения options.php:44
$RestoreDefaults
Определения options.php:55
$rsGroups
Определения options.php:36
$_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
$groups
Определения options.php:30
$mid
Определения options.php:27
bitrix_sessid_post($varname='sessid', $returnInvocations=false)
Определения tools.php:4700
check_bitrix_sessid($varname='sessid')
Определения tools.php:4686
IsModuleInstalled($module_id)
Определения tools.php:5301
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
Определения tools.php:3778
GetMessage($name, $aReplace=null)
Определения tools.php:3397
LocalRedirect($url, $skip_security_check=false, $status="302 Found")
Определения tools.php:4005
SelectBoxFromArray( $strBoxName, $db_array, $strSelectedVal="", $strDetText="", $field1="class='typeselect'", $go=false, $form="form1")
Определения tools.php:216
global_menu_<?echo $menu["menu_id"]?> adm main menu item icon adm main menu item text text adm main menu hover adm submenu menucontainer menu_id menu_id items_id items_id desktop menu_id block none adm global submenu<?=($subMenuDisplay=="block" ? " adm-global-submenu-active" :"")?> global_submenu_<?echo $menu["menu_id"]?> text MAIN_PR_ADMIN_FAV items adm submenu items wrap adm submenu items stretch wrap BX adminMenu itemsStretchScroll()"> <table class if (!empty( $menu["items"])) elseif ( $menu[ 'menu_id']=='desktop') if ( $menu[ 'menu_id']=='desktop') endforeach
Определения prolog_main_admin.php:255
<? endif;?> window document title
Определения prolog_main_admin.php:76
$ar
Определения options.php:199
$i
Определения factura.php:643
font style
Определения invoice.php:442
text align
Определения template.php:556