IncludeModuleLangFile(__FILE__); $module_id = "forum"; $FORUM_RIGHT = $APPLICATION->GetGroupRight($module_id); $zr = ""; if (! ($FORUM_RIGHT >= "R")) $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED")); ClearVars(); CModule::IncludeModule("forum"); $request = \Bitrix\Main\Context::getCurrent()->getRequest(); if ($request->isPost() !== true && $FORUM_RIGHT > "R" && $request->getQuery('RestoreDefaults') !== null && check_bitrix_sessid()) { COption::RemoveOption("forum"); $z = CGroup::GetList("id", "asc", array("ACTIVE" => "Y", "ADMIN" => "N")); while($zr = $z->Fetch()) $APPLICATION->DelGroupRight($module_id, array($zr["ID"])); } $arLangs = array(); $arNameStatusesDefault = array(); $arNameStatuses = @unserialize(COption::GetOptionString("forum", "statuses_name"), ["allowed_classes" => false]); $db_res = CLanguage::GetList(); if ($db_res && $res = $db_res->Fetch()) { do { $arLangs[$res["LID"]] = $res; $name = array( "guest" => "Guest", "user" => "User", "moderator" => "Moderator", "editor" => "Editor", "administrator" => "Administrator"); /* GetMessage("FR_GUEST"); GetMessage("FR_USER"); GetMessage("FR_MODERATOR"); GetMessage("FR_EDITOR"); GetMessage("FR_ADMINISTRATOR"); */ $arMess = IncludeModuleLangFile(__FILE__, $res["LID"], true); foreach ($name as $k => $v): $name[$k] = $arMess["FR_".mb_strtoupper($k)] ?? $v; endforeach; $arNameStatusesDefault[$res["LID"]] = $name; if (empty($arNameStatuses[$res["LID"]]) || !is_array($arNameStatuses[$res["LID"]])): $arNameStatuses[$res["LID"]] = $name; else: foreach ($name as $k => $v) { $n = trim($arNameStatuses[$res["LID"]][$k]); $arNameStatuses[$res["LID"]][$k] = (empty($n) ? $v : $n); } endif; } while ($res = $db_res->Fetch()); $tmp = array_diff(array_keys($arNameStatuses), array_keys($arNameStatusesDefault)); foreach ($arNameStatuses as $k => $v): if (!is_set($arNameStatusesDefault, $k)) unset($arNameStatuses[$k]); endforeach; } if ($_SERVER["REQUEST_METHOD"] == "POST" && $FORUM_RIGHT == "W" && $_REQUEST["Update"] <> '' && check_bitrix_sessid()) { COption::SetOptionString("forum", "avatar_max_size", $_REQUEST["avatar_max_size"]); COption::SetOptionString("forum", "avatar_max_width", $_REQUEST["avatar_max_width"]); COption::SetOptionString("forum", "avatar_max_height", $_REQUEST["avatar_max_height"]); COption::SetOptionString("forum", "file_max_size", $_REQUEST["file_max_size"]); COption::SetOptionString("forum", "parser_nofollow", ($_REQUEST["parser_nofollow"] == "Y" ? "Y" : "N")); COption::SetOptionString("forum", "parser_link_target", ($_REQUEST["parser_link_target"] == "_blank" ? "_blank" : "_self")); COption::SetOptionInt("forum", "smile_gallery_id", $_REQUEST["smile_gallery_id"]); COption::SetOptionString("forum", "FORUM_FROM_EMAIL", $_REQUEST["FORUM_FROM_EMAIL"]); //COption::SetOptionString("forum", "FORUMS_PER_PAGE", $_REQUEST["FORUMS_PER_PAGE_MAIN"]); //COption::SetOptionString("forum", "TOPICS_PER_PAGE", $_REQUEST["TOPICS_PER_PAGE"]); //COption::SetOptionString("forum", "MESSAGES_PER_PAGE", $_REQUEST["MESSAGES_PER_PAGE"]); COption::SetOptionString("forum", "SHOW_VOTES", (($_REQUEST["SHOW_VOTES"]=="Y") ? "Y" : "N" )); //COption::SetOptionString("forum", "SHOW_ICQ_CONTACT", (($_REQUEST["SHOW_ICQ_CONTACT"]=="Y") ? "Y" : "N" )); COption::SetOptionString("forum", "MaxPrivateMessages", $_REQUEST["MaxPrivateMessages"]); COption::SetOptionString("forum", "UsePMVersion", $_REQUEST["UsePMVersion"]); // COption::SetOptionString("forum", "MESSAGE_HTML", ($_REQUEST["MESSAGE_HTML"]=="Y" ? "Y" : "N" )); COption::SetOptionString("forum", "FORUM_GETHOSTBYADDR", (($_REQUEST["FORUM_GETHOSTBYADDR"]=="Y") ? "Y" : "N" )); COption::SetOptionString("forum", "FILTER", (($_REQUEST["FILTER"]=="Y") ? "Y" : "N" )); COption::SetOptionString("forum", "FILTER_ACTION", $_REQUEST["FILTER_ACTION"]); COption::SetOptionString("forum", "FILTER_RPL", $_REQUEST["FILTER_RPL"]); COption::SetOptionString("forum", "FILTER_MARK", $_REQUEST["FILTER_MARK"]); COption::SetOptionString("forum", "search_message_count", $_REQUEST["search_message_count"]); COption::SetOptionString("forum", "show_avatar_photo", (($_REQUEST["show_avatar_photo"]=="Y") ? "Y" : "N" )); COption::SetOptionString("forum", "USE_AUTOSAVE", (($_REQUEST["USE_AUTOSAVE"]=="Y") ? "Y" : "N" )); COption::SetOptionString("forum", "USER_EDIT_OWN_POST", (($_REQUEST["USER_EDIT_OWN_POST"]=="Y") ? "Y" : "N" )); COption::SetOptionString("forum", "USER_SHOW_NAME", (($_REQUEST["USER_SHOW_NAME"]=="Y") ? "Y" : "N" )); COption::SetOptionString("forum", "USE_COOKIE", (($_REQUEST["USE_COOKIE"]=="Y") ? "Y" : "N" )); if ($_REQUEST["LOGS"] == "Y"): $_REQUEST["LOGS"] = ($_REQUEST["LOGS_ADDITIONAL"] == "Y" ? "U" : "Q"); else: $_REQUEST["LOGS"] = "A"; endif; // A - no logs, Q - log for moderate, U - log for all COption::SetOptionString("forum", "LOGS", $_REQUEST["LOGS"]); //**************************************************************************************************************** foreach ($_REQUEST["FILTER_DICT"] as $l => $val) { COption::SetOptionString("forum", "FILTER_DICT_W", $val["W"], false, $l); COption::SetOptionString("forum", "FILTER_DICT_T", $val["T"], false, $l); } foreach ($arNameStatuses as $lid => $names): foreach ($names as $key => $val): $n = trim($_REQUEST["STATUS_NAME"][$lid][$key]); $arNameStatuses[$lid][$key] = (!empty($n) ? $n : $arNameStatuses[$lid][$key]); endforeach; endforeach; COption::SetOptionString("forum", "statuses_name", serialize($arNameStatuses)); //***************************************************************************************************************** } $aTabs = array( array("DIV" => "edit1", "TAB" => GetMessage("MAIN_TAB_SET"), "ICON" => "vote_settings", "TITLE" => GetMessage("MAIN_TAB_TITLE_SET")), array("DIV" => "edit2", "TAB" => GetMessage("MAIN_TAB_RIGHTS"), "ICON" => "vote_settings", "TITLE" => GetMessage("MAIN_TAB_TITLE_RIGHTS")), array("DIV" => "edit3", "TAB" => GetMessage("USE_FILTER"), "ICON" => "vote_settings", "TITLE" => GetMessage("USE_FILTER")), ); $tabControl = new CAdminTabControl("tabControl", $aTabs); ?> CForumDBTools::GetDBUpdaters(); $tabControl->Begin(); ?>