1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
options.php
См. документацию.
1<?require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/vote/include.php");
3
4$rights = $APPLICATION->GetGroupRight("vote");
5if ($rights < "R")
6 $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
7
9$module_id = "vote";
10$request = \Bitrix\Main\Context::getCurrent()->getRequest();
11
12$options = $arDisplayOptions = [
13 "USE_HTML_EDIT" => [ // html editor in admin part to edit vote or question body
14 "message" => GetMessage("VOTE_USE_HTML_EDIT"),
15 "field_type" => "checkbox"],
16 "VOTE_COMPATIBLE_OLD_TEMPLATE" => [ // this is very old option to use old templates before component. We do not use it anymore.
17 "message" => GetMessage("VOTE_COMPATIBLE"),
18 "field_type" => "checkbox"],
19 "VOTE_DIR" => [ //
20 "message" => GetMessage("VOTE_PUBLIC_DIR"),
21 "field_type" => "text"],
22 "VOTE_TEMPLATE_PATH" => [ //Путь к шаблонам показа форм опросов (SV)
23 "message" => GetMessage("VOTE_TEMPLATE_VOTES"),
24 "field_type" => "text"],
25 "VOTE_TEMPLATE_PATH_VOTE" => [ // Выбор шаблона показа результатов опроса (RV)
26 "message" => GetMessage("VOTE_TEMPLATE_RESULTS_VOTE"),
27 "field_type" => "text"],
28 "VOTE_TEMPLATE_PATH_QUESTION" => [ //Путь к шаблонам показа результатов вопроса: (RQ)
29 "message" => GetMessage("VOTE_TEMPLATE_RESULTS_QUESTION"),
30 "field_type" => "text"],
31 "VOTE_TEMPLATE_PATH_QUESTION_NEW" => [// Относительный путь к шаблонам показа результатов вопроса: C 4 ВЕРСИИ
32 "message" => GetMessage("VOTE_TEMPLATE_RESULTS_QUESTION_NEW"),
33 "field_type" => "text"]
34 ];
35if ($request->isPost() && $request->getPost("edit_vote_options") === "Y")
36{
37 try
38 {
39 if ($rights < "W")
40 {
41 throw new \Bitrix\Main\AccessDeniedException();
42 }
44 {
45 throw new \Bitrix\Main\ArgumentException("Bad sessid.");
46 }
47 if ($request->getPost("restore") !== null)
48 {
49 COption::RemoveOption($module_id);
50 $z = CGroup::GetList("id", "asc", array("ACTIVE" => "Y", "ADMIN" => "N"));
51 while($zr = $z->Fetch())
52 $APPLICATION->DelGroupRight($module_id, array($zr["ID"]));
53 }
54 else
55 {
56 foreach ($options as $key => $value)
57 {
58 if ($request->getPost($key) !== null)
59 {
60 COption::SetOptionString($module_id, $key, $request->getPost($key));
61 }
62 }
63 }
64 }
65 catch (\Exception $exception)
66 {
67 CAdminMessage::ShowMessage($exception->getMessage());
68 }
69}
70if (COption::GetOptionString("vote", "VOTE_COMPATIBLE_OLD_TEMPLATE", "N") == "N")
71{
72 if (COption::GetOptionString("vote", "VOTE_TEMPLATE_PATH") == '' &&
73 COption::GetOptionString("vote", "VOTE_TEMPLATE_PATH_VOTE") == '' &&
74 COption::GetOptionString("vote", "VOTE_TEMPLATE_PATH_QUESTION") == '' &&
75 COption::GetOptionString("vote", "VOTE_TEMPLATE_PATH_QUESTION_NEW") == '')
76 {
77 unset($arDisplayOptions["VOTE_COMPATIBLE_OLD_TEMPLATE"]);
78 }
79 unset($arDisplayOptions["VOTE_DIR"]);
80 unset($arDisplayOptions["VOTE_TEMPLATE_PATH"]);
81 unset($arDisplayOptions["VOTE_TEMPLATE_PATH_VOTE"]);
82 unset($arDisplayOptions["VOTE_TEMPLATE_PATH_QUESTION"]);
83 unset($arDisplayOptions["VOTE_TEMPLATE_PATH_QUESTION_NEW"]);
84}
86{
87 unset($arDisplayOptions["VOTE_TEMPLATE_PATH_QUESTION_NEW"]);
88}
89else
90{
91 unset($arDisplayOptions["VOTE_DIR"]);
92 unset($arDisplayOptions["VOTE_TEMPLATE_PATH"]);
93 unset($arDisplayOptions["VOTE_TEMPLATE_PATH_VOTE"]);
94 unset($arDisplayOptions["VOTE_TEMPLATE_PATH_QUESTION"]);
95}
96
98 array("DIV" => "edit1", "TAB" => GetMessage("MAIN_TAB_SET"), "ICON" => "vote_settings", "TITLE" => GetMessage("MAIN_TAB_TITLE_SET")),
99 array("DIV" => "edit2", "TAB" => GetMessage("MAIN_TAB_RIGHTS"), "ICON" => "vote_settings", "TITLE" => GetMessage("MAIN_TAB_TITLE_RIGHTS")),
100);
102$tabControl->Begin();
103?>
104<form method="post" action="<?echo $APPLICATION->GetCurPage()?>?mid=<?=htmlspecialcharsbx($mid)?>&lang=<?=LANGUAGE_ID?>">
106<input type="hidden" name="edit_vote_options" value="Y" />
107<?
108$tabControl->BeginNextTab();
109 foreach($arDisplayOptions as $key => $Option)
110 {
111 $val = COption::GetOptionString($module_id, $key);
113 ?>
114 <tr><td valign="top" width="50%"><?=$Option["message"]?></td>
115 <td valign="top" width="50%"><?
116 if($Option["field_type"] == "checkbox")
117 {
118 ?><input type="hidden" name="<?=$key?>" value="N" ><?
119 ?><input type="checkbox" name="<?=$key?>" id="<?=$key?>" value="Y" <?if($val=="Y") { echo" checked"; }?>><?
120 }
121 else
122 {
123 ?><input type="text" maxlength="255" value="<?=htmlspecialcharsbx($val)?>" name="<?=$key?>"><?
124 }
125 ?></td>
126 </tr>
127 <?
128 }
129$tabControl->BeginNextTab();?>
130<?require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/group_rights.php");?>
131<?$tabControl->Buttons();?>
132<input <?if ($rights<"W") echo "disabled" ?> type="submit" name="Update" value="<?=GetMessage("VOTE_SAVE")?>">
133<input type="reset" name="reset" value="<?=GetMessage("VOTE_RESET")?>">
134<input <?if ($rights<"W") echo "disabled" ?> type="submit" name="restore" title="<?echo GetMessage("MAIN_HINT_RESTORE_DEFAULTS")?>" value="<?echo GetMessage("MAIN_RESTORE_DEFAULTS")?>">
135<?$tabControl->End();?>
136</form>
137<?
138?>
global $APPLICATION
Определения include.php:80
$module_id
Определения options.php:6
if(!Loader::includeModule('catalog')) if(!AccessController::getCurrent() ->check(ActionDictionary::ACTION_PRICE_EDIT)) if(!check_bitrix_sessid()) $request
Определения catalog_reindex.php:36
static ShowMessage($message)
Определения admin_lib.php:2351
static GetList($by='c_sort', $order='asc', $arFilter=[], $SHOW_USERS_AMOUNT="N")
Определения group.php:136
static IsOldVersion()
Определения vote.php:336
$options
Определения commerceml2.php:49
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
$old_module_version
Определения options.php:12
$zr
Определения options.php:5
$_SERVER["DOCUMENT_ROOT"]
Определения cron_frame.php:9
$tabControl
Определения csv_new_setup.php:244
$aTabs
Определения csv_new_setup.php:238
$z
Определения options.php:31
bitrix_sessid_post($varname='sessid', $returnInvocations=false)
Определения tools.php:4700
check_bitrix_sessid($varname='sessid')
Определения tools.php:4686
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
Определения tools.php:2701
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
Определения tools.php:3778
GetMessage($name, $aReplace=null)
Определения tools.php:3397
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
<? endif;?> window document title
Определения prolog_main_admin.php:76
if(empty($signedUserToken)) $key
Определения quickway.php:257
$val
Определения options.php:1793
else $Option[0]
Определения options.php:387
$rights
Определения options.php:4