1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
options.php
См. документацию.
1<?
2$module_id = "advertising";
3IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/modules/main/options.php");
4IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/".$module_id."/include.php");
6
8if ($ADV_RIGHT>="R") :
9
10if ($REQUEST_METHOD=="GET" && $ADV_RIGHT=="W" && $RestoreDefaults <> '' && check_bitrix_sessid())
11{
12 COption::RemoveOption($module_id);
13 $z = CGroup::GetList("id", "asc", array("ACTIVE" => "Y", "ADMIN" => "N"));
14 while($zr = $z->Fetch())
15 $APPLICATION->DelGroupRight($module_id, array($zr["ID"]));
16}
17
19 array("DONT_USE_CONTRACT", GetMessage("AD_DONT_USE_CONTRACT"), Array("checkbox", "Y")),
20 array("DONT_FIX_BANNER_SHOWS", GetMessage("AD_OPT_DONT_FIX_BANNER_SHOWS"), Array("checkbox", "Y")),
21 array("USE_HTML_EDIT", GetMessage("AD_USE_HTML_EDIT"), Array("checkbox", "Y")),
22 Array("SHOW_COMPONENT_PREVIEW", GetMessage("AD_SHOW_COMPONENT_PREVIEW"), Array("checkbox", "Y")),
23 Array("BANNER_DAYS", GetMessage("AD_BANNER_DAYS"), Array("text", 5), "CAdvBanner::CleanUpAllDynamics", "b_adv_banner_2_day"),
24 Array("BANNER_GRAPH_WEIGHT", GetMessage("AD_BANNER_GRAPH_WEIGHT"), Array("text", 5)),
25 Array("BANNER_GRAPH_HEIGHT", GetMessage("AD_BANNER_GRAPH_HEIGHT"), Array("text", 5)),
26 Array("BANNER_DIAGRAM_DIAMETER", GetMessage("AD_BANNER_DIAGRAM_DIAMETER"), Array("text", 5)),
27 Array("COOKIE_DAYS", GetMessage("AD_COOKIE_DAYS"), Array("text", 5)),
28);
29
31 array("DIV" => "edit1", "TAB" => GetMessage("MAIN_TAB_SET"), "ICON" => "ad_settings", "TITLE" => GetMessage("MAIN_TAB_TITLE_SET")),
32 array("DIV" => "edit2", "TAB" => GetMessage("MAIN_TAB_RIGHTS"), "ICON" => "ad_settings", "TITLE" => GetMessage("MAIN_TAB_TITLE_RIGHTS")),
33);
34$tabControl = new CAdminTabControl("tabControl", $aTabs);
35
36if($REQUEST_METHOD=="POST" && $Update.$Apply <> '' && $ADV_RIGHT>="W" && check_bitrix_sessid())
37{
38 // смена подкаталога для хранения баннеров
39 $old_subdir = COption::GetOptionString($module_id, "UPLOAD_SUBDIR");
40 $new_subdir = $_POST["UPLOAD_SUBDIR"];
41
42 if($old_subdir != $new_subdir)
43 {
44 COption::SetOptionString($module_id, "UPLOAD_SUBDIR", $UPLOAD_SUBDIR);
45 }
46
47 for ($i = 0, $cnt = count($arAllOptions); $i < $cnt; $i++)
48 {
50 $val = ${$name};
51
52 if ($arAllOptions[$i][3] <> '' && $_POST[$name.'_clear'] === "Y")
53 {
54 if (is_callable($arAllOptions[$i][3]))
55 {
56 call_user_func($arAllOptions[$i][3]);
57 }
58 }
59
60 if ($arAllOptions[$i][2][0] == "checkbox" && $val != "Y")
61 {
62 $val = "N";
63 }
64
66 }
67
68 $Update = $Update.$Apply;
69 ob_start();
70 require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/group_rights.php");
71 ob_end_clean();
72
73 if($Apply == '' && $_REQUEST["back_url_settings"] <> '')
74 LocalRedirect($_REQUEST["back_url_settings"]);
75 else
76 LocalRedirect($APPLICATION->GetCurPage()."?mid=".urlencode($mid)."&lang=".urlencode(LANGUAGE_ID)."&back_url_settings=".urlencode($_REQUEST["back_url_settings"])."&".$tabControl->ActiveTabParam());
77}
78$UPLOAD_SUBDIR = COption::GetOptionString($module_id, "UPLOAD_SUBDIR");
79?>
80<?
81$tabControl->Begin();
82?>
83<form method="POST" action="<?echo $APPLICATION->GetCurPage()?>?mid=<?=htmlspecialcharsbx($mid)?>&lang=<?=LANGUAGE_ID?>">
84<?
85$tabControl->BeginNextTab();
86?>
87 <?
88 for($i=0, $cnt = count($arAllOptions); $i < $cnt; $i++):
90 $val = COption::GetOptionString($module_id, $Option[0]);
91 $type = $Option[2];
92 ?>
93 <tr>
94 <td valign="top" width="50%"><? if($type[0]=="checkbox")
95 echo "<label for=\"".htmlspecialcharsbx($Option[0])."\">".$Option[1]."</label>";
96 else
97 echo $Option[1];?></td>
98 <td valign="top" width="50%"><?
99 if($type[0]=="checkbox"):?>
100 <input type="checkbox" name="<?echo htmlspecialcharsbx($Option[0])?>" id="<?echo htmlspecialcharsbx($Option[0])?>" value="Y"<?if($val=="Y")echo " checked";?>>
101 <?
102 elseif($type[0]=="text"):
103 if ($Option[4] <> '')
104 {
105 $arr = explode(",",$Option[4]);
106 $count = 0;
107 foreach($arr as $table)
108 {
109 $strSql = "SELECT count(*) as COUNT FROM ".$table;
110 $z = $DB->Query($strSql,false,$err_mess.__LINE__);
111 $zr = $z->Fetch();
112 $count += $zr["COUNT"];
113 }
114 }
115 ?>
116 <input type="text" size="<?=$type[1]?>" maxlength="255" value="<?=htmlspecialcharsbx($val)?>" name="<?=htmlspecialcharsbx($Option[0])?>">
117 <?
118 if ($Option[3] <> '')
119 {
120 ?>
121 <label for="<?=htmlspecialcharsbx($Option[0])?>_clear">
122 <?=GetMessage("AD_DELETE_ALL")?>:
123 </label>
124 <input type="checkbox" name="<?=htmlspecialcharsbx($Option[0])?>_clear" id="<?=htmlspecialcharsbx($Option[0])?>_clear" value="Y">
125 <?
126 };
127
128 if ($Option[4] <> '')
129 {
130 echo '('.GetMessage("AD_RECORDS").' '.$count.')';
131 }
132 ?>
133 <?elseif($type[0]=="textarea"):?>
134 <textarea rows="<?echo $type[1]?>" cols="<?echo $type[2]?>" name="<?echo htmlspecialcharsbx($Option[0])?>"><?echo htmlspecialcharsbx($val)?></textarea>
135 <?endif?>
136 </td>
137 </tr>
138 <?
139 endfor;
140 ?>
141 <tr>
142 <td valign="top"><?=GetMessage("AD_UPLOAD_SUBDIR")?></td>
143 <td valign="middle"><input type="text" size="30" maxlength="255" value="<?=htmlspecialcharsbx($UPLOAD_SUBDIR)?>" name="UPLOAD_SUBDIR"></td>
144 </tr>
145<?$tabControl->BeginNextTab();?>
146<?require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/group_rights.php");?>
147<?$tabControl->Buttons();?>
148<script>
149function RestoreDefaults()
150{
151 if(confirm('<?echo AddSlashes(GetMessage("MAIN_HINT_RESTORE_DEFAULTS_WARNING"))?>'))
152 window.location = "<?echo $APPLICATION->GetCurPage()?>?RestoreDefaults=Y&lang=<?=LANGUAGE_ID?>&mid=<?echo urlencode($mid)?>&<?echo bitrix_sessid_get()?>";
153}
154</script>
155 <?if($_REQUEST["back_url_settings"] <> ''):?>
156 <input type="submit" name="Update" value="<?=GetMessage("MAIN_SAVE")?>" title="<?=GetMessage("MAIN_OPT_SAVE_TITLE")?>"<?if ($ADV_RIGHT<"W") echo " disabled" ?>>
157 <?endif?>
158 <input type="submit" name="Apply" value="<?=GetMessage("MAIN_OPT_APPLY")?>" title="<?=GetMessage("MAIN_OPT_APPLY_TITLE")?>"<?if ($ADV_RIGHT<"W") echo " disabled" ?>>
159 <?if($_REQUEST["back_url_settings"] <> ''):?>
160 <input type="button" name="Cancel" value="<?=GetMessage("MAIN_OPT_CANCEL")?>" title="<?=GetMessage("MAIN_OPT_CANCEL_TITLE")?>" onclick="window.location='<?echo htmlspecialcharsbx(CUtil::JSEscape($_REQUEST["back_url_settings"]))?>'">
161 <input type="hidden" name="back_url_settings" value="<?=htmlspecialcharsbx($_REQUEST["back_url_settings"])?>">
162 <?endif?>
163 <input type="button" title="<?echo GetMessage("MAIN_HINT_RESTORE_DEFAULTS")?>" OnClick="RestoreDefaults();" value="<?echo GetMessage("MAIN_RESTORE_DEFAULTS")?>"<?if ($ADV_RIGHT<"W") echo " disabled" ?>>
164 <?=bitrix_sessid_post();?>
165
166<?$tabControl->End();?>
167</form>
168<?endif;?>
$count
Определения admin_tab.php:4
if($REQUEST_METHOD=="POST" && $Update. $Apply<> '' && $ADV_RIGHT >="W" &&check_bitrix_sessid() $UPLOAD_SUBDIR)
Определения options.php:78
$ADV_RIGHT
Определения options.php:7
$type
Определения options.php:106
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($by='c_sort', $order='asc', $arFilter=[], $SHOW_USERS_AMOUNT="N")
Определения group.php:136
static SetOptionString($module_id, $name, $value="", $desc=false, $site="")
Определения option.php:29
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
Определения file_new.php:677
$arr
Определения file_new.php:624
</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
$_REQUEST["admin_mnu_menu_id"]
Определения get_menu.php:8
$Update
Определения options.php:212
$Apply
Определения options.php:213
$RestoreDefaults
Определения options.php:55
$_SERVER["DOCUMENT_ROOT"]
Определения cron_frame.php:9
global $DB
Определения cron_frame.php:29
$tabControl
Определения csv_new_setup.php:244
$aTabs
Определения csv_new_setup.php:238
endif
Определения csv_new_setup.php:990
$z
Определения options.php:31
$mid
Определения options.php:27
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
LocalRedirect($url, $skip_security_check=false, $status="302 Found")
Определения tools.php:4005
$name
Определения menu_edit.php:35
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
<? endif;?> window document title
Определения prolog_main_admin.php:76
$i
Определения factura.php:643
font size
Определения invoice.php:442
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936
endfor
Определения template.php:569
$val
Определения options.php:1793
else $Option[0]
Определения options.php:387