1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
options.php
См. документацию.
1<?
2$module_id = "blog";
4if ($BLOG_RIGHT>="R") :
5
6global $MESS;
7
8IncludeModuleLangFile($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/blog/options.php");
9
10CModule::IncludeModule('blog');
11
12if ($_SERVER['REQUEST_METHOD']=="GET" && $RestoreDefaults <> '' && $BLOG_RIGHT=="W" && check_bitrix_sessid())
13{
14 COption::RemoveOption("blog");
15 $z = CGroup::GetList("id", "asc", array("ACTIVE" => "Y", "ADMIN" => "N"));
16 while($zr = $z->Fetch())
17 $APPLICATION->DelGroupRight($module_id, array($zr["ID"]));
18}
19
21 array("avatar_max_size", GetMessage("BLO_AVATAR_MAX_SIZE"), "1000000", Array("text", 10)),
22 //array("avatar_max_width", GetMessage("BLO_AVATAR_MAX_WIDTH"), "150", Array("text", 10)),
23 //array("avatar_max_height", GetMessage("BLO_AVATAR_MAX_HEIGHT"), "150", Array("text", 10)),
24 array("image_max_width", GetMessage("BLO_IMAGE_MAX_WIDTH"), "800", Array("text", 10)),
25 array("image_max_height", GetMessage("BLO_IMAGE_MAX_HEIGHT"), "1000", Array("text", 10)),
26 array("image_max_size", GetMessage("BLO_IMAGE_MAX_SIZE"), "5000000", Array("text", 10)),
27 array("allow_alias", GetMessage("BLO_ALLOW_ALIAS"), "Y", Array("checkbox")),
28 array("block_url_change", GetMessage("BLOG_URL_BLOCK"), "N", Array("checkbox")),
29 array("show_ip", GetMessage("BLOG_SHOW_IP"), "Y", Array("checkbox")),
30 array("enable_trackback", GetMessage("BLOG_ENABLE_TRACKBACK"), "Y", Array("checkbox")),
31 array("allow_video", GetMessage("BLOG_ALLOW_VIDEO"), "Y", Array("checkbox")),
32 array("parser_nofollow", GetMessage("BLOG_PARSER_NOFOLLOW"), "N", Array("checkbox")),
33 array("use_autosave", GetMessage("BLOG_USE_AUTOSAVE"), "Y", Array("checkbox")),
34 array("use_image_perm", GetMessage("BLOG_USE_IMAGE_PERM"), "N", Array("checkbox")),
35 array("captcha_choice", GetMessage("BLOG_CAPTCHA_CHOICE"), "U", Array("selectbox"), Array("U" => GetMessage("BLOG_CAPTCHA_CHOICE_U"), "A" => GetMessage("BLOG_CAPTCHA_CHOICE_A"), "D" => GetMessage("BLOG_CAPTCHA_CHOICE_D"))),
36 array("send_blog_ping", GetMessage("BLOG_SEND_BLOG_PING"), "N", Array("checkbox")),
37 array("send_blog_ping_address", GetMessage("BLOG_SEND_BLOG_PING_ADDRESS"), "http://ping.blogs.yandex.ru/RPC2\r\nhttp://rpc.weblogs.com/RPC2", Array("textarea", 5, 40)),
38 array("post_everyone_max_rights", GetMessage("BLOG_POST_EVERYONE_MAX_RIGHTS"), "I", Array("selectbox"), $GLOBALS["AR_BLOG_PERMS_EVERYONE"]),
39 array("comment_everyone_max_rights", GetMessage("BLOG_COMMENT_EVERYONE_MAX_RIGHTS"), "P", Array("selectbox"), $GLOBALS["AR_BLOG_PERMS"]),
40 array("post_auth_user_max_rights", GetMessage("BLOG_POST_AUTH_USER_MAX_RIGHTS"), "I", Array("selectbox"), $GLOBALS["AR_BLOG_PERMS"]),
41 array("comment_auth_user_max_rights", GetMessage("BLOG_COMMENT_AUTH_USER_MAX_RIGHTS"), "P", Array("selectbox"), $GLOBALS["AR_BLOG_PERMS"]),
42 array("post_group_user_max_rights", GetMessage("BLOG_POST_GROUP_USER_MAX_RIGHTS"), "W", Array("selectbox"), $GLOBALS["AR_BLOG_PERMS"]),
43 array("comment_group_user_max_rights", GetMessage("BLOG_COMMENT_GROUP_USER_MAX_RIGHTS"), "W", Array("selectbox"), $GLOBALS["AR_BLOG_PERMS"]),
44 array("smile_gallery_id", GetMessage("BLOG_OPTIONS_SMILE_GALLERY_ID"), 0, Array("selectbox"), CSmileGallery::getListForForm()),
45);
46
48if ($_SERVER['REQUEST_METHOD']=="POST" && $Update <> '' && $BLOG_RIGHT=="W" && check_bitrix_sessid() && $use_sonnet_button == '')
49{
50 foreach($arAllOptions as $option)
51 {
52 $name = $option[0];
53 $val = $$name;
54 if ($option[3][0] == "checkbox" && $val != "Y")
55 $val = "N";
56 COption::SetOptionString("blog", $name, $val, $option[1]);
57 }
58
59 $arPaths = array();
60 $arPathsNullType = array();
62 while ($arPath = $dbPaths->Fetch())
63 {
64 if($arPath["TYPE"] <> '')
65 $arPaths[$arPath["SITE_ID"]][$arPath["TYPE"]] = $arPath["ID"];
66 else
67 $arPathsNullType[$arPath["SITE_ID"]] = $arPath["ID"];
68 }
69
70 $arType = array("B", "P", "U", "G", "H");
71 /*
72 "B" - user blog,
73 "P" - user post,
74 "U" - just user,
75 "G" - group blog,
76 "H" - group post
77 */
78 $dbSites = CSite::GetList('', '', array("ACTIVE" => "Y"));
79 while ($arSite = $dbSites->Fetch())
80 {
81 BXClearCache(True, "/".$arSite["LID"]."/blog/");
82
83 foreach($arType as $type)
84 {
85 if (intval($arPaths[$arSite["LID"]][$type])>0)
86 {
87 if (${"SITE_PATH_".$arSite["LID"]."_".$type} <> '')
88 CBlogSitePath::Update($arPaths[$arSite["LID"]][$type], array("PATH" => ${"SITE_PATH_".$arSite["LID"]."_".$type}, "TYPE"=>$type));
89 else
90 CBlogSitePath::Delete($arPaths[$arSite["LID"]][$type]);
91 }
92 else
93 {
95 array(
96 "SITE_ID" => $arSite["LID"],
97 "PATH" => ${"SITE_PATH_".$arSite["LID"]."_".$type},
98 "TYPE" => $type
99 )
100 );
101 }
102 }
103 unset($arPaths[$arSite["LID"]]);
104
105 if(${"SITE_PATH_".$arSite["LID"]} <> '')
106 ${"SITE_PATH_".$arSite["LID"]} = "/".trim(str_replace("\\", "/", ${"SITE_PATH_".$arSite["LID"]}), "/");
107 if (array_key_exists($arSite["LID"], $arPathsNullType))
108 {
109 if (${"SITE_PATH_".$arSite["LID"]} <> '')
110 CBlogSitePath::Update($arPathsNullType[$arSite["LID"]], array("PATH" => ${"SITE_PATH_".$arSite["LID"]}));
111 else
112 CBlogSitePath::Delete($arPathsNullType[$arSite["LID"]]);
113 }
114 else
115 {
117 array(
118 "SITE_ID" => $arSite["LID"],
119 "PATH" => ${"SITE_PATH_".$arSite["LID"]}
120 )
121 );
122 }
123 unset($arPathsNullType[$arSite["LID"]]);
124 }
125
126 foreach ($arPaths as $key)
127 foreach($key as $val)
129}
130
131
132if ($strWarning <> '')
134
136 array("DIV" => "edit1", "TAB" => GetMessage("BLO_TAB_SET"), "ICON" => "blog_settings", "TITLE" => GetMessage("BLO_TAB_SET_ALT")),
137 array("DIV" => "edit3", "TAB" => GetMessage("BLO_SITE_PATH3"), "ICON" => "blog_path", "TITLE" => GetMessage("BLO_SITE_PATH3")),
138 array("DIV" => "edit2", "TAB" => GetMessage("BLO_TAB_RIGHTS"), "ICON" => "blog_settings", "TITLE" => GetMessage("BLO_TAB_RIGHTS_ALT")),
139);
140
142?>
143<?
144$tabControl->Begin();
145?><form method="POST" action="<?echo $APPLICATION->GetCurPage()?>?mid=<?=htmlspecialcharsbx($mid)?>&lang=<?=LANGUAGE_ID?>"><?
147$tabControl->BeginNextTab();
148
149 foreach($arAllOptions as $Option)
150 {
151 $val = COption::GetOptionString("blog", $Option[0], $Option[2]);
152 $type = $Option[3];
153 ?>
154 <tr>
155 <td valign="top" width="50%"><?
156 if ($type[0]=="checkbox")
157 echo "<label for=\"".htmlspecialcharsbx($Option[0])."\">".$Option[1]."</label>";
158 else
159 echo $Option[1];
160 ?></td>
161 <td valign="middle" width="50%">
162 <?if($type[0]=="checkbox"):?>
163 <input type="checkbox" name="<?echo htmlspecialcharsbx($Option[0])?>" id="<?echo htmlspecialcharsbx($Option[0])?>" value="Y"<?if($val=="Y")echo" checked";?>>
164 <?elseif($type[0]=="text"):?>
165 <input type="text" size="<?echo $type[1]?>" value="<?echo htmlspecialcharsbx($val)?>" name="<?echo htmlspecialcharsbx($Option[0])?>">
166 <?elseif($type[0]=="textarea"):?>
167 <textarea rows="<?echo $type[1]?>" cols="<?echo $type[2]?>" name="<?echo htmlspecialcharsbx($Option[0])?>"><?echo htmlspecialcharsbx($val)?></textarea>
168 <?elseif($type[0]=="selectbox"):?>
169 <select name="<?echo htmlspecialcharsbx($Option[0])?>" id="<?echo htmlspecialcharsbx($Option[0])?>">
170 <?foreach($Option[4] as $v => $k)
171 {
172 ?><option value="<?=$v?>"<?if($val==$v)echo" selected";?>><?=$k?></option><?
173 }
174 ?>
175 </select>
176 <?endif?>
177 </td>
178 </tr>
179 <?
180 }
181 ?>
182 <?$tabControl->BeginNextTab();?>
183 <tr class="heading">
184 <td colspan="2"><?=GetMessage("BLO_SITE_PATH2")?></td>
185 </tr>
186 <?
187 $arPaths = array();
189 while ($arPath = $dbPaths->Fetch())
190 $arPaths[$arPath["SITE_ID"]][$arPath["TYPE"]] = $arPath["PATH"];
191
192 $dbSites = CSite::GetList('', '', Array("ACTIVE" => "Y"));
193 while ($arSite = $dbSites->Fetch())
194 {
195 ?>
196 <tr>
197 <td valign="top" colspan="2" align="center"><?= str_replace("#SITE#", $arSite["LID"], GetMessage("BLO_SITE_PATH_SITE")) ?>:</td>
198 </tr>
199 <tr>
200 <td align="center" colspan="2">
201 <table cellspacing="2" width="100%">
202 <tr>
203 <td align="right" width="50%"><?=GetMessage("BLO_SITE_PATH_SITE_BLOG")?>:</td>
204 <td width="50%"><input type="text" size="40" value="<?echo htmlspecialcharsbx($arPaths[$arSite["LID"]]["B"])?>" name="SITE_PATH_<?= $arSite["LID"] ?>_B"></td>
205 </tr>
206 <tr>
207 <td align="right"><?=GetMessage("BLO_SITE_PATH_SITE_POST")?>:</td>
208 <td><input type="text" size="40" value="<?echo htmlspecialcharsbx($arPaths[$arSite["LID"]]["P"])?>" name="SITE_PATH_<?= $arSite["LID"] ?>_P"></td>
209 </tr>
210 <tr>
211 <td align="right"><?=GetMessage("BLO_SITE_PATH_SITE_USER")?>:</td>
212 <td><input type="text" size="40" value="<?echo htmlspecialcharsbx($arPaths[$arSite["LID"]]["U"])?>" name="SITE_PATH_<?= $arSite["LID"] ?>_U"></td>
213 </tr>
214 <tr>
215 <td align="right"><?=GetMessage("BLO_SITE_PATH_SITE_GROUP_BLOG")?>:</td>
216 <td><input type="text" size="40" value="<?echo htmlspecialcharsbx($arPaths[$arSite["LID"]]["G"])?>" name="SITE_PATH_<?= $arSite["LID"] ?>_G"></td>
217 </tr>
218 <tr>
219 <td align="right"><?=GetMessage("BLO_SITE_PATH_SITE_GROUP_POST")?>:</td>
220 <td><input type="text" size="40" value="<?echo htmlspecialcharsbx($arPaths[$arSite["LID"]]["H"])?>" name="SITE_PATH_<?= $arSite["LID"] ?>_H"></td>
221 </tr>
222 </table>
223 </td>
224 </tr>
225 <?
226 }
227 ?>
228 <tr>
229 <td valign="top" align="center" colspan="2"><?=GetMessage("BLO_PATH_EXAMPLE")?>:</td>
230 </tr>
231 <tr>
232 <td colspan="2" align="center">
233 <table cellspacing="2" width="0%">
234 <tr>
235 <td align="right"><?=GetMessage("BLO_SITE_PATH_SITE_BLOG")?>:</td>
236 <td>/blog/#blog#/</td>
237 </tr>
238 <tr>
239 <td align="right"><?=GetMessage("BLO_SITE_PATH_SITE_POST")?>:</td>
240 <td>/blog/#blog#/#post_id#.php</td>
241 </tr>
242 <tr>
243 <td align="right"><?=GetMessage("BLO_SITE_PATH_SITE_USER")?>:</td>
244 <td>/blog/user/#user_id#.php</td>
245 </tr>
246 </table>
247 </td>
248 </tr>
249 <tr class="heading">
250 <td colspan="2"><?=GetMessage("BLO_SITE_PATH")?></td>
251 </tr>
252 <?
253 $arPaths = array();
255 while ($arPath = $dbPaths->Fetch())
256 {
257 if($arPath["TYPE"] == '')
258 $arPaths[$arPath["SITE_ID"]] = $arPath["PATH"];
259 }
260
261 $dbSites = CSite::GetList('', '', Array("ACTIVE" => "Y"));
262 while ($arSite = $dbSites->Fetch())
263 {
264 ?>
265 <tr>
266 <td valign="top" width="50%">
267 <?= str_replace("#SITE#", $arSite["LID"], GetMessage("BLO_SITE_PATH_SITE")) ?>:</td>
268 <td valign="middle" width="50%">
269 <input type="text" size="40" value="<?echo htmlspecialcharsbx($arPaths[$arSite["LID"]])?>" name="SITE_PATH_<?= $arSite["LID"] ?>">
270 </td>
271 </tr>
272 <?
273 }
274 ?>
275
276<?$tabControl->BeginNextTab();?>
277
278 <?require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/admin/group_rights.php");?>
279<?$tabControl->Buttons();?>
280<script>
281function RestoreDefaults()
282{
283 if (confirm('<?echo AddSlashes(GetMessage("MAIN_HINT_RESTORE_DEFAULTS_WARNING"))?>'))
284 window.location = "<?echo $APPLICATION->GetCurPage()?>?RestoreDefaults=Y&lang=<?echo LANG?>&mid=<?echo urlencode($mid)."&".bitrix_sessid_get();?>";
285}
286</script>
287
288<input type="submit" <?if ($BLOG_RIGHT<"W") echo "disabled" ?> name="Update" value="<?echo GetMessage("MAIN_SAVE")?>">
289<input type="hidden" name="Update" value="Y">
290<input type="reset" name="reset" value="<?echo GetMessage("MAIN_RESET")?>">
291<input type="button" <?if ($BLOG_RIGHT<"W") echo "disabled" ?> title="<?echo GetMessage("MAIN_HINT_RESTORE_DEFAULTS")?>" OnClick="RestoreDefaults();" value="<?echo GetMessage("MAIN_RESTORE_DEFAULTS")?>">
292<?$tabControl->End();?>
293</form>
294<?endif;?>
return select
Определения access_edit.php:440
$type
Определения options.php:106
$dbSites
Определения options.php:14
$strWarning
Определения options.php:47
$BLOG_RIGHT
Определения options.php:3
$dbPaths
Определения options.php:254
global $APPLICATION
Определения include.php:80
$module_id
Определения options.php:6
if($canUseYandexMarket) $strWarning
Определения options.php:74
if($_SERVER $arAllOptions['REQUEST_METHOD']=='GET' &&!empty($_REQUEST['RestoreDefaults']) &&! $bReadOnly &&check_bitrix_sessid())
Определения options.php:63
static ShowMessage($message)
Определения admin_lib.php:2351
static Delete($ID)
Определения blog_site_path.php:51
static GetList($by='c_sort', $order='asc', $arFilter=[], $SHOW_USERS_AMOUNT="N")
Определения group.php:136
static GetList($by="sort", $order="asc", $arFilter=[])
Определения site.php:605
static Add($arFields)
Определения blog_site_path.php:8
static GetList($arOrder=Array("ID"=> "DESC"), $arFilter=Array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
Определения blog_site_path.php:97
static Update($ID, $arFields)
Определения blog_site_path.php:52
$arPath
Определения file_edit.php:72
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
foreach( $arCellTemplates as $key=> $value) foreach( $arCellTemplates as $key=> $value)
global $MESS
Определения bill.php:2
$Update
Определения options.php:212
$arPaths
Определения options.php:169
$RestoreDefaults
Определения options.php:55
$_SERVER["DOCUMENT_ROOT"]
Определения cron_frame.php:9
$tabControl
Определения csv_new_setup.php:244
$aTabs
Определения csv_new_setup.php:238
endif
Определения csv_new_setup.php:990
$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
BXClearCache($full=false, $initdir='')
Определения tools.php:5150
$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
if(empty($signedUserToken)) $key
Определения quickway.php:257
font size
Определения invoice.php:442
text align
Определения template.php:556
$option
Определения options.php:1711
$val
Определения options.php:1793
else $Option[0]
Определения options.php:387
$k
Определения template_pdf.php:567
$GLOBALS['_____370096793']
Определения update_client.php:1